All configuration options for vim are stored in the user’s home directory in a file named .vimrc
The script code is below but there are somethings you’ll want to do before setting it up.
You’ll need to create directories for the following: backups, colors, swaps and undo.
Execute this command to set up the directories in the terminal ( The ~ character will set the path to your home directory. ex: /Users/username/ ):
$ cd ~/.vim ; mkdir backups ; mkdir colors ; mkdir swaps; mkdir undo;
This will keep all your backups, swaps and undos in your .vim user directory. Also the colors directory is for installing themes.
Visit vimninjas.com if you would like to download a color scheme. Once you find a color scheme you like, just download it and copy and paste the code into the relevant scheme file and place the file in ~/.vim/colors/
For example if you download the Candy theme, you would name the file candy.vim and place it in the relevant directory described above. Then in your .vimrc config file you would set the theme like so:
" Set color scheme colorscheme candy
I've created a github repo with the .vimrc configuration. Please take a look at the repo and download from here.
Checkout or download the git zip and setup the .vimrc file by using the cp command.
$ cd ~/Downloads/MacOSVimConfig-master
$ cp vimrc-example ~/.vimrc
Otherwise you can create your .vimrc file by copying the Raw text from github and pasting the text below. NOTE: While in vim before you paste try doing this command.
This should paste the text with the best result. Once the .vimrc file is configured open a new terminal windows and open a file to test out the setup.
$ vim ~/.vimrc
------------ .vimrc example configuration ------------------
Then paste in these configuration options: