.vimrc (3117B)
1 set nocompatible " be iMproved, required 2 filetype off " required 3 4 " set the runtime path to include Vundle and initialize 5 set rtp+=~/.vim/bundle/Vundle.vim 6 call vundle#begin() 7 8 " Ag 9 Plugin 'rking/ag.vim' 10 11 " Go development plugin 12 Plugin 'fatih/vim-go' 13 14 call vundle#end() 15 16 set laststatus=2 17 set t_Co=256 18 set encoding=utf-8 19 set autoindent 20 set smartindent 21 set magic 22 set number 23 set scrolloff=3 24 set sidescroll=3 25 set ruler 26 set cc=80 27 set nowrap 28 set ignorecase 29 set smartcase 30 set splitbelow 31 set hidden 32 set notimeout 33 set incsearch 34 set showmatch 35 set hlsearch 36 set mouse=a 37 set noswapfile 38 set nofoldenable 39 set lazyredraw 40 set t_Co=256 41 42 filetype on 43 filetype plugin on 44 filetype indent on 45 46 syntax enable 47 48 autocmd FileType markdown setlocal tw=80 et ts=2 sw=2 49 autocmd FileType text setlocal tw=80 50 autocmd FileType c,cpp set tabstop=4 shiftwidth=4 expandtab 51 autocmd FileType c set omnifunc=ccomplete#Complete 52 autocmd FileType html,xhtml,css,xml,xslt set shiftwidth=2 softtabstop=2 53 autocmd FileType vim,lua,nginx set shiftwidth=2 softtabstop=2 54 autocmd FileType css set omnifunc=csscomplete#CompleteCSS 55 autocmd FileType xhtml,html set omnifunc=htmlcomplete#CompleteTags 56 autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags 57 autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=0 58 autocmd FileType asm set noexpandtab shiftwidth=8 softtabstop=0 syntax=nasm 59 60 " Golang customizations 61 let g:go_fmt_command = "goimports" 62 let g:go_fmt_fail_silently = 1 63 let g:go_bin_path = expand("$HOME/go/bin") 64 let g:go_auto_type_info = 1 65 66 " Syntax Highlighting for Golang 67 let g:go_highlight_functions = 1 68 let g:go_highlight_methods = 1 69 let g:go_highlight_structs = 1 70 let g:go_highlight_interfaces = 1 71 let g:go_highlight_operators = 1 72 let g:go_highlight_build_constraints = 1 73 74 " Go keymaps 75 " Type Info 76 au FileType go nmap <Leader>i <Plug>(go-info) 77 " GoDoc 78 au FileType go nmap <Leader>gd <Plug>(go-doc) 79 au Filetype go nmap <Leader>gv <Plug>(go-doc-vertical) 80 " Build/Run/Test 81 au FileType go nmap <Leader>r <Plug>(go-run) 82 au FileType go nmap <Leader>b <Plug>(go-build) 83 au FileType go nmap <Leader>t <Plug>(go-test) 84 " GoDef 85 au FileType go nmap gd <Plug>(go-def) 86 au FileType go nmap <Leader>gs <Plug>(go-def-split) 87 au FileType go nmap <Leader>gv <Plug>(go-def-vertical) 88 au FileType go nmap <Leader>gt <Plug>(go-def-tab) 89 90 " Enhanced keyboard mappings 91 " 92 " in normal mode F2 will save the file 93 nmap <F2> :w<CR> 94 95 " in insert mode F2 will exit insert, save, enters insert again 96 imap <F2> <ESC>:w<CR>i 97 98 " switch between header/source with F4 99 map <F4> :e %:p:s,.h$,.X123X,:s,.c$,.h,:s,.X123X$,.c,<CR> 100 101 map <F5> :make<CR> 102 map <F6> :make clean all<CR> 103 104 " The Silver Searcher 105 " bind \ (backward slash) to grep shortcut 106 command -nargs=+ -complete=file -bar Ag silent! grep! <args>|cwindow|redraw! 107 nnoremap \ :Ag<SPACE> 108 109 set notermguicolors 110 111 " Solarized stuff 112 "let g:solarized_termtrans=1 113 "let g:solarized_contrast='high' 114 let g:enable_bold_font = 1 115 let g:enable_italic_font = 1 116 let g:hybrid_custom_term_colors = 1 117 let base16colorspace=256 118 set background=dark 119 colorscheme hybrid 120 highlight CursorLine cterm=BOLD ctermbg=235 ctermfg=NONE