0

I have in .vim/after/plugin/ a file called deoplete.vim Inside is this code

let g:deoplete#enable_at_startup = 1 " Enable autocompletion at startup

" Autocomplete Deoplete + Vimtex
call deoplete#custom#var('omni', 'input_patterns', {
      \ 'tex': g:vimtex#re#deoplete
      \})

The code let g:deoplete#enable_at_startup = 1 is not loaded, although :scriptnames shows that the file is loaded. Also, :verbose set completeopt? shows completeopt=menu,preview.

If I source deoplete.vim in .vimrc the let g:deoplete#enable_at_startup = 1 is working.

If I remove let g:deoplete#enable_at_startup = 1 and put it in .vimrc the rest of the code is working without sourcing the file.

What am I missing? I'm trying to clean my .vimrc file and put all the plugin config in .vim/after/plugin/ and all the filetype config to .vim/after/ftplugin/

1 Answer 1

2

Runtime directories located in ~/.vim/after/* are sourced after all user and plugin scripts in relevant directories (excluding after/*), then scripts in all plugin after directories and then user after directories.

Thus if you put your let g:deoplete#enable_at_startup = 1 into your after, it would only be sourced after your deoplete plugin is loaded and it means plugin didn't use it to actually find out you wanted to enable it at start up.

You can put it into ~/.vim/plugin/deoplete.vim -- everything in ~/.vim/plugin/*.vim would be auto sourced before any script in your installed plugins.

Might be useful:

Your Answer

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

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