.vimrc 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. " Vim configuration file.
  2. set shell=/usr/bin/zsh
  3. set nocompatible
  4. filetype off
  5. filetype plugin indent off
  6. " Begin vundle setup
  7. set rtp+=~/.vim/bundle/Vundle.vim
  8. call vundle#rc()
  9. filetype plugin on
  10. filetype plugin indent on
  11. syntax on
  12. " Bundles
  13. Bundle 'VundleVim/Vundle.vim'
  14. Bundle 'itchyny/lightline.vim'
  15. Bundle 'tpope/vim-fugitive'
  16. Bundle 'scrooloose/nerdtree'
  17. Bundle 'scrooloose/syntastic'
  18. Bundle 'ervandew/supertab'
  19. Bundle 'majutsushi/tagbar'
  20. Bundle 'fatih/vim-go'
  21. Bundle 'klen/python-mode'
  22. Bundle 'chriskempson/base16-vim'
  23. " Lightline
  24. set guifont=Terminess\ Powerline
  25. set ambiwidth=single
  26. set laststatus=2
  27. let g:lightline = {}
  28. let g:lightline.colorscheme = 'wombat'
  29. let g:lightline.separator = { 'left': '', 'right': '' }
  30. let g:lightline.subseparator = { 'left': '', 'right': '' }
  31. " Nerdtree
  32. map <F2> :NERDTreeToggle<CR>
  33. " Tagbar
  34. map <F3> :TagbarToggle<CR>
  35. " Sytastic
  36. let g:syntastic_always_populate_loc_list = 1
  37. " SuperTab
  38. let g:SuperTabDefaultCompletionType = "context"
  39. " Autoformatting
  40. augroup vimrc_autocmds
  41. autocmd!
  42. " Highlight characters past column 120
  43. autocmd FileType python highlight Excess ctermbg=DarkGrey guibg=Black
  44. autocmd FileType python match Excess /\%120v.*/
  45. autocmd FileType python set nowrap
  46. " Format go files on save
  47. autocmd FileType go autocmd BufWritePre <buffer> Fmt
  48. autocmd BufWritePost $HOME/.vimrc nested source $HOME/.vimrc
  49. augroup END
  50. au BufNewFile,BufRead *Pkgfile set filetype=sh
  51. " Common settings
  52. set tabstop=4 " Number of spaces that a <Tab> in the file counts for.
  53. set softtabstop=4
  54. set shiftwidth=4 " Number of spaces to use for each step of (auto)indent.
  55. set expandtab " Use the appropriate number of spaces to insert a <Tab>.
  56. " Spaces are used in indents with the '>' and '<' commands
  57. " and when 'autoindent' is on. To insert a real tab when
  58. " 'expandtab' is on, use CTRL-V <Tab>.
  59. set smarttab " When on, a <Tab> in front of a line inserts blanks
  60. " according to 'shiftwidth'. 'tabstop' is used in other
  61. " places. A <BS> will delete a 'shiftwidth' worth of space
  62. " at the start of the line.
  63. set showcmd " Show (partial) command in status line.
  64. set number " Show line numbers.
  65. set showmatch " When a bracket is inserted, briefly jump to the matching
  66. " one. The jump is only done if the match can be seen on the
  67. " screen. The time to show the match can be set with
  68. " 'matchtime'.
  69. set hlsearch " When there is a previous search pattern, highlight all
  70. " its matches.
  71. set incsearch " While typing a search command, show immediately where the
  72. " so far typed pattern matches.
  73. set ignorecase " Ignore case in search patterns.
  74. set smartcase " Override the 'ignorecase' option if the search pattern
  75. " contains upper case characters.
  76. set backspace=2 " Influences the working of <BS>, <Del>, CTRL-W
  77. " and CTRL-U in Insert mode. This is a list of items,
  78. " separated by commas. Each item allows a way to backspace
  79. " over something.
  80. set autoindent " Copy indent from current line when starting a new line
  81. " (typing <CR> in Insert mode or when using the "o" or "O"
  82. " command).
  83. set textwidth=120 " Maximum width of text that is being inserted. A longer
  84. " line will be broken after white space to get this width.
  85. set formatoptions=q,r,t " This is a sequence of letters which describes how
  86. " automatic formatting is to be done.
  87. "
  88. " letter meaning when present in 'formatoptions'
  89. " ------ ---------------------------------------
  90. " c Auto-wrap comments using textwidth, inserting
  91. " the current comment leader automatically.
  92. " q Allow formatting of comments with "gq".
  93. " r Automatically insert the current comment leader
  94. " after hitting <Enter> in Insert mode.
  95. " t Auto-wrap text using textwidth (does not apply
  96. " to comments)
  97. set ruler " Show the line and column number of the cursor position,
  98. " separated by a comma.
  99. set background=dark " When set to "dark", Vim will try to use colors that look
  100. " good on a dark background. When set to "light", Vim will
  101. " try to use colors that look good on a light background.
  102. " Any other value is illegal.
  103. set mouse=a " Enable the use of the mouse.
  104. set laststatus=2
  105. set showtabline=2
  106. set noshowmode
  107. set autochdir
  108. set clipboard=unnamed
  109. set colorcolumn=120
  110. set nobackup
  111. set nowritebackup
  112. set noswapfile
  113. set noundofile
  114. set completeopt=longest,menuone
  115. set omnifunc=syntaxcomplete#Complete
  116. set termencoding=utf-8
  117. set term=xterm-256color
  118. if has ('gui_running')
  119. highlight Pmenu guibg=#0a0a0a gui=bold
  120. else
  121. set t_Co=256
  122. endif
  123. colorscheme Tomorrow-Night
  124. " Go tags
  125. let g:tagbar_type_go = {
  126. \ 'ctagstype' : 'go',
  127. \ 'kinds' : [
  128. \ 'p:package',
  129. \ 'i:imports:1',
  130. \ 'c:constants',
  131. \ 'v:variables',
  132. \ 't:types',
  133. \ 'n:interfaces',
  134. \ 'w:fields',
  135. \ 'e:embedded',
  136. \ 'm:methods',
  137. \ 'r:constructor',
  138. \ 'f:functions'
  139. \ ],
  140. \ 'sro' : '.',
  141. \ 'kind2scope' : {
  142. \ 't' : 'ctype',
  143. \ 'n' : 'ntype'
  144. \ },
  145. \ 'scope2kind' : {
  146. \ 'ctype' : 't',
  147. \ 'ntype' : 'n'
  148. \ },
  149. \ 'ctagsbin' : 'gotags',
  150. \ 'ctagsargs' : '-sort -silent'
  151. \ }
  152. " Python mode
  153. let g:pymode_python = 'python'
  154. let g:pymode_rope = 1
  155. let g:pymode_doc = 1
  156. let g:pymode_doc_key = 'K'
  157. let g:pymode_lint = 1
  158. let g:pymode_lint_checker = [ "pyflakes", "pep8" ]
  159. let g:pymode_lint_write = 1
  160. let g:pymode_virtualenv = 1
  161. let g:pymode_breakpoint = 1
  162. let g:pymode_breakpoint_key = '<leader>b'
  163. let g:pymode_syntax = 1
  164. let g:pymode_syntax_all = 1
  165. let g:pymode_syntax_indent_errors = g:pymode_syntax_all
  166. let g:pymode_syntax_space_errors = g:pymode_syntax_all
  167. let g:pymode_options_max_line_length = 120
  168. let g:pymode_folding = 0