Atom Editor - Body Keybind for Everything Except Vim Mode Insert

无人久伴 提交于 2019-12-13 04:00:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!