What line of code could I add to vimrc so that the <leader> ig command runs when vim starts?

I'm new to Vim, sorry newbies for this question. I am using vim vim-indent-guides plugin

The default display for switching the <leader>ig plugin. What modification needs to be done so that it switches when vim is running.

+6
source share
4 answers

It looks like the plugin can support in its configuration. Vim plugins are usually customizable by putting something like

 let g:global_variable_for_plugin = 1 

in ~/.vimrc .

Here is the vim-indent-guide documentation:

 Use this option to control whether the plugin is enabled on Vim startup. Default: 0. Values: 0 or 1. > let g:indent_guides_enable_on_vim_startup = 0 < 
+7
source

You need to run the following command when starting vim

 :IndentGuidesEnable 

One way is to add an auto command to your .vimrc, for example

 au VimEnter * IndentGuidesEnable 

There are probably other ways, but for me it looks pretty simple.

+4
source

I don’t know why this plugin is not enabled by default, but

 IndentGuidesEnable 
Command

seems to be doing just that. Add it somewhere in ~/.vimrc .

In the general case, mappings are simply convenient combinations of commands or sequences of commands. You want to execute a command, not a display.

+1
source

I know this has been a question for a long time, but just an update. The selected answer does not work on Neovim. To fix this, add this to .vimrc:

autocmd VimEnter * :IndentGuidesEnable

0
source

All Articles