Limit default rtp rearrangement

Rearranging rtp so that **all** default directories appear first has the
undesired side effect of not allowing plugins to override default syntax
files.

This changeset limits the rearrangement of the rtp to simply making sure
the first directory in the default runtimepath appears first in also in
the runtimepath after Vundle has finished manipulating it.

This should keep the original bugs fixed and should eliminate the
aforementioned undesired side effect.

Fixes #430
Fixes #456
This commit is contained in:
Jacobo de Vera 2014-04-25 22:33:13 +02:00
parent 0afe058353
commit a917677879

View File

@ -166,15 +166,12 @@ func! s:rtp_add_defaults()
set rtp&vim set rtp&vim
let default = &rtp let default = &rtp
let &rtp = current let &rtp = current
for item in reverse(split(default, ',')) let default_rtp_items = split(default, ',')
let item = fnameescape(item) if !empty(default_rtp_items)
exec 'set rtp-=' . item let first_item = fnameescape(default_rtp_items[0])
if fnamemodify(item, ":t") == 'after' exec 'set rtp-=' . first_item
exec 'set rtp+=' . item exec 'set rtp^=' . first_item
else endif
exec 'set rtp^=' . item
endif
endfor
endf endf