IdeaVim 和 Neovim 共享的键盘快捷键映射

huangapple go评论88阅读模式
英文:

IdeaVim and Neovim shared keyboard shortcuts map

问题

我同时使用:

  • 带有LSP的Neovim,等等(使用LazyVim配置,但愿意改用另一种现代配置)
  • 带有IdeaVim的IntelliJ,主要用于Java/Kotlin与Spring等

是否有人提出了一组可以在两者之间共享的键映射,可以在两个编辑器/IDE中都能工作?我不是指使用单一配置文件,分别配置两者是可以的。但我不想在同时使用这两个编辑器/IDE时需要学习两套完全不同的映射。

英文:

I'm using both:

  • Neovim with LSP, etc (using LazyVim config but open to change to another modern one)
  • IntelliJ with IdeaVim, mainly for Java/Kotlin with Spring, etc

Has anyone come up with a shared set of key mappings that would work across both? I don't mean using single configuration file, configuring both separately is fine. But I'd like not to have to learn two completely separate set of mappings when using both editors/IDEs.

答案1

得分: 1

Regular VIM bindings will work in Ideavim as well, you can even source your VIM mappings file in your .ideavimrc to only write them once.

LSP features like diagnostics, code actions, goto definition, etc... do not exist in Ideavim because you are supposed to use the equivalent features from your Jetbrains IDE instead.

The trick is that you can setup an Ideavim mapping for almost any IDE action. For example, in my config, I have nmap gl <Action>(ShowErrorDescription) to map the key sequence g + l to the IDE equivalent of Neovim LSP diagnostics.

You can get a list of all the IDE action codes by using the :actionlist command for the whole list or :actionlist keyword to search for something specific.

You may also take a look at this Github discussion where people share their Ideavim config. That should give you a good idea of all the cool things you can do with it.

英文:

Regular VIM bindings will work in Ideavim as well, you can even source your VIM mappings file in your .ideavimrc to only write them once.

LSP features like diagnostics, code actions, goto definition, etc... do not exist in Ideavim because you are supposed to use the equivalent features from your Jetbrains IDE instead.

The trick is that you can setup an Ideavim mapping for almost any IDE action. For example, in my config, I have nmap gl <Action>(ShowErrorDescription) to map the key sequence g + l to the IDE equivalent of Neovim LSP diagnostics.

You can get a list of all the IDE action codes by using the :actionlist command for the whole list or :actionlist keyword to search for something specific.

You may also take a look at this Github discussion where people share their Ideavim config. That should give you a good idea of all the cool things you can do with it.

huangapple
  • 本文由 发表于 2023年7月10日 21:38:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76654317.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定