Atom编辑器-除Vim模式插入外的所有内容的主体按键绑定 [英] Atom Editor - Body Keybind for Everything Except Vim Mode Insert

查看:111
本文介绍了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'

这篇关于Atom编辑器-除Vim模式插入外的所有内容的主体按键绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆