diff options
-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 |