Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

consolidating vim files in ~/.vim folder

Tags:

vim

I'm trying to consolidate all my vim related files/plugins into ~/.vim folder so that I can dump it on github and get started with pathogen. However, right now all my vim plugins are scattered all over the place.

As an example, the syntax plugin is in /usr/share/vim/vim73/syntax/syntax.vim and when I run :scriptnames this shows up as well since I have syntax on in my .vimrc.

So for trial, I moved /usr/share/vim/vim73/syntax to /usr/share/vim/vim73/syntax1 and copied /usr/share/vim/vim73/syntax to ~/.vim.

however, now when I start vim it complains that it can't open file /usr/share/vim/vim73/syntax/syntax.vim (because I renamed that folder). I expected vim to automatically now pickup the syntax folder residing in my ~/.vim.

My runtime path is:

~/.vim, /usr/share/vim/vimfiles, /usr/share/vim/vim73, /usr/share/vim/vimfiles/after, ~/.vim/after, /usr/share/vim/vim73

How would I do this?

like image 453
Omnipresent Avatar asked Aug 22 '11 23:08

Omnipresent


2 Answers

Give this a look:

http://vimcasts.org/episodes/synchronizing-plugins-with-git-submodules-and-pathogen/

This is what I use and I've not had trouble with any plugins.

like image 168
Landon Avatar answered Nov 15 '22 18:11

Landon


Some special vim scripts (I know only one: syntax/syntax.vim) are looked up only in $VIMRUNTIME directory (that is by default /usr/share/vim/vim{major_ver_num}{minor_ver_num}), not in the whole &runtimepath. So you can't do this without setting VIMRUNTIME before running syntax on. It does not matter though whether you will set it in something like ~/.zprofile, use an alias vim='VIMRUNTIME=~/.vim vim' or just do let $VIMRUNTIME=$HOME.'/.vim'.

like image 26
ZyX Avatar answered Nov 15 '22 19:11

ZyX