i use neovim and pathogen for managing plugins

When i just put these settings in my init.vim, the plugin won't load.

let g:indentLine_loaded = 1
let g:indentLine_fileType = ['vim','c', 'cpp']
let g:indentLine_fileTypeExclude = ['help']
let g:indentLine_bufNameExclude = ['NERDTree*']
let g:indentLine_leadingSpaceChar='.'
let g:indentLine_char = '.'
let g:indentLine_color_term = 239
let g:indentLine_showFirstIndentLevel=1
let g:indentLine_color_tty_dark=1
let g:indentLine_color_dark = 1
let g:indentLine_faster = 1
let g:indentLine_concealcursor=''

However, when i put those settings with an autocmd in my init.vim, the plugin works, but only the default settings are loaded. However, when i type after the startup e.g. :h help the appearance of the indentations do change to the desired result.

autocmd VimEnter * let g:indentLine_loaded = 1
autocmd VimEnter * let g:indentLine_fileType = ['vim','c', 'cpp']
autocmd VimEnter * let g:indentLine_fileTypeExclude = ['help']
autocmd VimEnter * let g:indentLine_bufNameExclude = ['NERDTree*']
autocmd VimEnter * let g:indentLine_leadingSpaceChar='.'
autocmd VimEnter * let g:indentLine_char = '.'
autocmd VimEnter * let g:indentLine_color_term = 239
autocmd VimEnter * let g:indentLine_showFirstIndentLevel=1
autocmd VimEnter * let g:indentLine_color_tty_dark=1
autocmd VimEnter * let g:indentLine_color_dark = 1
autocmd VimEnter * let g:indentLine_faster = 1
autocmd VimEnter * let g:indentLine_concealcursor=''

How can i make neovim load the indentationLine settings immediately?

1 Answer 1


The problem lies in let g:indentLine_loaded = 1, which is a pattern used for preventing loading a given plugin (see :help write-plugin).

When you include it with on your init file it prevents the plugin from loading. On the autocmd it is completely ignored (along your settings), because when the VimEnter event fires after the plugin is already loaded:

VimEnter        After doing all the startup stuff, including
                loading .vimrc files, executing the "-c cmd"
                arguments, creating all windows and loading
                the buffers in them.
  • Ah, thanks. I have to admit i haven't read the help page carefully enough.. However, that doesn't touches the problem that my settings are (at least just half of it) recognized. Should i ask that one spererately?
    – uuu
    Dec 4, 2015 at 21:25
  • @toogley all of your settings should be loaded if they are placed on your init file without the g:indentLine_loaded (similar to your first example, with no autocmds). You can check that by echoing the variables (e.g.: :echo g:indentLine_fileType). If the variables are set indeed, but the plugin still doesn't work as you expected then you should read its documentation more carefully, and maybe ask on the issue tracker.
    – mMontu
    Dec 7, 2015 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.