Amjith
Amjith

Reputation: 23874

How to turn-off a plugin in Vim temporarily?

I have multiple plugins in Vim and some of them modify the default behavior of Vim. For example I use Vimacs plugin, which makes Vim behave like emacs in the insert mode alone. Sometime I want to turn off the Vimacs plugin without moving the vimacs.vim out of the plugins directory. Is there a way to do it?

Upvotes: 41

Views: 30330

Answers (3)

John Flood
John Flood

Reputation: 11

In case you are using pathogen, this post gives a better answer, in my opinion. Since I have frequent need to disable snippets when using latex, also added this in my ~/.config/ranger/rc.conf:

map bs shell vim --cmd "let g:pathogen_blacklist = [ 'ultisnips', 'vim-snipmate' ]" %f

This way, whenever I want to open a file with snippets disabled, it is easy.

Upvotes: 1

Mykola Golubyev
Mykola Golubyev

Reputation: 59902

See which variable vimacs check on start. On the begin of the script file find something Like if exists('g:vimacs_is_loaded").... Then set this variable in your .vimrc or while start vim with vim --cmd "let g:vimacs_is_loaded = 1".

Upvotes: 20

Mohammed
Mohammed

Reputation: 1052

You can do this if you use a plugin manager like Vundle or Pathogen, which will keep the plugin in its own directory underneath the ~/.vim/bundle/ directory.

In that case, just find out the runtimepath of the vimacs plugin with the following command:

set runtimepath?

Let's say it's ~/.vim/bundle/vimacs.

Then, put this command in your .vimrc:

set runtimepath-=~/.vim/bundle/vimacs

To load vimacs, just comment that line out and relaunch Vim (or source your .vimrc).

Upvotes: 41

Related Questions