Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Welcome to Vim (http://go/vim).
- "
- " If you see this file, your homedir was just created on this workstation.
- " That means either you are new to Google (in that case, welcome!) or you
- " got yourself a faster machine.
- " Either way, the main goal of this configuration is to help you be more
- " productive; if you have ideas, praise or complaints, direct them to
- " 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.
- " If you want to learn more about Vim at Google, see http://go/vimintro.
- " Enable modern Vim features not compatible with Vi spec.
- set nocompatible
- "======================"
- " Vundle configuration "
- "======================"
- filetype off
- set rtp+=~/.vim/bundle/Vundle.vim
- if isdirectory(expand('$HOME/.vim/bundle/Vundle.vim'))
- call vundle#begin()
- " Required
- Plugin 'VundleVim/Vundle.vim'
- " Plugin 'gmarik/vundle'
- " Install plugins that come from github. Once Vundle is installed, these can be
- " installed with :PluginInstall
- Plugin 'google/vim-colorscheme-primary'
- Plugin 'vim-airline/vim-airline'
- Plugin 'vim-airline/vim-airline-themes'
- Bundle 'edkolev/tmuxline.vim'
- Plugin 'scrooloose/nerdtree'
- Plugin 'vim-syntastic/syntastic'
- " Plugin 'tpope/vim-surround.git' " TODO.
- Plugin 'ctrlpvim/ctrlp.vim'
- Plugin 'FelikZ/ctrlp-py-matcher'
- Plugin 'altercation/vim-colors-solarized'
- Plugin 'majutsushi/tagbar'
- Plugin 'scrooloose/nerdcommenter'
- " Plugin 'easymotion/vim-easymotion' " TODO.
- " Plugin 'ervandew/supertab' " TODO.
- " Add maktaba and codefmt to the runtimepath.
- " (The latter must be installed before it can be used.)
- Plugin 'google/vim-maktaba'
- Plugin 'google/vim-codefmt'
- " Also add Glaive, which is used to configure codefmt's maktaba flags. See
- " `:help :Glaive` for usage.
- Plugin 'google/vim-glaive'
- " https://github.com/tpope/vim-sensible " TODO.
- Plugin 'vim-scripts/vcscommand.vim'
- """""""""""""""""""""
- " Plugin 'scrooloose/nerdcommenter'
- " Plugin 'Valloric/MatchTagAlways'
- " Plugin 'vim-scripts/netrw.vim'
- " Plugin 'tpope/vim-sensible'
- " Plugin 'SirVer/ultisnips'
- " Provide many default snippets for a variety of snippets.
- " Uncomment and :PluginInstall to enable
- " Plugin 'honza/vim-snippets'
- call vundle#end()
- else
- echomsg 'Vundle is not installed. You can install Vundle from'
- \ 'https://github.com/VundleVim/Vundle.vim'
- endif
- "========"
- " Glaive "
- "========"
- " the glaive#Install() should go after the "call vundle#end()"
- call glaive#Install()
- " Optional: Enable codefmt's default mappings on the <Leader>= prefix.
- Glaive codefmt plugin[mappings]
- " Glaive codefmt google_java_executable="java -jar /path/to/google-java-format-VERSION-all-deps.jar"
- "==============="
- " Google config "
- "==============="
- if filereadable(expand('$HOME/.config/vim_google.vim'))
- source ~/.config/vim_google.vim
- endif
- "===================="
- " Some basic options "
- "===================="
- filetype plugin indent on
- " Enable syntax highlighting
- syntax on
- " Uncomment if you want to map ; to : to cut down on chording
- " nnoremap ; :
- " Automatically change the working path to the path of the current file
- autocmd BufNewFile,BufEnter * silent! lcd %:p:h
- " Show line numbers
- set number
- " use » to mark Tabs and ° to mark trailing whitespace. This is a
- " non-obtrusive way to mark these special characters.
- set list listchars=tab:»\ ,trail:°
- " Highlight the search term when you search for it.
- set hlsearch
- " By default, it looks up man pages for the word under the cursor, which isn't
- " very useful, so we map it to something else.
- " nnoremap <s-k> <CR>
- " Explicitly set the Leader to comma. You you can use '\' (the default),
- " or anything else (some people like ';').
- " let mapleader=','
- " Enable mouse support.
- set mouse=a
- " Clipboard persistence.
- autocmd VimLeave * call system("xsel -ib", getreg('+'))
- " Colors.
- set t_Co=256
- set background=dark
- " colorscheme primary
- " let g:solarized_termcolors=256
- colorscheme solarized
- " Airline.
- let g:airline#extensions#tabline#enabled = 1
- let g:airline#extensions#whitespace#enabled = 1
- let g:airline_powerline_fonts = 1
- " Airline theme.
- let g:airline_theme='luna'
- " Tmuxline.
- let g:tmuxline_status_justify = 'left'
- let g:tmuxline_preset = {
- \'a' : '#S',
- \'win' : ['#I', '#W'],
- \'cwin' : ['#I', '#W'],
- \'y' : ['%Y-%m-%d', '%T'],
- \'z' : '#h'}
- " Syntastic.
- " set statusline+=%#warningmsg#
- " set statusline+=%{SyntasticStatuslineFlag()}
- " set statusline+=%*
- " let g:syntastic_always_populate_loc_list = 1
- " let g:syntastic_auto_loc_list = 1
- " let g:syntastic_check_on_open = 1
- " let g:syntastic_check_on_wq = 0
- " CtrlP
- let g:ctrlp_map = '<c-p>'
- let g:ctrlp_cmd = 'CtrlP'
- let g:ctrlp_working_path_mode = 'ra'
- set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
- let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
- let g:ctrlp_custom_ignore = {
- \ 'dir': '\v[\/]\.(git|hg|svn)$',
- \ 'file': '\v\.(exe|so|dll)$',
- \ 'link': 'some_bad_symbolic_links',
- \ }
- " Install https://github.com/ggreer/the_silver_searcher.
- let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --hidden
- \ --ignore .git
- \ --ignore .svn
- \ --ignore .hg
- \ --ignore .DS_Store
- \ --ignore "**/*.pyc"
- \ --ignore .git5_specs
- \ --ignore review
- \ -g ""'
- let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
- " Tagbar
- nmap <F8> :TagbarToggle<CR>
- " NerdCommenter
- " Add spaces after comment delimiters by default
- let g:NERDSpaceDelims = 1
- " Use compact syntax for prettified multi-line comments
- let g:NERDCompactSexyComs = 1
- " Align line-wise comment delimiters flush left instead of following code indentation
- let g:NERDDefaultAlign = 'left'
- " Set a language to use its alternate delimiters by default
- let g:NERDAltDelims_java = 1
- " Add your own custom formats or override the defaults
- let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }
- " Allow commenting and inverting empty lines (useful when commenting a region)
- let g:NERDCommentEmptyLines = 1
- " Enable trimming of trailing whitespace when uncommenting
- let g:NERDTrimTrailingWhitespace = 1
- " Vim-codefmt
- " augroup autoformat_settings
- " autocmd FileType bzl AutoFormatBuffer buildifier
- " autocmd FileType c,cpp,proto,javascript AutoFormatBuffer clang-format
- " autocmd FileType dart AutoFormatBuffer dartfmt
- " autocmd FileType go AutoFormatBuffer gofmt
- " autocmd FileType gn AutoFormatBuffer gn
- " autocmd FileType html,css,json AutoFormatBuffer js-beautify
- " autocmd FileType java AutoFormatBuffer google-java-format
- " autocmd FileType python AutoFormatBuffer yapf
- " " Alternative: autocmd FileType python AutoFormatBuffer autopep8
- " augroup END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement