I use commonly key combination jk
to do quick switch between INSERT/COMMAND mode in vim. The followings are the configurations for the favorite editors.
to allow quick switch INSERT/COMMAND mode in atom with keys jk
, two files need to be configured
atom.commands.add 'atom-text-editor', 'exit-insert-mode-if-proceeded-by-j': (e) ->
editor = @getModel()
pos = editor.getCursorBufferPosition()
range = [pos.traverse([0,-1]), pos]
lastChar = editor.getTextInBufferRange(range)
if lastChar != "j"
e.abortKeyBinding()
else
editor.backspace()
atom.commands.dispatch(e.currentTarget, 'vim-mode:activate-normal-mode')
'.platform-darwin':
'cmd-1': 'tree-view:toggle'
'atom-text-editor.vim-mode.insert-mode':
'k': 'exit-insert-mode-if-proceeded-by-j'
open the stylesheet of current used theme, and added the following CSS:
.editor .gutter .line-number {
&[class*="git"] {
padding-left: 0 !important;
border-left: none !important;
color: #ffffff;
opacity: 1;
}
&.git-line-added {
background-color: #73c990;
}
&.git-line-modified {
background-color: #e2c08d;
}
&.git-line-removed {
background-color: rgba(204, 102, 102, 0.6);
}
}