问题
I am an avid Vim user who recently decided to give Atom a try. In vim I map ,bn & ,bp
to next buffer and previous buffer, respectively. I am trying to imitate the same behavior in Atom for switching between tabs. In my keymap.cson file I have the following:
'body':
', b n': 'pane:show-next-item'
', b p': 'pane:show-previous-item'
This will work except if I try to type just the ',' character in Vim mode insert it will not display unless I hit ',' twice.
I thought maybe the following would work, but it had no effect:
'body .vim-mode:not(.insert-mode)':
', b n': 'pane:show-next-item'
', b p': 'pane:show-previous-item'
Any help is appreciated!
回答1:
Turns out I simply forgot to add the atom-text-editor
selector before the .vim-mode:not(.insert-mode)
selector. Changed the script to the following and it worked:
'body atom-text-editor.vim-mode:not(.insert-mode)':
', b n': 'pane:show-next-item'
', b p': 'pane:show-previous-item'
来源:https://stackoverflow.com/questions/31360365/atom-editor-body-keybind-for-everything-except-vim-mode-insert