How to turn-off a plugin in Vim temporarily?

24,694

Solution 1

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

Solution 2

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

Solution 3

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.

Share:
24,694
Amjith
Author by

Amjith

Opensource enthusiast. Python, C/C++ Vim

Updated on July 09, 2020

Comments

  • Amjith
    Amjith almost 4 years

    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?

  • Amjith
    Amjith almost 13 years
    Thank you! This will go well with my recent switch to Pathogen. :)
  • orluke
    orluke about 11 years
    Also, you can just delete the plugin's directory, e.g. rm -rf ~/.vim/bundle/vimacs. If you're using Vundle or Pathogen, reinstalling the plugin is just a :BundleInstall or git submodule update away, respectively.
  • Cubic
    Cubic almost 11 years
    Except if you have a more involved build process, like with YCM. It's not that hard, but it does take a while.