Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This may not be the best place to ask this question but I'm having trouble getting vim to read my vimrc file. If I have it in the home directory as ~/.vimrc then it ready just fine but if I move it ~/.vim/vimrc so that I can take advantage of plugins and a few other things, it no longer reads the vimrc. I can't remember what I was supposed to do to make it read the correct vimrc.

share|improve this question
You should explain more about 'take advantage of plugins', because nothing I know of would prefer you from using ~/.vimrc for everything. – Jason Salaz Dec 29 '11 at 22:36
When I was in Ubuntu and I started using vim plugins it had me make a .vim directory and inside that a plugins directory and move my .vimrc to the .vim directory – CaldwellYSR Dec 29 '11 at 22:38
I used to use vimbuddy (before I had plugins that actually did something functional), installed in ~/.vim/plugins, and I just used source ~/.vim/plugins/vimbuddy.vim from within my ~/.vimrc file. – Jason Salaz Dec 29 '11 at 22:41
Ah that makes a lot of sense... make that an answer and I'll accept it. – CaldwellYSR Dec 29 '11 at 22:47
up vote 2 down vote accepted

A method of blindly loading all your plugins, assuming they are all in ~/.vim/plugins, would be putting the following in your ~/.vimrc:

source glob(~/.vim/plugins/*.vim)
share|improve this answer

I created a symlink.

ln -s ~/.vim/vimrc ~/.vimrc

Works like a charm.

share|improve this answer
Perfect! Thanks :D – Max Mar 17 '15 at 20:04

The easiest way would be to remain using a ~/.vimrc file, if for no other reason than using it to read in your sub-folder based .vimrc

Putting something like the below in your ~/.vimrc should work:

if filereadable("~/.vim/vimrc")
        source ~/.vim/vimrc

I don't recall if vim expands home directories or not. I imagine it does, but if it does not, just use:

if filereadable("/Users/yourusername/.vim/vimrc")
        source /Users/yourusername/.vim/vimrc
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.