Skip to content

Instantly share code, notes, and snippets.

@chartjes
Created September 23, 2013 02:51
Show Gist options
  • Save chartjes/6666003 to your computer and use it in GitHub Desktop.
Save chartjes/6666003 to your computer and use it in GitHub Desktop.
Vim setup
I use Pathogen and have the following bundles installed:
~/.vim/bundle ᐅ ls -l
total 0
drwxr-xr-x 5 chartjes staff 170 1 May 22:53 closetag.vim
drwxr-xr-x 8 chartjes staff 272 1 May 22:54 ctrlp.vim
drwxr-xr-x 8 chartjes staff 272 1 May 22:54 nerdcommenter
drwxr-xr-x 6 chartjes staff 204 1 May 22:51 pb.vim
drwxr-xr-x 18 chartjes staff 612 1 May 22:54 powerline
drwxr-xr-x 8 chartjes staff 272 1 May 22:54 supertab
drwxr-xr-x 11 chartjes staff 374 1 May 22:54 syntastic
drwxr-xr-x 18 chartjes staff 612 1 May 22:54 vim-coffee-script
drwxr-xr-x 8 chartjes staff 272 1 May 22:55 vim-gitgutter
drwxr-xr-x 10 chartjes staff 340 30 May 22:08 vim-golang
drwxr-xr-x 10 chartjes staff 340 1 May 22:54 vim-javascript
drwxr-xr-x 5 chartjes staff 170 1 May 22:53 vim-repeat
drwxr-xr-x 7 chartjes staff 238 1 May 22:54 vim-surround
drwxr-xr-x 9 chartjes staff 306 3 May 17:49 vim-twig
And here's my .vimrc
"
" MAIN CUSTOMIZATION FILE
"
set nocompatible
filetype off
call pathogen#infect()
syntax on
filetype plugin indent on
" Enable loading filetype and indentation plugins
set modelines=0
" by default we go with 4 space indent and spaces
set expandtab
set softtabstop=4
set shiftwidth=4
set tabstop=4
set encoding=utf-8
set fileencodings=utf-8
set cursorline
set ruler
set background=dark
let g:solarized_termcolors=256
let g:solarized_contrast="low"
let g:solaritez_visibility="high"
colorscheme solarized
" tab navigation
nmap Z :tabprev<CR>
nmap X :tabnext<CR>
" Send those damn swap files somewhere else!
set directory=/tmp
" clear out search buffer easier
nmap <silent> ,/ :let @/=""<CR>
" easily switch between vsplit windows
map <c-j> <C-w>j
map <c-k> <C-w>k
map <c-h> <c-w>h
map <c-l> <c-w>l
" save yourself if you forgot to use sudo to save something
cmap w!! w !sudo tee % >/dev/null
" Status line stuff stolen from Joel Perras
set laststatus=2
" Show me when I'm getting too close to 80 characters
if version > 702
set colorcolumn=80
endif
" If we are using Javascript, we need 2 spaces indents and not tabs
autocmd FileType javascript set sw=2
autocmd FileType javascript set ts=2
autocmd FileType javascript set sts=2
" Same thing with CoffeeScript
au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab
" Nerdtree support
map <C-n> :NERDTreeToggle<CR>
" Tweak some things for CtrlP
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'Ctrlp'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_user_command = 'find %s -type f'
" support for supertab
let g:SuperTabDefaultCompletionType = "context"
" Turn on POWERLINE
set rtp+=/Users/chartjes/.vim/bundle/powerline/powerline/bindings/vim
" Let's make vim-powerline pretty
let g:Powerline_symbols = 'compatible'
set guifont=Inconsolata\ for\ Powerline
" Git commit messages need love too
autocmd Filetype gitcommit setlocal spell textwidth=72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment