runtimepath lets system settings override user settings

Bug #522666 reported by Giorgio Sironi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vim (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: vim

In /usr/share/vim/vim72/debian.vim:
set runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim72,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after

This means that when using for example the `filetype plugin on`, which includes automatically filetype-specific scripts in ftplugin/ folders, system plugins (/usr/share/vim/vim72/ftplugin) are executed after user ones and override settings from the user (.vim/ftplugin).
A workaround is rewrite the runtimepath declaration in ~/.vimrc, or use after/ folders; though, many vim filetype plugins do not come with after/ hooks. It may be the case to change the order of folders *if it does not break anything else*.

Observed on Ubuntu 9.10 Server and Desktop editions, Vim 7.2.245.

Revision history for this message
James McCoy (jamessan) wrote :

The order of directories in 'runtimepath' is intentional and follows the way that Vim upstream orders the directories. The only difference is that the /var/lib/vim/addons{,/after} directories are inserted.

Using the after/ directories isn't a workaround. The entire reason they exist is so the system-wide settings can be overridden by users. I'm not sure what you mean by "many vim filetype plugins do not come with after/ hooks". Just create a new file in ~/.vim/after/ftplugin/ that matches the ftplugin's name in the non-after directory and it will get sourced.

Will Gray (graywh)
Changed in vim (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.