From 879b0473c4360843a2744461b84402ec96be174b Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Fri, 25 Apr 2014 22:33:13 +0200 Subject: [PATCH] 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. --- autoload/vundle/config.vim | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 561f468f..4e889cbd 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -166,14 +166,12 @@ func! s:rtp_add_defaults() set rtp&vim let default = &rtp let &rtp = current - for item in reverse(split(default, ',')) - exec 'set rtp-=' . item - if fnamemodify(item, ":t") == 'after' - exec 'set rtp+=' . item - else - exec 'set rtp^=' . item - endif - endfor + let default_rtp_items = split(default, ',') + if !empty(default_rtp_items) + let first_item = default_rtp_items[0] + exec 'set rtp-=' . fnameescape(first_item) + exec 'set rtp^=' . fnameescape(first_item) + endif endf