48

I am using the vim plugin for IntelliJ Idea.
Where should I place the .vimrc for that plugin.
Using Windows XP

2
  • 4
    Sorry friend - the IntelliJ vim plugin is just an emulator - it doesn't use your vimrc Commented Oct 9, 2011 at 3:34
  • I was able to get RubyMine to pick up my ~/.ideavimrc. Commented Feb 2, 2017 at 11:45

5 Answers 5

59

The latest version of the plugin will read settings from a file named .ideavimrc in the home directory.

On *nix, the home directory can be accessed at ~.

On Windows, you can use the %HOMEPATH% environment variable. (Normally, "C:\Users\<User Name>" or "C:\Documents and Settings\<User Name>", depending on your Windows version.)

1
  • 2
    or _ideavimrc on windows, in keeping with vim's conventions.
    – xdhmoore
    Commented Aug 22, 2017 at 18:24
11

If you rename your .vimrc to _ideavimrc in your ~ directory (/Users/ in windows)

Underscore is used instead of the . in windows for vim apparently

IntelliJ will honour it

Was tearing my hair out for a while getting this to work.

7

On my mac i simply ran ln -s "$HOME/.vimrc" "$HOME/.ideavimrc" to create a symlink so IntelliJ would use the same .vimrc as my standard vim.

My .vimrc is very simple. However, if there is config that is incompatible between IntelliJ and vim then you might have issues with this approach.

0
echo %homepath%  

gives me my "home directory" on Windows XP,
where I need to put my .vimrc.

3
  • 4
    Does this really work? I don't think my intellij vim plugin doesn't use a .vimrc.
    – easel
    Commented Jul 14, 2011 at 19:15
  • 1
    This doesn't work. IntelliJ Idea Vim does not support .vimrc file. stackoverflow.com/questions/5585687/…. Who voted this up? Commented Feb 11, 2014 at 7:04
  • This answer is not helpful, since as I (and others have noted), you shouldn't be using .vimrc with the vim plugin. See my answer for more detail.
    – Subfuzion
    Commented Sep 6, 2022 at 21:39
0

Unfortunately, the vim plugin for JetBrains doesn't effectively support the full functionality of a .vimrc. The file that the plugin uses is called .ideavimrc. This is what you should use and it should be placed in your home directory (see this other answer for details, particularly for Windows).

I have a very comprehensive .vimrc that I use. Unfortunately, I had to pare that down quite a bit to work as .ideavimrc. You can look at the gists to see the differences. For what it's worth, it's still provides nice functionality, including buffer switching across tabs and splits.

So why not just use the same file (i.e., .vimrc) for both? Well, for one thing, you need some settings in .ideavimrc that give precedence to the vim plugin for certain keyboard shortcuts that conflict with the IDE. See the top of my .ideavimrc for my settings (for example, sethandler <C-B> a:vim). The other thing is that it seemed that when my more complicated .vimrc couldn't be processed, other settings (such as just set noerrorbells) also wouldn't take effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.