I'm new to Vim, sorry for this newbie question. I'm using a vim plugin vim-indent-guides
The default mapping to toggle the plugin is <leader>ig
. What modification should be made to make it toggled on when vim-started
Sounds like something the plugin might support in its configuration. Vim plugins are generally configured by putting something like
let g:global_variable_for_plugin = 1
in your ~/.vimrc
.
Lo and behold, from the vim-indent-guides 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
<
What you need is to run the following command at vim startup
:IndentGuidesEnable
One of the ways is to add an autocommand to your .vimrc like
au VimEnter * IndentGuidesEnable
There are probably other ways but this looks pretty simple for me.
I have no idea why that plugin is not enabled by default but the
IndentGuidesEnable
command seems to do just that. Add it somewhere in your ~/.vimrc
.
More generally, mappings are just convenient shortcuts for commands or sequences of commands. You want to execute the command, not the mapping.
I know this is question is long ago but just an update. The selected answer doesn't work on Neovim. To fix that, add this in .vimrc:
autocmd VimEnter * :IndentGuidesEnable
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.