How can I use vim plugins with Ideavim?
Asked Answered
C

5

44

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?

Cho answered 25/11, 2015 at 2:10 Comment(0)
C
83

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

Cedell answered 17/11, 2016 at 6:47 Comment(2)
Looks like all of us came here looking for a way to add Vim Surround only.Cornetist
You probably also want set commentary from the same plugin author, which comments out the current line when you hit gccDonnenfeld
K
8

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.

Kela answered 25/11, 2015 at 9:29 Comment(0)
R
8

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.

Retrocede answered 20/10, 2016 at 20:34 Comment(0)
D
6

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).

Dictator answered 25/11, 2015 at 22:1 Comment(0)
A
1

This was mentioned in a changelog relatively recently. https://github.com/JetBrains/ideavim/blob/master/CHANGES.md#features-5 I didn't mange this work. Looks like I need vim-plug installed and I use another package manager in my NeoVim and also I don't want to mix up two configs. It should work in general.

Anticlockwise answered 22/6, 2021 at 20:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.