Skip to content

Instantly share code, notes, and snippets.

@elliotchance
Last active August 7, 2017 01:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elliotchance/5801752 to your computer and use it in GitHub Desktop.
Save elliotchance/5801752 to your computer and use it in GitHub Desktop.
My vimrc
" INSTALL (run this):
" cd ~ && curl -s https://gist.github.com/elliotchance/5801752/download | tar -x --strip-components=1 && cat .vimrc | grep '^\"% ' .vimrc | cut -c 3- | bash
" Lines started with % will be executed on install:
"
"% # install ctags-exuberant
"% if [ ! -f /usr/local/bin/ctags ]; then
"% wget http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz
"% tar -zxf ctags-5.8.tar.gz
"% cd ctags-5.8 && ./configure && make && sudo make install && sudo rm -f /usr/bin/ctags && sudo ln -s /usr/local/bin/ctags /usr/bin/ctags && cd ..
"% rm -rf ctags-5.8 ctags-5.8.tar.gz
"% fi
"
"% # install YouCompleteMe
"% if [ ! -d ~/.vim/bundle/YouCompleteMe ]; then
"% git clone git://github.com/Valloric/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe
"% cd ~/.vim/bundle/YouCompleteMe
"% ./install.sh --clang-completer
"% fi
"
"% if [ ! -d ~/.vim/bundle/vundle ]; then
"% git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
"% fi
"% vim +BundleInstall +qall
" basic options
syntax enable
set number
" editor options
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
inoremap { {<CR>}<Esc>ko
" mappings
":imap <tab> <c-x><c-o>
" this is because I type these by mistake often
:command Wq wq
:command WQ wq
:command Q q
" --- automated stuff from here
" git & fugitive
:command Gw w \| Gwrite
" for Vundle
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-fugitive'
Bundle 'altercation/vim-colors-solarized'
Bundle 'xolox/vim-misc'
Bundle 'xolox/vim-easytags'
Bundle 'Valloric/YouCompleteMe'
Bundle 'shawncplus/phpcomplete.vim'
Bundle 'scrooloose/nerdtree'
filetype plugin indent on " required!
" autocomplete
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
" colour scheme
set background=light
colorscheme solarized
# vim-gitgutter
cd /tmp && git clone git://github.com/airblade/vim-gitgutter.git
cp -r vim-gitgutter/* ~/.vim/
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment