| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- if filereadable("/usr/share/vim/google/google.vim")
- source /usr/share/vim/google/google.vim
- endif
- " Welcome to Vim (http://go/vim).
- " Plugin configuration.
- " See http://google3/devtools/editors/vim/examples/ for example configurations
- " and http://go/vim/plugins for more information about vim plugins at Google.
- " Plugin loading is commented out below - uncomment the plugins you'd like to
- " load.
- " Load google's formatting plugins (http://go/vim/plugins/codefmt-google).
- " The default mapping is \= (or <leader>= if g:mapleader has a custom value),
- " with
- " - \== formatting the current line or selected lines in visual mode
- " (:FormatLines).
- " - \=b formatting the full buffer (:FormatCode).
- "
- " To bind :FormatLines to the same key in insert and normal mode, add:
- " noremap <C-K> :FormatLines<CR>
- " inoremap <C-K> <C-O>:FormatLines<CR>
- "Glug codefmt plugin[mappings] gofmt_executable="goimports"
- "Glug codefmt-google
- " Enable autoformatting on save for the languages at Google that enforce
- " formatting, and for which all checked-in code is already conforming (thus,
- " autoformatting will never change unrelated lines in a file).
- " Note formatting changed lines only isn't supported yet
- " (see https://github.com/google/vim-codefmt/issues/9).
- "augroup autoformat_settings
- " autocmd FileType bzl AutoFormatBuffer buildifier
- " autocmd FileType go AutoFormatBuffer gofmt
- " See go/vim/plugins/codefmt-google, :help codefmt-google and :help codefmt
- " for details about other available formatters.
- "augroup END
- " Load YCM (http://go/ycm) for semantic auto-completion and quick syntax
- " error checking. Pulls in a google3-enabled version of YCM itself and
- " a google3-specific default configuration.
- "Glug youcompleteme-google
- " Load the automated blaze dependency integration for Go.
- " Note: for Go, blazedeps uses the Go team's glaze tool, which is fully
- " supported by the Go team. The plugin is currently unsupported for other
- " languages.
- "Glug blazedeps auto_filetypes=`['go']`
- " Load piper integration (http://go/VimPerforce).
- "Glug piper plugin[mappings]
- " Load Critique integration. Use :h critique for more details.
- "Glug critique plugin[mappings]
- " Load blaze integration (http://go/blazevim).
- "Glug blaze plugin[mappings]
- " Load the syntastic plugin (http://go/vim/plugins/syntastic-google).
- " Note: this requires installing the upstream syntastic plugin from
- " https://github.com/vim-syntastic/syntastic.
- "Glug syntastic-google
- " Load the ultisnips plugin (http://go/ultisnips).
- " Note: this requires installing the upstream ultisnips plugin from
- " https://github.com/SirVer/ultisnips.
- "Glug ultisnips-google
- " All of your plugins must be added before the following line.
- " See go/vim-plugin-manager if you need help picking a plugin manager and
- " setting it up.
- set vb t_vb=
- set backspace=indent,eol,start
- set incsearch
- set smartcase
- set ignorecase
- set hlsearch
- set nowrapscan
- set nowrap
- set scrolloff=5
- set sidescroll=1
- set sidescrolloff=10
- set tabstop=4
- set shiftwidth=4
- set wildmode=longest:list
- set background=dark
- set spelllang=en_us
- set foldminlines=2
- set foldlevelstart=1
- set foldnestmax=2
- set foldmethod=syntax
- set modeline
- set keywordprg=man\ -s
- set mouse=
- set linebreak
- set formatoptions-=o
- set ruler
- set laststatus=1
- set nojoinspaces
- set fileformats=unix,dos,mac
- set t_Co=256
- set completeopt=menuone
- set tags=tags;
- set backupdir=$HOME/.vim_swap//,/tmp
- set directory=$HOME/.vim_swap//,/tmp
- set guicursor=
- map <ESC>u :nohlsearch<CR>
- map j gj
- map k gk
- map Q ZQ
- map H za
- map \l :w<CR>:make<CR>
- map - $
- map _ ct_
- map <C-n> gt
- map <C-p> gT
- map <C-h> :AS<CR>
- nmap <Tab> :set expandtab!<CR>:set expandtab?<CR>
- nmap <Insert> :set paste!<CR>:set paste?<CR>
- nmap <C-j> :lnext<cr>
- nmap <C-k> :lprevious<cr>
- vmap P "_dP
- inoremap <C-d> <C-t>
- inoremap <C-a> <C-d>
- let g:mundo_prefer_python3 = 1
- nnoremap U :MundoToggle<CR>
- let g:syntastic_python_checkers = ['pyflakes']
- let g:syntastic_always_populate_loc_list = 1
- let g:syntastic_auto_loc_list = 1
- let g:syntastic_check_on_open = 0
- let g:syntastic_check_on_wq = 0
- let g:syntastic_mode_map = {'mode': 'passive', 'active_filetypes': [], 'passive_filetypes': []}
- let g:syntastic_enable_signs = 0
- nmap <F11> :SyntasticCheck<cr>
- nmap <F12> :SyntasticReset<cr>
- let g:ctrlp_map = '<c-o>'
- let g:ctrlp_match_func = {'match': 'pymatcher#PyMatch'}
- let g:rust_recommended_style = 0
- let g:rust_fold = 1
- filetype plugin indent on
- syntax on
- highlight Folded ctermbg=black
- highlight Todo ctermbg=none ctermfg=lightcyan
- " for ft=gitcommit
- highlight DiffRemoved ctermfg=red cterm=bold
- highlight DiffAdded ctermfg=green cterm=bold
- " for vimdiff
- highlight DiffAdd ctermfg=black ctermbg=green
- highlight DiffDelete ctermfg=black ctermbg=red
- highlight DiffChange ctermbg=darkgray
- highlight DiffText ctermfg=black ctermbg=yellow
- au BufNewFile,BufRead *.frag,*.vert,*.fp,*.vp,*.glsl setf glsl
- au BufNewFile,BufRead *.jinja2 set ft=htmldjango
- au BufNewFile,BufRead *.ccss set ft=clevercss
- au BufNewFile,BufRead *.pp set ft=puppet foldmethod=indent
- autocmd FileType c,cpp,perl,php,java,glsl set cindent foldmethod=syntax
- autocmd FileType python set autoindent foldmethod=indent
- autocmd FileType ruby set foldmethod=indent foldnestmax=4
- autocmd FileType sh set autoindent foldmethod=syntax
- autocmd FileType go set foldmethod=syntax foldlevel=0 foldnestmax=1
- autocmd FileType javascript,less,html set foldnestmax=3 formatoptions-=o
- autocmd FileType javascript,less set foldmethod=indent
- autocmd FileType tex,latex set wrap showbreak=+ spell makeprg=pdflatex\ -interaction=nonstopmode\ %
- autocmd FileType tf set foldmethod=indent foldlevel=0
- autocmd FileType html,htmldjango,sml set autoindent
- autocmd FileType man set nomod nolist readonly
- autocmd FileType man map q :q<CR>
- autocmd FileType diff map H zA
- autocmd FileType diff map L za
- autocmd FileType bzl set foldmethod=indent foldnestmax=3 foldlevel=2
- autocmd FileType proto set foldmethod=syntax
- autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
- autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif
|