Last active
August 29, 2015 14:11
-
-
Save drbraden/9be3000b1e381e159632 to your computer and use it in GitHub Desktop.
How to remap "jj" or "jk" to Escape in Atom when using vim-mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Built from a couple of comments at https://github.com/atom/vim-mode/issues/334 | |
# In ~/.atom/init.coffee | |
atom.workspaceView.command 'insert-incomplete-keybinding', (e)-> | |
if oe = e.originalEvent && e.originalEvent.originalEvent | |
char = String.fromCharCode(oe.which) | |
char = char.toLowerCase() unless oe.shift | |
atom.workspace.activePaneItem.insertText(char) | |
# In ~/.atom/keymap.cson | |
'.editor.vim-mode.insert-mode': | |
'j': 'insert-incomplete-keybinding' | |
# I prefer jj | |
'.vim-mode.insert-mode:not(.mini)': | |
'j j': 'vim-mode:activate-command-mode' | |
# Others prefer jk | |
#'.vim-mode.insert-mode:not(.mini)': | |
# 'j k': 'vim-mode:activate-command-mode' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment