Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.48 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 " if you can think of ways to make this configuration better for the next " Noogler.
  9. " If you want to learn more about Vim at Google, see http://go/vimintro.
  10.  
  11. " Enable modern Vim features not compatible with Vi spec.
  12. set nocompatible
  13.  
  14. " Use the 'google' package by default (see http://go/vim/packages).
  15. source /usr/share/vim/google/google.vim
  16.  
  17. " Plugin configuration.
  18. " See http://google3/devtools/editors/vim/examples/ for example configurations
  19. " and http://go/vim/plugins for more information about vim plugins at Google.
  20.  
  21. " Plugin loading is commented out below - uncomment the plugins you'd like to
  22. " load.
  23.  
  24. " Load google's formatting plugins (http://go/vim/plugins/codefmt-google).
  25. " The default mapping is \= (or <leader>= if g:mapleader has a custom value),
  26. " with
  27. " - \== formatting the current line or selected lines in visual mode
  28. " (:FormatLines).
  29. " - \=b formatting the full buffer (:FormatCode).
  30. "
  31. " To bind :FormatLines to the same key in insert and normal mode, add:
  32. " noremap <C-K> :FormatLines<CR>
  33. " inoremap <C-K> <C-O>:FormatLines<CR>
  34. "Glug codefmt plugin[mappings] gofmt_executable="goimports"
  35. "Glug codefmt-google
  36. Glug codefmt
  37. Glug codefmt-google
  38. augroup autoformat_settings
  39. autocmd FileType bzl AutoFormatBuffer buildifier
  40. autocmd FileType go AutoFormatBuffer gofmt
  41. autocmd FileType c,cpp,proto,javascript AutoFormatBuffer clang-format
  42. augroup END
  43. noremap <C-K> :FormatCode<CR>
  44. inoremap <C-K> <C-O>:FormatCode<CR>
  45.  
  46.  
  47. " Enable autoformatting on save for the languages at Google that enforce
  48. " formatting, and for which all checked-in code is already conforming (thus,
  49. " autoformatting will never change unrelated lines in a file).
  50. " Note formatting changed lines only isn't supported yet
  51. " (see https://github.com/google/vim-codefmt/issues/9).
  52. "augroup autoformat_settings
  53. " autocmd FileType bzl AutoFormatBuffer buildifier
  54. " autocmd FileType go AutoFormatBuffer gofmt
  55. " See go/vim/plugins/codefmt-google, :help codefmt-google and :help codefmt
  56. " for details about other available formatters.
  57. "augroup END
  58.  
  59. " Load YCM (http://go/ycm) for semantic auto-completion and quick syntax
  60. " error checking. Pulls in a google3-enabled version of YCM itself and
  61. " a google3-specific default configuration.
  62. Glug youcompleteme-google
  63.  
  64. " Load the automated blaze dependency integration for Go.
  65. " Note: for Go, blazedeps uses the Go team's glaze tool, which is fully
  66. " supported by the Go team; for other languages. Note that the plugin is
  67. " currently unsupported for other languages.
  68. "Glug blazedeps auto_filetypes=`['go']`
  69.  
  70. " Load piper integration (http://go/VimPerforce).
  71. "Glug piper plugin[mappings]
  72.  
  73. " Load the Critique integration. Use :h critique for more details.
  74. "Glug critique plugin[mappings]
  75.  
  76. " Load blaze integration (http://go/blazevim).
  77. "Glug blaze plugin[mappings]
  78.  
  79. " Load the syntastic plugin (http://go/vim/plugins/syntastic-google).
  80. " Note: this requires installing the upstream syntastic plugin from
  81. " https://github.com/scrooloose/syntastic.
  82. "Glug syntastic-google
  83.  
  84. " Load the ultisnips plugin (http://go/ultisnips).
  85. " Note: this requires installing the upstream ultisnips plugin from
  86. " https://github.com/SirVer/ultisnips.
  87. "Glug ultisnips-google
  88.  
  89. " All of your plugins must be added before the following line.
  90. " See go/vim-plugin-manager if you need help picking a plugin manager and
  91. " setting it up.
  92.  
  93. " Enable file type based indent configuration and syntax highlighting.
  94. " Note that when code is pasted via the terminal, vim by default does not detect
  95. " that the code is pasted (as opposed to when using vim's paste mappings), which
  96. " leads to incorrect indentation when indent mode is on.
  97. " To work around this, use ":set paste" / ":set nopaste" to toggle paste mode.
  98. " You can also use a plugin to:
  99. " - enter insert mode with paste (https://github.com/tpope/vim-unimpaired)
  100. " - auto-detect pasting (https://github.com/ConradIrwin/vim-bracketed-paste)
  101. filetype plugin indent on
  102. syntax on
  103.  
  104. set number
  105. set hlsearch
  106. set incsearch
  107.  
  108. let mapleader=','
  109. noremap <Leader>w :update<CR>
  110.  
  111. set nocompatible " be iMproved, required
  112. filetype off " required
  113.  
  114. " set the runtime path to include Vundle and initialize
  115. set rtp+=~/.vim/bundle/Vundle.vim
  116. call vundle#begin()
  117.  
  118. " let Vundle manage Vundle, required
  119. Plugin 'VundleVim/Vundle.vim'
  120.  
  121. Plugin 'scrooloose/nerdtree'
  122. Plugin 'vim-airline/vim-airline'
  123. Plugin 'vim-airline/vim-airline-themes'
  124. Plugin 'tpope/vim-commentary'
  125. Plugin 'octol/vim-cpp-enhanced-highlight'
  126. Plugin 'jiangmiao/auto-pairs'
  127. Plugin 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
  128. Plugin 'junegunn/fzf.vim'
  129.  
  130. call vundle#end() " required
  131. filetype plugin indent on " required
  132. " END VUNDLE
  133.  
  134. map <C-m> :NERDTreeToggle<CR>
  135.  
  136. nnoremap <Leader>h :bp<CR>
  137. nnoremap <Leader>l :bn<CR>
  138. nnoremap <leader>bq :bp<CR>:bd #<CR>
  139.  
  140. let g:airline#extensions#tabline#enabled = 1
  141. let g:airline_theme='bubblegum'
  142.  
  143. nnoremap <Leader><CR> :noh<CR>
  144.  
  145. set tabstop=2
  146. set expandtab
  147. set shiftwidth=2
  148.  
  149. colorscheme jelleybeans
  150.  
  151. nnoremap <C-p> :Files<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement