I'm using https://github.com/vim-scripts/Smart-Tabs/blob/master/plugin/ctab.vim through Vundle. How can I temporarily disable it (preferably more readily than by commenting out the bundle and restarting the editor)?
This plugin does not offer a method of temporarily disabling it. Therefore you have four options I can think of:
The main functionality of the plugin is provided by insert mode mappings for the Tab and Backspace keys. You can remove these mappings with
:iunmap <tab> | iunmap <bs>and renable by reloading the plugin entirely with
:source [...]/ctab.vim. (You'll need to fill in the ellipsis with the correct path, I don't know offhand to what location Vundle downloads files.)
This should work because this particular plugin doesn't seem to follow the standard practice of checking a guard variable to prevent itself from being loaded multiple times. If it did, you'd first need to reset the guard variable before reloading.
Fork the plugin and edit it to add this feature. The two most obvious ways of doing this are to:
DoSmartDelete()functions to immediately
returnif a new global variable
SmartTabDisable()function to call
iunmap, and wrap the lines that create the mappings in a function (so it can be invoked from outside the plugin) to re-enable.
As suggested by Christian Brabandt in a comment, you can disable all insert maps with
:set pasteand then re-enable with
This has a number of other effects, so it's more of a workaround than a solution, but if it meets your requirements it's the simplest option.
(You've already stated you don't want to do this) Comment out the Vundle line and run
:PluginClean, (or otherwise disable the plugin,) and restart the editor.