.vimrc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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 'iwonbigbro/vim-hybrid'
  21. Plugin 'dense-analysis/ale'
  22. Plugin 'ojroques/vim-oscyank'
  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. set cursorline
  41. " Encoding
  42. set encoding=utf-8
  43. " Set Proper Tabs
  44. set tabstop=4
  45. set shiftwidth=4
  46. set smarttab
  47. set expandtab
  48. set listchars=tab:▒░,trail:▓
  49. set list
  50. " Search
  51. set hlsearch
  52. set incsearch
  53. " Theme and Styling
  54. set t_Co=256
  55. set background=dark
  56. " Vim-Airline Configuration
  57. let g:airline#extensions#tabline#enabled = 1
  58. let g:airline_theme='badwolf'
  59. let g:airline_powerline_fonts = 1
  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. let g:NERDTreeDirArrows=0
  102. """""""""""""""""""""""""""""""""""""
  103. " Golang
  104. """""""""""""""""""""""""""""""""""""
  105. autocmd Filetype go command! -bang A call go#alternate#Switch(<bang>0, 'edit')
  106. autocmd Filetype go command! -bang AV call go#alternate#Switch(<bang>0, 'vsplit')
  107. autocmd Filetype go command! -bang AS call go#alternate#Switch(<bang>0, 'split')
  108. autocmd Filetype go command! -bang AT call go#alternate#Switch(<bang>0, 'tabe')
  109. map <C-l> :cnext<CR>
  110. map <C-k> :cprevious<CR>
  111. map gd :ALEGoToDefinition<CR>
  112. nnoremap <leader>a :cclose<CR>
  113. autocmd FileType go nmap <leader>b <Plug>(go-build)
  114. autocmd FileType go nmap <leader>r <Plug>(go-run)
  115. set spell spelllang=en_gb
  116. let g:ale_fix_on_save = 1
  117. let g:ale_completion_enabled = 1
  118. let g:ale_echo_msg_format = '[%linter%]% [code]% %s'
  119. let g:ale_sign_error = '✗'
  120. let g:ale_sign_warning = '⚠️'
  121. let g:ale_sign_column_always = 1
  122. let g:ale_fixers = {'go': ['gofmt', 'gofumpt', 'goimports', 'golines', 'trim_whitespace']}