Atom编辑器-除Vim模式插入外的所有内容的主体按键绑定

问题描述:

我是Vim的*用户,最近决定尝试Atom.在vim中,我分别将,bn & ,bp映射到下一个缓冲区和上一个缓冲区.我试图模仿Atom中用于切换选项卡的相同行为.在我的keymap.cson文件中,我具有以下内容:

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'

这将起作用,除非在Vim模式下尝试仅键入','字符,除非我按两次',',否则不会显示该字符.

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'

感谢您的帮助!

结果我只是忘记了在.vim-mode:not(.insert-mode)选择器之前添加atom-text-editor选择器.将脚本更改为以下内容,并且可以正常工作:

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'