diff options
author | hut <hut@lavabit.com> | 2010-04-19 22:44:18 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-04-19 22:44:18 +0200 |
commit | 8df58aad39b8a87a507bbe424216840be0edcec0 (patch) | |
tree | 044dfe4e71e24ce92c43629194197f2d559c3134 /ranger | |
parent | 24821ca5cda156c846a2308c564f51743a7f21c8 (diff) | |
download | ranger-8df58aad39b8a87a507bbe424216840be0edcec0.tar.gz |
Added midnight commander-like function keys
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/defaults/keys.py | 12 | ||||
-rw-r--r-- | ranger/help/movement.py | 12 |
2 files changed, 23 insertions, 1 deletions
diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py index 8c4c3535..fcdf7b11 100644 --- a/ranger/defaults/keys.py +++ b/ranger/defaults/keys.py @@ -124,6 +124,15 @@ map.dir('<C-E>', alias='<end>') map.dir('<C-D>', alias='<delete>') map.dir('<C-H>', alias='<backspace>') +map = midnight_commander_fkeys = KeyMapWithDirections() +map('<F1>', fm.display_help()) +map('<F3>', fm.display_file()) +map('<F4>', fm.edit_file()) +map('<F5>', fm.copy()) +map('<F6>', fm.cut()) +map('<F7>', fm.open_console(cmode.COMMAND, 'mkdir ')) +map('<F8>', fm.open_console(cmode.COMMAND, DELETE_WARNING)) +map('<F10>', fm.exit()) # =================================================================== # == Define keys in "browser" context: @@ -131,6 +140,7 @@ map.dir('<C-H>', alias='<backspace>') map = keymanager.get_context('browser') map.merge(global_keys) map.merge(vim_aliases) +map.merge(midnight_commander_fkeys) # -------------------------------------------------------- movement map('gg', fm.move(to=0)) @@ -260,7 +270,7 @@ map("`<bg>", "'<bg>", "m<bg>", fm.draw_bookmarks()) # ---------------------------------------------------- change views map('i', fm.display_file()) map('<C-P>', fm.display_log()) -map('?', '<F1>', fm.display_help()) +map('?', fm.display_help()) map('w', lambda arg: arg.fm.ui.open_taskview()) # ------------------------------------------------ system functions diff --git a/ranger/help/movement.py b/ranger/help/movement.py index f6a70eb1..e85bf336 100644 --- a/ranger/help/movement.py +++ b/ranger/help/movement.py @@ -93,6 +93,18 @@ special in whatever context you want. t tag/untag the selection T untag the selection +Midnight Commander lovers will find that the function keys work similarly. +There is no menu or drop down though. + + <F1> view the help screen + <F3> view the file + <F4> edit the file + <F5> copy the selection + <F6> cut the selection + <F7> create a directory + <F8> delete the selection + <F10> exit ranger + ============================================================================== 1.3. Searching |