johns
johns

Reputation: 31

How to make ~/.vimrc run last

Using :scriptnames I see that my local .vimrc runs in 9Th position out of 24 total scripts. Somewhere in a script(s) in position(s) 10-24 my configuration commands are getting reset to something else. Currently I have set F2 to do :so ~/.vimrc which works but I would like to not have to do that. So is there a way to make my .vimrc run in the 24th position or in last position?

Upvotes: 3

Views: 571

Answers (1)

weibeld
weibeld

Reputation: 15282

Start vim with:

vim -S ~/.vimrc myfile.txt

You can define an alias in ~/.bashrc, so you don't need to type it every time:

alias vim='vim -S ~/.vimrc'

This causes ~/.vimrc to be sourced again after all other scripts have been sourced and the file to edit has been read. It is the same thing as doing :so ~/.vimrc when vim is running.

Upvotes: 2

Related Questions