To overwrite some formatoptions provided by my plugins I made ~/.vim/after/final.vim file and add this location to my $RUNTIMEPATH by putting these lines just after (vundle) plugins in my .vimrc.

set rtp-=~/.vim/after 
set rtp+=~/.vim/after

I check if it's OK by:

:set rtp?

It is OK. ~/.vim/after is at the the end of the list.

According to the :h after-directory all *.vim files under ~/.vim/after should be loaded as a plugins.

It doesn't work. When I type


there is nothing from my ~/.vim/after folder. What is going on?

1 Answer 1


First, you don't need to add ~/.vim/after/ to runtimepath as it's already part of the default value.

Second, the content of ~/.vim/after/ is supposed to match the structure found in /usr/share/vim/vim7x/ and ~/.vim/ so, for your final.vim to be sourced like a plugin, you only need to put it where it belongs:


See :help 'runtimepath'.

  • … but I'm not sure why you would need to do this.
    – romainl
    Aug 4, 2016 at 18:32
  • :h 'runtimepath' shows default situation. In my case somehow ~/.vim/after was not present in runtimepath. When I added one line: set rtp+=~/.vim/after , it was not at the end of list.
    – Mesco
    Aug 5, 2016 at 11:07
  • Thanks! I need it because my formatoption=... , hlsearch, scrool=... and others are overwriten by Plugins. After your solution I got an "Error detected after processing /home/me/.vim/after/plugin/final.vim". Inside final.vim there are simple vimrc commands. Shouldn't it be in another folder? Where?
    – Mesco
    Aug 5, 2016 at 11:19
  • 1
    Show us the errors and the content of final.vim and vimrc. And investigate why after/ is not in &rtp.
    – romainl
    Aug 5, 2016 at 11:35
  • [github.com/UncleGoogle/vim]. final.vim is in .vim/after. EDIT: I've just realize that sth was automatically generated in final.vim I don't understand why, but I deleted this and now its ok. I'm adding also :scriptnames output -> interesting thing is despite all of my effords airline-plugin is loaded even after final.vim. Sneaky guy.
    – Mesco
    Aug 5, 2016 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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