Allow unmapping of keyboard shortcuts

This commit is contained in:
Kovid Goyal 2016-12-08 12:47:55 +05:30
parent 5a5d07eef3
commit 12751a505c
2 changed files with 5 additions and 0 deletions

View File

@ -159,8 +159,11 @@ def load_config(path: str) -> Options:
actions = frozenset(defaults.keymap.values())
with f:
vals = parse_config(f)
remove_keys = {k for k, v in vals.get('keymap', {}).items() if v in ('noop', 'no-op', 'no_op')}
vals['keymap'] = {k: v for k, v in vals.get('keymap', {}).items() if v in actions}
ans = merge_dicts(vals, ans)
for k in remove_keys:
ans['keymap'].pop(k, None)
return Options(**ans)

View File

@ -122,6 +122,8 @@ color15 #ffffff
# Key mapping
# For a list of key names, see: http://www.glfw.org/docs/latest/group__keys.html
# For a list of modifier names, see: http://www.glfw.org/docs/latest/group__mods.html
# You can use the special action no_op to unmap a keyboard shortcut that is
# assigned in the default configuration.
# Clipboard
map ctrl+shift+v paste_from_clipboard