Here is my .profile (macs don't usually bother with .bashrc)

export VIMINIT="let $MYVIMRC='/Users/user/userbits/future.vimrc' | source $MYVIMRC"
source /Users/user/userbits/future.source`

Explanation: /Users is where users go on macs. It's like /home in Linux. I've unimaginatively called my user user. The folder where I want all his things is called /Users/user/userbits. And I want his .vimrcin there too, renamed as future.vimrc.

The second line of the code sources a file called /Users/user/userbits/future.source which is kind of like my .bashrc - it sets up lots of functions and netrw things. With a .vimrc in a normal place (eg. `/Users/user/.vimrc') everything works fine.

But whats going wrong when I rename my.vimrc to future.vimrc and put it in /Users/user/userbits?

The last poster seemed to have it so right, and I've been going through his/her suggested reading for hours. Why can't I do it?

  • 2
    backslashes are important – Mass Nov 19 '17 at 23:42

Yesss! It works. I thought the backslashes were to make the code more readable, but then you inspired me to turn my phone on its side. Here is my finished . profile for anyone interested in this:

export VIMINIT="let \$MYVIMRC='/Users/user/user bits/future.vimrc' | source \$MYVIMRC"
source /Users/user/userbits/future.source

(So happy. Thank you Mass)

| improve this answer | |

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