Is it possible to "extend" IntelliJ such that I can open the current file in VIM

Viewed 5142

I use IntelliJ for most of my Java programming, but every once in a while I need to make certain changes which are much easier done in VIM.

Thus, the question:

While I'm editing a file in IntelliJ, it is somehow possible to tell IntelliJ to start VIM with the same file that is currently under cursor.

Thanks !!

8 Answers
  1. Go to Settings -> Tools -> External Tools
  2. Click the + to add a tool.
  3. Here are the settings I use:
    • Name: Vim
    • Program: /usr/bin/gvim
    • Arguments: --servername $ProjectFileDir$ --remote "+call cursor($LineNumber$,$ColumnNumber$)" $FileDir$/$FileName$
    • Working directory: $ProjectFileDir$

I turn off "Open console for tool output".

The arguments will use Vim in client-server mode, so if you jump to Vim from IntelliJ in the same project dir multiple times, the existing Vim instance will be reused, and they will also place the cursor in Vim exactly where it is in IntelliJ.

Related