21

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!

Dylan Corriveau
  • 2,561
  • 4
  • 29
  • 36
domi91c
  • 1,962
  • 4
  • 23
  • 38
  • 1
    I have only one line in .ideavim file: `source ~/.vimrc`, but many features won't work in Intellij :( ideavim is good, but compare to vim, it is afterall a compromise, we cannot expect that it arms Jetbrains IDE with full vim power. – Kent Jan 21 '15 at 11:07

4 Answers4

17

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>
Andrey Vlasovskikh
  • 16,489
  • 7
  • 44
  • 62
15

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

Vladimir Bauer
  • 685
  • 7
  • 10
2

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>

tim-phillips
  • 997
  • 1
  • 11
  • 22
1

Running :actionlist gives the list of possible actions

$Copy                                              <M-C>
$Cut                                               <M-X> <S-Del>
$Delete                                            <Del> <BS> <M-BS>
Actions.ActionsPlugin.GenerateToString
ActivateAntToolWindow
ActivateCommitToolWindow                           <M-0>
ActivateDatabaseChangesToolWindow
ActivateDatabaseToolWindow
...
...
Mz A
  • 889
  • 11
  • 10