diff options
author | hut <hut@lavabit.com> | 2011-10-03 15:58:16 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-10-03 15:58:16 +0200 |
commit | 0d7171c2f8fe155d8a715f4704495085736a684a (patch) | |
tree | 45b55f6427c0d46d7be52ee4ccd0094c53eb778e /ranger | |
parent | 8e02d5887895f41e4e2cb538556f385ca9e268fe (diff) | |
download | ranger-0d7171c2f8fe155d8a715f4704495085736a684a.tar.gz |
defaults/commands: Added copypmap, copytmap, copycmap
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/defaults/commands.py | 26 | ||||
-rw-r--r-- | ranger/ext/keybindings.py | 5 | ||||
-rw-r--r-- | ranger/gui/ui.py | 1 |
3 files changed, 29 insertions, 3 deletions
diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py index a9a232b9..61f6f0cd 100644 --- a/ranger/defaults/commands.py +++ b/ranger/defaults/commands.py @@ -820,7 +820,7 @@ class help_(Command): class copymap(Command): """ :copymap <keys> <newkeys1> [<newkeys2>...] - Copies a keybinding from <keys> to <newkeys> + Copies a "browser" keybinding from <keys> to <newkeys> """ context = 'browser' @@ -832,6 +832,30 @@ class copymap(Command): self.fm.env.keymaps.copy(self.context, self.arg(1), arg) +class copypmap(copymap): + """ + :copypmap <keys> <newkeys1> [<newkeys2>...] + Copies a "pager" keybinding from <keys> to <newkeys> + """ + context = 'pager' + + +class copycmap(copymap): + """ + :copycmap <keys> <newkeys1> [<newkeys2>...] + Copies a "console" keybinding from <keys> to <newkeys> + """ + context = 'console' + + +class copytmap(copymap): + """ + :copycmap <keys> <newkeys1> [<newkeys2>...] + Copies a "taskview" keybinding from <keys> to <newkeys> + """ + context = 'taskview' + + class unmap(Command): """ :unmap <keys> [<keys2>, ...] diff --git a/ranger/ext/keybindings.py b/ranger/ext/keybindings.py index 950cae1d..37cceb10 100644 --- a/ranger/ext/keybindings.py +++ b/ranger/ext/keybindings.py @@ -64,7 +64,10 @@ class KeyMaps(dict): last_key = keys[-1] for key in keys[:-1]: try: - pointer = pointer[key] + if isinstance(pointer[key], dict): + pointer = pointer[key] + else: + pointer[key] = pointer = dict() except: pointer[key] = pointer = dict() pointer[last_key] = leaf diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index 93f3da8e..c103fe12 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -336,7 +336,6 @@ class UI(DisplayableContainer): self.browser.visible = False self.taskview.visible = True self.taskview.focused = True - self.fm.hint('*tasks:* *dd*:remove *J*:move_down *H*:move_up') def redraw_main_column(self): self.browser.main_column.need_redraw = True |