.vimrc 3.7 KB

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