Hello-World
Hello-World

Reputation: 9555

custom .vimrc settings in another file

I want to keep my custom vimrc settings in a file in my Dropbox called vimcustomvimrc.vim

I did some searching and found this http://blog.mojotech.com/a-veterans-vimrc/ line below to put in my .vimrc file so that it will load my custom settings but its not working. can you please help?

file .vimrc contens below


set runtimepath+=~/Dropbox/vim
source ~/Dropbox/vim/vimcustomvimrc.vim

Upvotes: 1

Views: 252

Answers (2)

SergioAraujo
SergioAraujo

Reputation: 11810

You can maintain your ~/.vimrc under version control using git version control system, for example: I have a .dotfiles repo. In it I have zshrc bashrc and a subfolder called vim. So I made somthing like this...

ln -s ~/.dotfiles/vim ~/.vim
ln -s ~/.dotfiles/vim/vimrc ~/.vimrc
ln -sfvn ~/.dotfiles/zshrc ~/.zshrc
ln -sfvn ~/.dotfiles/bashrc ~/.bashrc

I think is a better solution because you can undo/redo some changes and can also add other good solutions shared on the internet easyly, things like this solution made by Steve Losh, or more specificlly Synchronizing plugins with git submodules and pathogen a great video made by Drew Neil on this matter.

Upvotes: 2

romainl
romainl

Reputation: 196566

The first line is not needed if you only want to source that specific file; the source line is enough.

The runtimepath option allows you to add or remove directories to the default list of directories where Vim expects to find other default directories and *.vim scripts. If you don't keep any plugin or whatnot in ~/Dropbox/vim/ there's no need to change runtimepath.

Also, there's a lot of bullshit in that article: if I were you I would take it with a grain of salt.

Upvotes: 1

Related Questions