Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Useful customizations in .ideavimrc

I'm interested in hearing how some of you have customized your .ideavimrc file to improve your workflows within your Jetbrains IDE. I'm unsure of its capabilities and would love to know what can be customized. A list of possible customizations would also be helpful.

Thanks!

like image 346
domi91c Avatar asked Jan 21 '15 04:01

domi91c


3 Answers

Basically you can safely source your ~/.vimrc, but be aware that some tricky :map commands may break IntelliJ shortcuts (that was the reason why IdeaVim switched to its own configuration file instead of ~/.vimrc). The only non-Vim command supported by now (v 0.39) is :action. You can define multi-key bindings for IntelliJ actions instead of crazy shortcuts for 3 or more fingers. For example:

nnoremap ,c :action GotoClass<CR>
like image 161
Andrey Vlasovskikh Avatar answered Nov 03 '22 03:11

Andrey Vlasovskikh


You can check out this or this configuration.
Also, bear in mind, that you can record a macro (Edit > Macros > Start Macro Recording), and reference it later in your .ideavimrc file like so:
nmap csw' :action Macro.surround_with_single_quote<CR> To find out action commands, use :actionlist

like image 15
Vladimir Bauer Avatar answered Nov 03 '22 04:11

Vladimir Bauer


Here are some useful materials that helped me write my .ideavimrc:

set commands that work in IdeaVim.

Jetbrains specific actions (You can also see this list with :actionlist)

You map these actions in .ideavimrc like:

nnoremap gd :action GotoDeclaration<CR>

like image 2
Rohmer Avatar answered Nov 03 '22 05:11

Rohmer