Ad blocker interference detected!
Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers
Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.
created September 30, 2002 · complexity basic · author piaip · version 6.0
If you copy your vimrc to many places, you might get a problem. Writing a portable vimrc is sometimes painful. Maybe in some places you have latest Vim 6.1, and in some places you have Vim 5.x. And maybe you have some favorite scripts in your own computer while other places does not.
Here're some tips and examples on writing portable vimrc that will not make error messages when environment changes:
(1) Check version:
if version >= 600 set foldcolumn=2 endif
Note: version 6.1 would be 601
(2) Use environment variables:
(3) Loading scripts(especially useful for scripts just merged into standard macros):
if filereadable($VIMRUNTIME . "/macros/matchit.vim") source $VIMRUNTIME/macros/matchit.vim endif
Regarding sourcing stuff inside the runtime directory such as the macros stuff, look at the :runtime command -- it doesn't require error checking (though it might be only for 6.x or above so pop it inside the version check).