How do I install vim plugins with vscode vim?

9k views Asked by At

I am slightly new to vim, and I installed the vim vscode plugin so I can use vim-like melodies to manipulate code in vscode. However, I used to have janus installed on my terminal (including NERDTree, NERDCommenter, etc) and I want to install NERDCommenter on my vim vscode. How would I go about doing this?

3

There are 3 answers

0
temujim On

This is not possible, you cannot use VIM plugins on the VSCode Vim. I am not familiar with NerdCommenter but you can just remap VSCode keys.

2
s3cret On

Seems like NERD* Plugins is written for vim.

As for VSCode, here is a workaround:

There are so many good extentions.It's very likely to find one replacement for you there.

As for comment code:

  • I perfer use + / to comment my selection area.
  • You can change the Keyboard Shortcuts for Toggle Line Comment.
1
tyirvine On

If the plugin you're after is written in vimscript (typically, it'll have the .vim extension) then you can load its contents into your .vimrc configuration file. As of writing this, the Vim extension for VS Code supports .vimrc configuration files.

This isn't a great solution as you'll have to manually update any plugins you add and it'll add bloat to your .vimrc file. But it does work. I'm using this workaround to load in vim-commentary by tpope and so far it's working well.