diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2014-05-28 10:52:17 +0200 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2014-05-28 16:19:19 +0200 |
commit | 259846dcf1829b378ffd44dc05d9f32b8e794735 (patch) | |
tree | 9823c554d049067a13158bf51fe982ef18e87740 /VimperatorrcBuilder.py | |
parent | f286fe7b04d9e4a7cd75add7141db040ee0f6784 (diff) |
add some cli bindings
the default bash command line bindings have been added
ctrl+i -> expand or complete
ctrl+j -> accept line
ctrl+p -> up line in history
ctrl+n -> down line in history
ctrl+f -> forward char
ctrl+b -> backward char
Diffstat (limited to 'VimperatorrcBuilder.py')
-rw-r--r-- | VimperatorrcBuilder.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/VimperatorrcBuilder.py b/VimperatorrcBuilder.py index 8dd1658..a73f329 100644 --- a/VimperatorrcBuilder.py +++ b/VimperatorrcBuilder.py @@ -23,6 +23,15 @@ class VimperatorrcBuilder(): bang_shortcuts = {} default_engine = 'duckduckgo' + cli_bindings = { + '<C-j>': '<Return>', + '<C-p>': '<Up>', + '<C-n>': '<Down>', + '<C-i>': '<Tab>', + '<C-f>': '<Right>', + '<C-b>': '<Left>', + } + def __init__(self): pass @@ -59,5 +68,11 @@ class VimperatorrcBuilder(): for key in self.bang_shortcuts: output += "noremap '" + self.bang_shortcuts_pfx[0] + key + "' o!" + self.bang_shortcuts[key] + ' \n' output += "noremap '" + self.bang_shortcuts_pfx[1] + key + "' t!" + self.bang_shortcuts[key] + ' \n' + + output += '\n" command line bindings\n' + for key in self.cli_bindings: + output += 'cnoremap ' + key + ' ' + self.cli_bindings[key] + '\n' + output += 'inoremap ' + key + ' ' + self.cli_bindings[key] + '\n' + return output |