blob: 3ed27cf9fc6b4ac235460db6e97db9f976db721e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
# w3m-like keybindings for Chawan.
# Copy-paste this into your config file, or just include it (place it in
# ~/.config/chawan/w3m.toml, then at the beginning of
# ~/.config/chawan/chawan.toml, include = "w3m.toml".)
[page]
# Page/cursor movement
' ' = 'n => pager.scrollDown(pager.height * (n ?? 1))'
C-v = 'n => pager.scrollDown(pager.height * (n ?? 1))'
b = 'n => pager.scrollUp(pager.height * (n ?? 1))'
M-v = 'n => pager.scrollUp(pager.height * (n ?? 1))'
'M-[6~' = 'n => pager.scrollDown(pager.height * (n ?? 1))'
'M-[5~' = 'n => pager.scrollUp(pager.height * (n ?? 1))'
l = 'n => pager.cursorRight(n)'
h = 'n => pager.cursorLeft(n)'
j = 'n => pager.cursorDown(n)'
k = 'n => pager.cursorUp(n)'
C-f = 'n => pager.cursorRight(n)'
C-b = 'n => pager.cursorLeft(n)'
C-n = 'n => pager.cursorDown(n)'
C-p = 'n => pager.cursorUp(n)'
J = 'n => pager.scrollUp(n)'
K = 'n => pager.scrollDown(n)'
'^' = 'pager.cursorLineBegin()'
C-a = 'pager.cursorLineBegin()'
'$' = 'pager.cursorLineEnd()'
C-e = 'pager.cursorLineEnd()'
w = 'pager.cursorNextWord()'
W = 'pager.cursorWordBegin()'
'<' = 'n => pager.pageLeft(n)'
'>' = 'n => pager.pageRight(n)'
'.' = 'n => pager.scrollLeft(n)'
',' = 'n => pager.scrollRight(n)'
g = 'n => n ? pager.gotoLine(n) : pager.cursorFirstLine()'
'M-<' = 'pager.cursorFirstLine()'
G = 'n => n ? pager.gotoLine(n) : pager.cursorLastLine()'
'M->' = 'pager.cursorLastLine()'
M-g = 'n => pager.gotoLine(n)'
Z = 'pager.centerColumn()'
z = 'pager.centerLine()'
C-i = 'n => pager.cursorNextLink(n)'
C-u = 'n => pager.cursorPrevLink(n)'
M-C-i = 'n => pager.cursorPrevLink(n)'
'[' = 'n => pager.cursorNthLink(n)'
']' = 'n => pager.cursorRevNthLink(n)'
# Hyperlink selection
C-j = 'pager.click()'
C-m = 'pager.click()'
c = 'pager.peek()'
u = 'pager.peekCursor()'
#TODO download, etc
# File and URL-related actions
U = 'pager.load()'
V = 'pager.load()' #TODO file only
#TODO exec shell
# Buffer operations
B = 'pager.discardBuffer()'
v = 'pager.toggleSource()'
#TODO edit
C-l = 'pager.redraw()'
R = 'pager.reload()'
#TODO save, save source
E = '''
() => {
if (pager.url.protocol == "file:")
pager.extern(pager.getEditorCommand(pager.url.pathname))
else
pager.alert("Can't edit other than local file");
}
'''
#TODO buffer selection mode
'C-@' = '''
() => {
/* id is always the current position; this way we can clear by
setting a mark twice at the same position. */
const id = pager.buffer.cursorx + " " + pager.buffer.cursory;
if (!pager.getMarkPos(id))
pager.setMark(id);
else
pager.clearMark(id);
}
'''
M-p = '''
() => {
const next = pager.findPrevMark();
if (next)
pager.gotoMark(next);
else
pager.alert("No mark exists before here");
}
'''
M-n = '''
() => {
const next = pager.findNextMark();
if (next)
pager.gotoMark(next);
else
pager.alert("No mark exists after here");
}
'''
# Search
'/' = 'pager.searchForward()'
C-s = 'pager.searchForward()'
'?' = 'pager.searchBackward()'
C-r = 'pager.searchBackward()'
n = 'pager.searchNext()'
N = 'pager.searchPrev()'
C-w = '''
config.search.wrap = !config.search.wrap;
pager.alert("Wrap search " + (config.search.wrap ? "on" : "off"));
'''
# Misc
#TODO shell out, help file, options, cookies
C-c = 'pager.cancel()'
q = 'pager.ask("Do you want to exit Chawan?").then(x => x ? quit() : void(0))'
Q = 'quit()'
# w3m line editing is equivalent to Chawan's defaults.
|