Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn-off a plugin in Vim temporarily?

Tags:

vim

plugins

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?

like image 554
Amjith Avatar asked Mar 02 '09 06:03

Amjith


People also ask

How does Vim-plug work?

vim-plug works by cloning each Git repository into the location specified by begin . After installing, you can find the example plugin in ~/. vim/plugged/vim-unimpaired . Installing plugins is done inside of Vim.

What are plugins in Vim?

vim is a plugin that wraps the command-line fuzzy finder program fzf, allowing you to use it directly within Vim. Fzf is a fast and portable fuzzy finder application written in Go. It is a requirement for the Vim plugin, so make sure you install it first.


2 Answers

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

like image 115
Mohammed Avatar answered Sep 21 '22 17:09

Mohammed


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

like image 34
Mykola Golubyev Avatar answered Sep 22 '22 17:09

Mykola Golubyev