Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.83 KB | None | 0 0
  1. " Welcome to Vim (http://go/vim).
  2. "
  3. " If you see this file, your homedir was just created on this workstation.
  4. " That means either you are new to Google (in that case, welcome!) or you
  5. " got yourself a faster machine.
  6. " Either way, the main goal of this configuration is to help you be more
  7. " productive; if you have ideas, praise or complaints, direct them to
  8. " vi-users@google.com (http://g/vi-users). We'd especially like to hear from you
  9. " if you can think of ways to make this configuration better for the next
  10. " Noogler.
  11. " If you want to learn more about Vim at Google, see http://go/vimintro.
  12.  
  13. " Enable modern Vim features not compatible with Vi spec.
  14. set nocompatible
  15.  
  16. "======================"
  17. " Vundle configuration "
  18. "======================"
  19.  
  20. filetype off
  21. set rtp+=~/.vim/bundle/Vundle.vim
  22. if isdirectory(expand('$HOME/.vim/bundle/Vundle.vim'))
  23. call vundle#begin()
  24. " Required
  25. Plugin 'VundleVim/Vundle.vim'
  26. " Plugin 'gmarik/vundle'
  27. " Install plugins that come from github. Once Vundle is installed, these can be
  28. " installed with :PluginInstall
  29. Plugin 'google/vim-colorscheme-primary'
  30. Plugin 'vim-airline/vim-airline'
  31. Plugin 'vim-airline/vim-airline-themes'
  32. Bundle 'edkolev/tmuxline.vim'
  33. Plugin 'scrooloose/nerdtree'
  34. Plugin 'vim-syntastic/syntastic'
  35. " Plugin 'tpope/vim-surround.git' " TODO.
  36. Plugin 'ctrlpvim/ctrlp.vim'
  37. Plugin 'FelikZ/ctrlp-py-matcher'
  38. Plugin 'altercation/vim-colors-solarized'
  39. Plugin 'majutsushi/tagbar'
  40. Plugin 'scrooloose/nerdcommenter'
  41. " Plugin 'easymotion/vim-easymotion' " TODO.
  42. " Plugin 'ervandew/supertab' " TODO.
  43. " Add maktaba and codefmt to the runtimepath.
  44. " (The latter must be installed before it can be used.)
  45. Plugin 'google/vim-maktaba'
  46. Plugin 'google/vim-codefmt'
  47. " Also add Glaive, which is used to configure codefmt's maktaba flags. See
  48. " `:help :Glaive` for usage.
  49. Plugin 'google/vim-glaive'
  50. " https://github.com/tpope/vim-sensible " TODO.
  51. Plugin 'vim-scripts/vcscommand.vim'
  52. """""""""""""""""""""
  53. " Plugin 'scrooloose/nerdcommenter'
  54. " Plugin 'Valloric/MatchTagAlways'
  55. " Plugin 'vim-scripts/netrw.vim'
  56. " Plugin 'tpope/vim-sensible'
  57. " Plugin 'SirVer/ultisnips'
  58. " Provide many default snippets for a variety of snippets.
  59. " Uncomment and :PluginInstall to enable
  60. " Plugin 'honza/vim-snippets'
  61.  
  62. call vundle#end()
  63. else
  64. echomsg 'Vundle is not installed. You can install Vundle from'
  65. \ 'https://github.com/VundleVim/Vundle.vim'
  66. endif
  67.  
  68. "========"
  69. " Glaive "
  70. "========"
  71.  
  72. " the glaive#Install() should go after the "call vundle#end()"
  73. call glaive#Install()
  74. " Optional: Enable codefmt's default mappings on the <Leader>= prefix.
  75. Glaive codefmt plugin[mappings]
  76. " Glaive codefmt google_java_executable="java -jar /path/to/google-java-format-VERSION-all-deps.jar"
  77.  
  78. "==============="
  79. " Google config "
  80. "==============="
  81.  
  82. if filereadable(expand('$HOME/.config/vim_google.vim'))
  83. source ~/.config/vim_google.vim
  84. endif
  85.  
  86. "===================="
  87. " Some basic options "
  88. "===================="
  89.  
  90. filetype plugin indent on
  91.  
  92. " Enable syntax highlighting
  93. syntax on
  94.  
  95. " Uncomment if you want to map ; to : to cut down on chording
  96. " nnoremap ; :
  97.  
  98. " Automatically change the working path to the path of the current file
  99. autocmd BufNewFile,BufEnter * silent! lcd %:p:h
  100.  
  101. " Show line numbers
  102. set number
  103.  
  104. " use » to mark Tabs and ° to mark trailing whitespace. This is a
  105. " non-obtrusive way to mark these special characters.
  106. set list listchars=tab:»\ ,trail:°
  107.  
  108. " Highlight the search term when you search for it.
  109. set hlsearch
  110.  
  111. " By default, it looks up man pages for the word under the cursor, which isn't
  112. " very useful, so we map it to something else.
  113. " nnoremap <s-k> <CR>
  114.  
  115. " Explicitly set the Leader to comma. You you can use '\' (the default),
  116. " or anything else (some people like ';').
  117. " let mapleader=','
  118.  
  119. " Enable mouse support.
  120. set mouse=a
  121.  
  122. " Clipboard persistence.
  123. autocmd VimLeave * call system("xsel -ib", getreg('+'))
  124.  
  125. " Colors.
  126. set t_Co=256
  127. set background=dark
  128. " colorscheme primary
  129. " let g:solarized_termcolors=256
  130. colorscheme solarized
  131.  
  132. " Airline.
  133. let g:airline#extensions#tabline#enabled = 1
  134. let g:airline#extensions#whitespace#enabled = 1
  135. let g:airline_powerline_fonts = 1
  136.  
  137. " Airline theme.
  138. let g:airline_theme='luna'
  139.  
  140. " Tmuxline.
  141. let g:tmuxline_status_justify = 'left'
  142. let g:tmuxline_preset = {
  143. \'a' : '#S',
  144. \'win' : ['#I', '#W'],
  145. \'cwin' : ['#I', '#W'],
  146. \'y' : ['%Y-%m-%d', '%T'],
  147. \'z' : '#h'}
  148.  
  149. " Syntastic.
  150. " set statusline+=%#warningmsg#
  151. " set statusline+=%{SyntasticStatuslineFlag()}
  152. " set statusline+=%*
  153.  
  154. " let g:syntastic_always_populate_loc_list = 1
  155. " let g:syntastic_auto_loc_list = 1
  156. " let g:syntastic_check_on_open = 1
  157. " let g:syntastic_check_on_wq = 0
  158.  
  159. " CtrlP
  160. let g:ctrlp_map = '<c-p>'
  161. let g:ctrlp_cmd = 'CtrlP'
  162. let g:ctrlp_working_path_mode = 'ra'
  163. set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
  164. let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
  165. let g:ctrlp_custom_ignore = {
  166. \ 'dir': '\v[\/]\.(git|hg|svn)$',
  167. \ 'file': '\v\.(exe|so|dll)$',
  168. \ 'link': 'some_bad_symbolic_links',
  169. \ }
  170. " Install https://github.com/ggreer/the_silver_searcher.
  171. let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --hidden
  172. \ --ignore .git
  173. \ --ignore .svn
  174. \ --ignore .hg
  175. \ --ignore .DS_Store
  176. \ --ignore "**/*.pyc"
  177. \ --ignore .git5_specs
  178. \ --ignore review
  179. \ -g ""'
  180. let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
  181.  
  182. " Tagbar
  183. nmap <F8> :TagbarToggle<CR>
  184.  
  185. " NerdCommenter
  186. " Add spaces after comment delimiters by default
  187. let g:NERDSpaceDelims = 1
  188. " Use compact syntax for prettified multi-line comments
  189. let g:NERDCompactSexyComs = 1
  190. " Align line-wise comment delimiters flush left instead of following code indentation
  191. let g:NERDDefaultAlign = 'left'
  192. " Set a language to use its alternate delimiters by default
  193. let g:NERDAltDelims_java = 1
  194. " Add your own custom formats or override the defaults
  195. let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }
  196. " Allow commenting and inverting empty lines (useful when commenting a region)
  197. let g:NERDCommentEmptyLines = 1
  198. " Enable trimming of trailing whitespace when uncommenting
  199. let g:NERDTrimTrailingWhitespace = 1
  200.  
  201. " Vim-codefmt
  202. " augroup autoformat_settings
  203. " autocmd FileType bzl AutoFormatBuffer buildifier
  204. " autocmd FileType c,cpp,proto,javascript AutoFormatBuffer clang-format
  205. " autocmd FileType dart AutoFormatBuffer dartfmt
  206. " autocmd FileType go AutoFormatBuffer gofmt
  207. " autocmd FileType gn AutoFormatBuffer gn
  208. " autocmd FileType html,css,json AutoFormatBuffer js-beautify
  209. " autocmd FileType java AutoFormatBuffer google-java-format
  210. " autocmd FileType python AutoFormatBuffer yapf
  211. " " Alternative: autocmd FileType python AutoFormatBuffer autopep8
  212. " augroup END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement