I completely rewrote my vimrc by hand because my last one was borrowed and used tons of features that I didn't use. This one is nice and clean and biased towards JavaScript/Meteor development.
- First make sure that you've backed up or removed your own vim files (
.vimrc
,.vim/
). - Clone the repo to your home directory:
git clone https://github.com/cjsauer/vimrc.git ~/.vim
- Prepare Vundle:
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
cd .vim/
./install.sh
. This creates a symbolic link called.vimrc
in your home directory, so you are free to edit the .vimrc in this repo and your changes will be observed. It also installs all the plugins using Vundle (this could take a bit of time).- Follow these instructions to get the fonts installed and working correctly for vim-airline. This is optional. If you don't want to use airline, remove it from the .vimrc file.
- Install some linters
npm install -g eslint
,npm install -g babel-eslint
,npm install -g eslint-plugin-react
- Call
npm install
in thebundle/tern_for_vim
directory to install Tern. - Install YouCompleteMe. Follow these instructions, and be sure to use the
./install.py --tern-completer
flag when you install!
For Meteor developing, Tern is much more useful with Slava's tern-meteor package. Follow these instructions to get it setup in vim and in your Meteor project.
,sv
sources the .vimrc file<F3>
toggles search highlighting<F5>
toggles paste mode:W
save file with sudo,w
quickly save a file<c-[jklh]>
fast window switching,nt
open the NERDTree tabgcc
toggle comment on the current line
- CtrlP.vim
- Remapped to
<c-f>
to not conflict with YankRing. Also note that there are some wildcards in the.vimrc
file that will ignore annoying directories like.meteor
,bundle
(when working on the .vimrc). You can add others to the regex in the.vimrc
.
- Remapped to
- delimitMate
- emmet-vim
- GitGutter
- Multiple Cursors
- Remapped to
<C-m>
to not conflict with YankRing
- Remapped to
- NERDTree
- nerdtree-git-plugin
- Syntastic syntax checkers
- Included linters
- eslint: be sure to run
npm install -g eslint
. - Note you can install more syntax checkers yourself. Check the syntastic wiki for a list.
- eslint: be sure to run
- Included linters
- tern_for_vim
- Tern-based, intelligent editing support for JavaScript.
- Ultisnips
- Supertab is used to help YCM and Ultisnips play nice together. The tab key should act intelligently when scrolling through the completion list, or expanding a snippet.
- vim-airline
- vim-colorschemes
- vim-commentary
- vim-fugitive
,gs
git status,gd
git diff,gb
git blame,gc
git commit,gr
git read (clear changes),gw
git write (save and add)
- vim-javascript
- vim-jsx
- vim-repeat
- vim-sensible
- vim-surround
- vim-unimpaired
- YankRing.vim
<F10>
displays the content of the YankRing (pressp
to paste selection from the list)
- YouCompleteMe