Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
115 lines (92 sloc) 3.15 KB
set nocompatible
syntax on
filetype plugin indent on
execute pathogen#infect()
" Allow backgrounding buffers without writing them, and remember marks/undo
" for backgrounded buffers
set hidden
" remember more commands and search history
set history=10000
" Make tab completion for files/buffers act like bash
set wildmenu
set shell=bash
" show both line numbers and relative line numbers
set nu
"set rnu
set autoindent
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set numberwidth=4
set wrap
set showmatch
set incsearch
" set winwidth=84
" highlighting search
set hls
" highlight current line
set cursorline
set cmdheight=2
" Always show tab bar
set showtabline=2
" show whitespace
set list listchars=tab:\ \ ,trail:·
set statusline=%f
set statusline+=%y
set runtimepath+=$GOPATH/src/golang.org/x/tools/cmd/
let mapleader=","
:nnoremap <leader><leader> <c-^>
" disable escape (force use of <C-c>)
:inoremap <esc> <nop>
" disable backspace (force use of <C-h>, and <C-w>)
:inoremap <bs> <nop>
" make C-c act like esc for stuff like :normal I
:inoremap <C-c> <esc>
:inoremap <Up> <nop>
:inoremap <Down> <nop>
:inoremap <Left> <nop>
:inoremap <Right> <nop>
:noremap <Up> <nop>
:noremap <Down> <nop>
:noremap <Left> <nop>
:noremap <Right> <nop>
:color tir_black
":color github
if &diff
color simplediff
endif
highlight ExtraWhitespace ctermbg=196 guibg=#FF1100 ctermfg=white guifg=white
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
" clear the search buffer
:nnoremap ,h :nohlsearch<cr>
:nnoremap ,w :%s/ *$//g<cr><c-o><cr>:nohlsearch<cr>
if has("autocmd")
autocmd BufRead,BufNewFile *.go set filetype=go sts=2 sw=2 ts=2 autoread
autocmd BufRead,BufNewFile *.md,*.markdown set filetype=md autoread
autocmd BufRead,BufNewFile *.erb set filetype=erb autoread
autocmd BufRead,BufNewFile *.html set filetype=html autoread
autocmd BufRead,BufNewFile *.feature set filetype=gherkin autoread
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
autocmd BufNewFile,BufRead *.js set filetype=javascript
au! Syntax gherkin source ~/.vim/syntax/cucumber.vim
" autocmd FileType go au BufWritePre <buffer> Fmt
let g:go_fmt_command = "goimports"
let g:go_fmt_autosave = 1
autocmd FileType text setlocal spell textwidth=78
autocmd FileType ruby,yaml,javascript,erb,html,gherkin,coffee,scss set autoindent expandtab sts=2 sw=2 ts=2
autocmd FileType html set autoindent expandtab sts=2 sw=2 ts=2
autocmd Filetype gitcommit setlocal spell textwidth=72
autocmd Filetype css setlocal autoindent expandtab sts=2 sw=2 ts=2 autoread
autocmd Filetype java setlocal autoindent expandtab sts=4 sw=4 ts=4 autoread
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
endif
map <leader>g :!go run %<cr>
map <leader>v :!approvals verify -d vimdiff -a<cr>
" Store temporary files in a central spot
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp