How can I use vim plugins with Ideavim?

15,926

Solution 1

The latest version of IdeaVim includes the vim-surround plugin. Enable it by adding

set surround

to your .ideavimrc file

https://github.com/JetBrains/ideavim#emulated-vim-plugins

Solution 2

The ideaVim plugin added "Support for vim-surround commands ys, cs, ds, S, enable it with set surround in your ~/.ideavimrc" since version 0.46.

Solution 3

Most applications only emulate Vim's / vi key bindings (and often only the basic navigation and editing commands). That goes a long way to helping vi users edit comfortably, but it isn't the real thing.

Unfortunately, to be able to use Vim plugins, you'll need the full Vimscript interpreter and infrastructure around 'runtimepath'. I'm not aware of any application that provides this, and because of the complexities and idiosyncrasies of Vim, this would be very hard indeed.

To get more of Vim's special capabilities into your IDE, use both concurrently; it is very easy to set up a external tool in your IDE that launches Vim with the current file (and position). Automatic reloading of changes allows you to edit source code in both concurrently.

If it's any comfort to you, the same applies to Emacs / Elisp as well.

Solution 4

No. Vote for VIM-506 for Vim scripts support (unlikely to be implemented) and for VIM-769 for vim-surround emulation (likely to appear in future versions).

Share:
15,926
Sebastian Wozny
Author by

Sebastian Wozny

Updated on June 02, 2022

Comments

  • Sebastian Wozny
    Sebastian Wozny almost 2 years

    I would like to use Tim Pope's vim surround plugin in my Pycharm IDE. I've been using the IdeaVim plugin for Pycharm to use vim motions and commands.

    I know I can use ~/.ideavimrc like my normal .vimrc but I cannot find information about how to use plugins with ideavim.

    Can I specify the plugins directory inside my ~/.ideavimrc or do I have to go another way? Can I use a plugin manager like pathogen?

  • Muhammad bin Yusrat
    Muhammad bin Yusrat over 3 years
    Looks like all of us came here looking for a way to add Vim Surround only.
  • Boris Verkhovskiy
    Boris Verkhovskiy almost 2 years
    You probably also want set commentary from the same plugin author, which comments out the current line when you hit gcc