.vimrc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. """""""""""""""""""""""""""""""""""""
  2. " Capella .vimrc
  3. """""""""""""""""""""""""""""""""""""
  4. set nocompatible " be iMproved, required
  5. filetype off " required
  6. " set the runtime path to include Vundle and initialize
  7. set rtp+=~/.vim/bundle/Vundle.vim
  8. call vundle#begin()
  9. " let Vundle manage Vundle, required
  10. Plugin 'VundleVim/Vundle.vim'
  11. " ------Plugins-------
  12. Plugin 'vim-airline/vim-airline'
  13. Plugin 'vim-airline/vim-airline-themes'
  14. Plugin 'scrooloose/nerdtree'
  15. Plugin 'tpope/vim-fugitive'
  16. Plugin 'kristijanhusak/vim-multiple-cursors'
  17. Plugin 'tpope/vim-surround'
  18. Plugin 'colors'
  19. Plugin 'jistr/vim-nerdtree-tabs'
  20. Plugin 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
  21. call vundle#end()
  22. filetype plugin indent on
  23. if has('syntax') && !exists('g:syntax_on')
  24. syntax enable
  25. endif
  26. """""""""""""""""""""""""""""""""""""
  27. " Configuration Section
  28. """""""""""""""""""""""""""""""""""""
  29. set laststatus=2
  30. set ruler
  31. set showcmd
  32. set wildmenu
  33. set autoread
  34. set backspace=indent,eol,start
  35. " Show linenumbers
  36. set number
  37. set noruler
  38. " Encoding
  39. set encoding=utf-8
  40. " Set Proper Tabs
  41. set tabstop=4
  42. set shiftwidth=4
  43. set smarttab
  44. set expandtab
  45. set listchars=tab:▒░,trail:▓
  46. set list
  47. " Theme and Styling
  48. set t_Co=256
  49. set background=dark
  50. " Vim-Airline Configuration
  51. let g:airline#extensions#tabline#enabled = 1
  52. let g:airline_theme='badwolf'
  53. let g:airline_powerline_fonts = 1
  54. " NERDTree
  55. nnoremap <S-n> :NERDTreeToggle<CR>
  56. " exit insert mode
  57. inoremap <C-c> <Esc>
  58. set guifont=Source\ Code\ Pro\ for\ Powerline
  59. set t_Co=256
  60. let g:NERDTreeDirArrowExpandable = '▸'
  61. let g:NERDTreeDirArrowCollapsible = '▾'
  62. """""""""""""""""""""""""""""""""""""
  63. " Colors
  64. """""""""""""""""""""""""""""""""""""
  65. hi Normal ctermfg=252 ctermbg=none
  66. hi CursorLine ctermbg=236 cterm=none
  67. hi CursorLineNr ctermfg=208 cterm=none
  68. hi Boolean ctermfg=141
  69. hi Character ctermfg=222
  70. hi Number ctermfg=141
  71. hi String ctermfg=222
  72. hi Conditional ctermfg=197 cterm=bold
  73. hi Constant ctermfg=141 cterm=bold
  74. hi DiffDelete ctermfg=125 ctermbg=233
  75. hi Directory ctermfg=154 cterm=bold
  76. hi Error ctermfg=222 ctermbg=233
  77. hi Exception ctermfg=154 cterm=bold
  78. hi Float ctermfg=141
  79. hi Function ctermfg=154
  80. hi Identifier ctermfg=208
  81. hi Keyword ctermfg=197 cterm=bold
  82. hi Operator ctermfg=197
  83. hi PreCondit ctermfg=154 cterm=bold
  84. hi PreProc ctermfg=154
  85. hi Repeat ctermfg=197 cterm=bold
  86. hi Statement ctermfg=197 cterm=bold
  87. hi Tag ctermfg=197
  88. hi Title ctermfg=203
  89. hi Visual ctermbg=238
  90. hi Comment ctermfg=244
  91. hi LineNr ctermfg=239 ctermbg=235
  92. hi NonText ctermfg=239
  93. hi SpecialKey ctermfg=239
  94. autocmd FileType nerdtree setlocal colorcolumn&
  95. highlight ColorColumn ctermbg=232 guibg=#2c2d27
  96. let &colorcolumn="".join(range(81,999),",")
  97. set splitright
  98. autocmd vimenter * NERDTree
  99. autocmd vimenter * wincmd p
  100. let g:NERDTreeDirArrows=0
  101. """""""""""""""""""""""""""""""""""""
  102. " Golang
  103. """""""""""""""""""""""""""""""""""""
  104. autocmd Filetype go command! -bang A call go#alternate#Switch(<bang>0, 'edit')
  105. autocmd Filetype go command! -bang AV call go#alternate#Switch(<bang>0, 'vsplit')
  106. autocmd Filetype go command! -bang AS call go#alternate#Switch(<bang>0, 'split')
  107. autocmd Filetype go command! -bang AT call go#alternate#Switch(<bang>0, 'tabe')
  108. map <C-l> :cnext<CR>
  109. map <C-k> :cprevious<CR>
  110. nnoremap <leader>a :cclose<CR>
  111. autocmd FileType go nmap <leader>b <Plug>(go-build)
  112. autocmd FileType go nmap <leader>r <Plug>(go-run)