Ticket #39182: fix-MacVim-runtimepath.diff

File fix-MacVim-runtimepath.diff, 2.3 KB (added by larryv (Lawrence Velázquez), 11 years ago)

patch to change MacVim's default runtimepath

  • Portfile

     
    77set snapshot        66
    88set gitcommit       snapshot-${snapshot}
    99version             ${vim_version}.snapshot${snapshot}
    10 revision            3
     10revision            4
    1111categories          editors
    1212platforms           darwin
    1313license             Vim GPL-2+
     
    4242}
    4343
    4444patchfiles          patch-src-MacVim-icons-python.diff \
     45                    patch-src-MacVim-vimrc.diff \
    4546                    patch-reverse-7.3.245.diff \
    4647                    patch-MacVim-GCC-VERSION.diff
    4748
     
    6970post-patch {
    7071    reinplace "s|^# VIM_APP_DIR=/Applications$|VIM_APP_DIR=${applications_dir}|" \
    7172         ${worksrcpath}/src/MacVim/mvim
     73
     74    set vimf ${prefix}/share/vim/vimfiles
     75    set macvimf ${applications_dir}/MacVim.app/Contents/Resources/vim/vimfiles
     76    reinplace "s|__VIM_VIMFILES__|$vimf|" ${worksrcpath}/src/MacVim/vimrc
     77    reinplace "s|__MACVIM_VIMFILES__|$macvimf|" ${worksrcpath}/src/MacVim/vimrc
    7278}
    7379
    7480autoconf.dir ${worksrcpath}/src
  • files/patch-src-MacVim-vimrc.diff

     
     1--- src/MacVim/vimrc.orig       2012-12-12 06:26:32.000000000 -0500
     2+++ src/MacVim/vimrc    2013-05-21 20:22:25.000000000 -0400
     3@@ -13,3 +13,22 @@
     4 " the entire MacVim menu is set up in a nib file which currently only is
     5 " translated to English).
     6 set langmenu=none
     7+
     8+" Add the vim port's vimfiles directory to runtimepath so that MacVim
     9+" can pick up vim files installed by other ports. Also remove the
     10+" default vimfiles entries, since those directories don't exist, and
     11+" nothing should be using them.
     12+if 1
     13+    let rtp = split(&runtimepath, ',')
     14+
     15+    " Insert vim's vimfiles around MacVim's $VIMRUNTIME.
     16+    let idx_vimruntime = index(rtp, $VIMRUNTIME)
     17+    call insert(rtp, "__VIM_VIMFILES__/after", idx_vimruntime + 1)
     18+    call insert(rtp, "__VIM_VIMFILES__", idx_vimruntime)
     19+
     20+    " Remove MacVim's nonexistent vimfiles entries.
     21+    call filter(rtp, 'v:val !~ ''__MACVIM_VIMFILES__\%(/after\)\?''')
     22+
     23+    let &runtimepath = join(rtp, ',')
     24+    unlet idx_vimruntime rtp
     25+endif