summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-03 15:59:12 +0200
committerhut <hut@lavabit.com>2011-10-03 15:59:12 +0200
commitd40d1cf901a914430190068e6d8f56e0eb29107d (patch)
treeb7adacc7a8b25938576dd040329126392a39fd29
parent0d7171c2f8fe155d8a715f4704495085736a684a (diff)
downloadranger-d40d1cf901a914430190068e6d8f56e0eb29107d.tar.gz
defaults/rc.conf: use copyXmap to simplify rc.conf
-rw-r--r--ranger/defaults/rc.conf175
1 files changed, 84 insertions, 91 deletions
diff --git a/ranger/defaults/rc.conf b/ranger/defaults/rc.conf
index ecd64501..d8ce123d 100644
--- a/ranger/defaults/rc.conf
+++ b/ranger/defaults/rc.conf
@@ -31,10 +31,9 @@ alias qall quitall
 # ===================================================================
 
 # Basic
-map Q quit!
-map q quit
-map ZZ quit
-map ZQ quit
+map     Q quit!
+map     q quit
+copymap q ZZ ZQ
 
 map R     reload_cwd
 map <C-r> reset
@@ -44,7 +43,7 @@ map <C-c> abort
 map i display_file
 map ? help
 map W display_log
-map w eval fm.ui.open_taskview()
+map w taskview_open
 map S shell $SHELL
 
 map :  console
@@ -66,20 +65,6 @@ map v       mark_files all=True toggle=True
 map V       mark_files all=True val=False
 map uv      mark_files all=True val=False
 
-# VIM-like
-map gg    move to=0
-map G     move to=-1
-map j     move down=1
-map k     move up=1
-map h     move left=1
-map l     move right=1
-map J     move down=0.5 pages=True
-map K     move up=0.5   pages=True
-map <C-d> move down=0.5 pages=True
-map <C-u> move up=0.5   pages=True
-map <C-f> move down=1   pages=True
-map <C-b> move up=1     pages=True
-
 # For the nostalgics: Midnight Commander bindings
 map <F1> help
 map <F3> display_file
@@ -103,6 +88,21 @@ map <CR>       move right=1
 map <DEL>      console delete
 map <INS>      console touch
 
+# VIM-like
+copymap <UP>       k
+copymap <DOWN>     j
+copymap <LEFT>     h
+copymap <RIGHT>    l
+copymap <HOME>     gg
+copymap <END>      G
+copymap <PAGEDOWN> <C-F>
+copymap <PAGEUP>   <C-B>
+
+map J  move down=0.5  pages=True
+map K  move up=0.5    pages=True
+copymap J <C-D>
+copymap K <C-U>
+
 # Jumping around
 map H     history_go -1
 map L     history_go 1
@@ -230,15 +230,14 @@ map zv    toggle_option use_preview_script
 map zf    console filter 
 
 # Bookmarks
-map `<bg>   draw_bookmarks
-map '<bg>   draw_bookmarks
-map m<bg>   draw_bookmarks
-map um<bg>  draw_bookmarks
 map `<any>  enter_bookmark %any
 map '<any>  enter_bookmark %any
 map m<any>  set_bookmark %any
 map um<any> unset_bookmark %any
 
+map m<bg>   draw_bookmarks
+copymap m<bg>  um<bg> `<bg> '<bg>
+
 # Beware. I haven't figured out how to make these keybindings pretty yet:
 
 # map +ow shell -d chmod o+w (one mapping for each combination)
@@ -247,8 +246,6 @@ eval import itertools; [cmd("map +%s%s shell -d chmod %s+%s %%s" % (mode+mode))
 # map -ow shell -d chmod o+w (one mapping for each combination)
 eval import itertools; [cmd("map -%s%s shell -d chmod %s-%s %%s" % (mode+mode)) for mode in itertools.product("ugoa", "rwxXst")]
 
-
-
 # ===================================================================
 # == Define keys for the console
 # ===================================================================
@@ -257,85 +254,76 @@ eval import itertools; [cmd("map -%s%s shell -d chmod %s-%s %%s" % (mode+mode))
 # Basic
 cmap <tab>   eval fm.ui.console.tab()
 cmap <s-tab> eval fm.ui.console.tab(-1)
-cmap <C-c>   eval fm.ui.console.close()
-cmap <C-d>   eval fm.ui.console.close()
 cmap <ESC>   eval fm.ui.console.close()
 cmap <CR>    eval fm.ui.console.execute()
-cmap <C-j>   eval fm.ui.console.execute()
 cmap <C-l>   redraw_window
 
-# This special expression allows typing in numerals:
-cmap <allow_quantifiers> false
+copycmap <ESC> <C-c>
+copycmap <CR>  <C-j>
 
 # Move around
+cmap <up>    eval fm.ui.console.history_move(-1)
+cmap <down>  eval fm.ui.console.history_move(1)
 cmap <left>  eval fm.ui.console.move(left=1)
 cmap <right> eval fm.ui.console.move(right=1)
 cmap <home>  eval fm.ui.console.move(right=0, absolute=True)
 cmap <end>   eval fm.ui.console.move(right=-1, absolute=True)
-cmap <up>    eval fm.ui.console.history_move(-1)
-cmap <down>  eval fm.ui.console.history_move(1)
-
-# And of course the emacs way
-cmap <C-b>   eval fm.ui.console.move(left=1)
-cmap <C-f>   eval fm.ui.console.move(right=1)
-cmap <C-a>   eval fm.ui.console.move(right=0, absolute=True)
-cmap <C-e>   eval fm.ui.console.move(right=-1, absolute=True)
-cmap <C-p>   eval fm.ui.console.history_move(-1)
-cmap <C-n>   eval fm.ui.console.history_move(1)
 
 # Line Editing
-# Note: There are multiple ways to express backspaces.  <backspace> (code 263)
-# and <backspace2> (code 127).  To be sure, use both.
 cmap <backspace>  eval fm.ui.console.delete(-1)
-cmap <backspace2> eval fm.ui.console.delete(-1)
 cmap <delete>     eval fm.ui.console.delete(0)
-cmap <C-h>        eval fm.ui.console.delete(-1)
-cmap <C-d>        eval fm.ui.console.delete(0)
 cmap <C-w>        eval fm.ui.console.delete_word()
 cmap <C-k>        eval fm.ui.console.delete_rest(1)
 cmap <C-u>        eval fm.ui.console.delete_rest(-1)
 cmap <C-y>        eval fm.ui.console.paste()
 
+# And of course the emacs way
+copycmap <up>        <C-p>
+copycmap <down>      <C-n>
+copycmap <left>      <C-b>
+copycmap <right>     <C-f>
+copycmap <home>      <C-a>
+copycmap <end>       <C-e>
+copycmap <delete>    <C-d>
+copycmap <backspace> <C-h>
+
+# Note: There are multiple ways to express backspaces.  <backspace> (code 263)
+# and <backspace2> (code 127).  To be sure, use both.
+copycmap <backspace> <backspace2>
+
+# This special expression allows typing in numerals:
+cmap <allow_quantifiers> false
 
 # ===================================================================
 # == Pager Keybindings
 # ===================================================================
 
 # Movement
-pmap j       eval -q fm.ui.browser.pager.move(down=1)
-pmap k       eval -q fm.ui.browser.pager.move(up=1)
-pmap gg      eval -q fm.ui.browser.pager.move(down=0, absolute=True)
-pmap G       eval -q fm.ui.browser.pager.move(down=-1, absolute=True)
-pmap <cr>    eval -q fm.ui.browser.pager.move(down=1)
-pmap <down>  eval -q fm.ui.browser.pager.move(down=1)
-pmap <up>    eval -q fm.ui.browser.pager.move(up=1)
-pmap <home>  eval -q fm.ui.browser.pager.move(down=0, absolute=True)
-pmap <end>   eval -q fm.ui.browser.pager.move(down=-1, absolute=True)
-pmap <C-n>   eval -q fm.ui.browser.pager.move(down=1)
-pmap <C-p>   eval -q fm.ui.browser.pager.move(up=1)
-
-pmap d          eval -q fm.ui.browser.pager.move(down=0.5, pages=True)
-pmap <C-d>      eval -q fm.ui.browser.pager.move(down=0.5, pages=True)
-pmap u          eval -q fm.ui.browser.pager.move(up=  0.5, pages=True)
-pmap <C-u>      eval -q fm.ui.browser.pager.move(up=  0.5, pages=True)
-pmap n          eval -q fm.ui.browser.pager.move(down=1.0, pages=True)
-pmap f          eval -q fm.ui.browser.pager.move(down=1.0, pages=True)
-pmap <pagedown> eval -q fm.ui.browser.pager.move(down=1.0, pages=True)
-pmap p          eval -q fm.ui.browser.pager.move(up=  1.0, pages=True)
-pmap b          eval -q fm.ui.browser.pager.move(up=  1.0, pages=True)
-pmap <pageup>   eval -q fm.ui.browser.pager.move(up=  1.0, pages=True)
-pmap <space>    eval -q fm.ui.browser.pager.move(down=0.8, pages=True)
-
-pmap h       eval -q fm.ui.browser.pager.move(left=4)
-pmap l       eval -q fm.ui.browser.pager.move(right=4)
-pmap <left>  eval -q fm.ui.browser.pager.move(left=4)
-pmap <right> eval -q fm.ui.browser.pager.move(right=4)
+pmap  <down>      pager_move  down=1
+pmap  <up>        pager_move  up=1
+pmap  <left>      pager_move  left=4
+pmap  <right>     pager_move  right=4
+pmap  <home>      pager_move  to=0
+pmap  <end>       pager_move  to=-1
+pmap  <pagedown>  pager_move  down=1.0  pages=True
+pmap  <pageup>    pager_move  up=1.0    pages=True
+pmap  <C-d>       pager_move  down=0.5  pages=True
+pmap  <C-u>       pager_move  up=0.5    pages=True
+
+copypmap <UP>       k  <C-p>
+copypmap <DOWN>     j  <C-n> <CR>
+copypmap <LEFT>     h
+copypmap <RIGHT>    l
+copypmap <HOME>     g
+copypmap <END>      G
+copypmap <C-d>      d
+copypmap <C-u>      u
+copypmap <PAGEDOWN> n  f  <C-F>  <Space>
+copypmap <PAGEUP>   p  b  <C-B>
 
 # Basic
-pmap q      eval -q fm.ui.close_pager(); fm.ui.close_embedded_pager()
-pmap i      eval -q fm.ui.close_pager(); fm.ui.close_embedded_pager()
-pmap <ESC>  eval -q fm.ui.close_pager(); fm.ui.close_embedded_pager()
-pmap <F3>   eval -q fm.ui.close_pager(); fm.ui.close_embedded_pager()
+pmap     <ESC> pager_close
+copypmap <ESC> q Q i <F3>
 pmap E      edit_file
 
 # ===================================================================
@@ -343,14 +331,22 @@ pmap E      edit_file
 # ===================================================================
 
 # Movement
-tmap j      eval -q fm.ui.taskview.move(down=1)
-tmap k      eval -q fm.ui.taskview.move(up=1)
-tmap gg     eval -q fm.ui.taskview.move(down=0, absolute=True)
-tmap G      eval -q fm.ui.taskview.move(down=-1, absolute=True)
-tmap <down> eval -q fm.ui.taskview.move(down=1)
-tmap <up>   eval -q fm.ui.taskview.move(up=1)
-tmap <home> eval -q fm.ui.taskview.move(down=0, absolute=True)
-tmap <end>  eval -q fm.ui.taskview.move(down=-1, absolute=True)
+tmap <up>        taskview_move up=1
+tmap <down>      taskview_move down=1
+tmap <home>      taskview_move to=0
+tmap <end>       taskview_move to=-1
+tmap <pagedown>  taskview_move down=1.0  pages=True
+tmap <pageup>    taskview_move up=1.0    pages=True
+tmap <C-d>       taskview_move down=0.5  pages=True
+tmap <C-u>       taskview_move up=0.5    pages=True
+
+copytmap <UP>       k  <C-p>
+copytmap <DOWN>     j  <C-n> <CR>
+copytmap <HOME>     g
+copytmap <END>      G
+copytmap <C-u>      u
+copytmap <PAGEDOWN> n  f  <C-F>  <Space>
+copytmap <PAGEUP>   p  b  <C-B>
 
 # Changing priority and deleting tasks
 tmap J          eval -q fm.ui.taskview.task_move(-1)
@@ -360,9 +356,6 @@ tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
 tmap <pageup>   eval -q fm.ui.taskview.task_move(0)
 tmap <delete>   eval -q fm.ui.taskview.task_remove()
 
-# A bunch of aliases for closing
-tmap w eval -q fm.ui.close_taskview()
-tmap q eval -q fm.ui.close_taskview()
-tmap Q eval -q fm.ui.close_taskview()
-tmap <esc> eval -q fm.ui.close_taskview()
-tmap <c-c> eval -q fm.ui.close_taskview()
+# Basic
+tmap <ESC> taskview_close
+copytmap <ESC> q Q w <C-c>
an class='oid'>13235878 ^
3f30e4c6 ^
















































































c3964ff6 ^















fa805850 ^






















































611e9f2e ^
8d32a9aa ^


f9f419af ^
























ccadc6e6 ^










8d32a9aa ^

fa805850 ^

924ed08a ^
606c1ab4 ^
114641e2 ^
be19cb87 ^

114641e2 ^
985f7f79 ^
fee1bbd8 ^
72980059 ^
1696ed83 ^
888b4cd8 ^


1696ed83 ^
72980059 ^
1696ed83 ^

72980059 ^
888b4cd8 ^


1696ed83 ^
72980059 ^
1696ed83 ^

3cf03158 ^

d89af9bd ^
3cf03158 ^
d89af9bd ^
c45371b3 ^

72980059 ^
888b4cd8 ^


1696ed83 ^
fee1bbd8 ^
15676346 ^
d89af9bd ^
72980059 ^
d89af9bd ^

15676346 ^


27b1e19e ^
15676346 ^



















d89af9bd ^
606c1ab4 ^
8b85a07f ^



b3998440 ^
e74050ad ^


b3998440 ^
fa805850 ^
8b85a07f ^
e74050ad ^

5e0ae917 ^







af983921 ^


2715d377 ^

002f2609 ^


af983921 ^





0ef7f1d2 ^
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444