Skip to content

Instantly share code, notes, and snippets.

@ncdc
Created May 7, 2014 14:42
Show Gist options
  • Save ncdc/7c6131dcf02b54f423ee to your computer and use it in GitHub Desktop.
Save ncdc/7c6131dcf02b54f423ee to your computer and use it in GitHub Desktop.
runtime bundle/vim-pathogen/autoload/pathogen.vim
execute pathogen#infect()
set nocompatible
set modeline
set modelines=5
syntax on
filetype plugin indent on
set t_Co=256
set bg=dark
color grb256
"color solarized
set ai
set copyindent
set showmatch
set smartcase
set si
set is
set hls
set et
set sr
set ts=2
set sts=2
set sw=2
set ruler
set number
set bs=2
set laststatus=2
set hidden
set title
set nobackup
set noswapfile
augroup vimrc_autocmds
" clear
au!
" autocmd vimenter * if !argc() | NERDTree | endif
au BufRead,BufNewFile *.ru,Gemfile setfiletype ruby
au FileType go au BufWritePre <buffer> Fmt
au FileType go setlocal noexpandtab
au Filetype go nnoremap <leader>v :vsp <CR>:exe "GoDef" <CR>
au Filetype go nnoremap <leader>s :sp <CR>:exe "GoDef"<CR>
au Filetype go nnoremap <leader>t :tab split <CR>:exe "GoDef"<CR>
augroup END
let g:SuperTabDefaultCompletionType = "context"
let g:SuperTabClosePreviewOnPopupClose = 1
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
let mapleader=","
match ErrorMsg '\s\+$'
nnoremap <Leader>rtw :%s/\s\+$//e<CR>
nnoremap <F6> :set invpaste paste?<CR>
set pastetoggle=<F6>
set showmode
map <F5> :NERDTreeFind<CR>o
map <S-F5> :NERDTreeToggle<CR>
"nmap <C-S-t> :TagbarOpenAutoClose<CR>
" Quickly edit/reload the vimrc file
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
set mouse=a
runtime macros/matchit.vim
set statusline=%t "tail of the filename
set statusline+=%h "help file flag
set statusline+=%m "modified flag
set statusline+=%r "read only flag
set statusline+=%y "file type
set statusline+=%= "left/right separator
set statusline+=%c, "cursor column
set statusline+=%l/%L "cursor line/total lines
let g:easytags_dynamic_files = 2
if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
let g:ctrlp_use_caching = 0
endif
" force the cwindow to be on the very bottom
autocmd FileType qf wincmd J
" bind K to grep word under cursor
nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cwindow<CR>
" bind \ to grep shortcut
command! -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw!
nnoremap \ :Ag<SPACE>
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
call xolox#easytags#map_filetypes('go', 'go')
let g:gofmt_command = "goimports"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment