IdeaVim,多光标用法

Nik*_*vic 6 jetbrains-ide rubymine webstorm ideavim multiple-cursor

我正在尝试触发(使用)IdeaVim多光标插件:https : //github.com/JetBrains/ideavim#emulated-vim-plugins- >多光标

在GitHub的文档,我们的命令:<A-n><A-x><A-p>g<A-n>以触发/使用这个插件,但我不能让这个插件工作在所有...

我已经在.id​​eavimrc中添加了set multiple-cursors

我想念什么吗?

我正在使用OSX(如果很重要)。

cit*_*att 10

正如其他答案中提到的,macOS 将<A-n>输入重音字符(例如ñ( <A-n>n))视为“死键” 。似乎不可能以编程方式禁用此功能,您必须使用替代键盘输入源来解决此问题。

但是,这些<A-n>键不是 IdeaVimmultiple-cursors所基于的扩展所使用的键(terryma/vim-multiple-cursors)。我不知道它们来自哪里,但VIM-多游标的使用<C-n><C-p>并且<C-x>和仅使用<A-n>选择的所有事件,这对IdeaVim行为不同。跟踪错误的键映射存在问题 - VIM-2178

同时,您可以通过将以下内容添加到您的 中来重新映射键以匹配 Vim 插件~/.ideavimrc

" Remap multiple-cursors shortcuts to match terryma/vim-multiple-cursors
nmap <C-n> <Plug>NextWholeOccurrence
xmap <C-n> <Plug>NextWholeOccurrence
nmap g<C-n> <Plug>NextOccurrence
xmap g<C-n> <Plug>NextOccurrence
nmap <C-x> <Plug>SkipOccurrence
xmap <C-x> <Plug>SkipOccurrence
nmap <C-p> <Plug>RemoveOccurrence
xmap <C-p> <Plug>RemoveOccurrence
Run Code Online (Sandbox Code Playgroud)

而且你可以解决<A-n>的“选择所有的”问题通过映射到别的东西,比如Shift+ Ctrl+ n

" Note that the default <A-n> and g<A-n> shortcuts don't work on Mac due to dead keys.
" <A-n> is used to enter accented text e.g. ñ
nmap <S-C-n> <Plug>AllWholeOccurrences
xmap <S-C-n> <Plug>AllWholeOccurrences
nmap g<S-C-n> <Plug>AllOccurrences
xmap g<S-C-n> <Plug>AllOccurrences
Run Code Online (Sandbox Code Playgroud)


Nik*_*vic 6

是的,tnx提醒了我这一点!

实际上,现在在OSX Mojave中,我们可以Unicode Hex Input在键盘输入源中进行选择在此处输入图片说明

就是这样...现在一切正常,并且在(alt / option +)输入上禁用了特殊字符,并且我可以使用所有快捷方式而没有任何问题:)

  • 感谢您的回答!我更喜欢它,因为它需要较少的步骤,并且可以轻松地让我根据需要“还原”默认状态。 (2认同)
  • 提醒:~/.ideavimrc 应该有 `set multiple-cursors` 。 (2认同)