Last active
May 31, 2021 18:50
-
-
Save ambuc/9ee68347c01bbc3e8af042deb190824f to your computer and use it in GitHub Desktop.
.vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" My ~/.vimrc. | |
" 2014 - present | |
" james.adam.buckland@gmail.com | |
" | |
" Notes | |
" * Activate fuzzy finder with ctrl-p. | |
" * After modifying plugins, call `:PluginInstall`. | |
" * Reload from Vimwith ":so %". | |
" * Try to keep it "literate". | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" For color scheme manipulation, see "Color scheme" below. | |
Plugin 'chriskempson/base16-vim' | |
" Necessary prereq for other plugins. See https://github.com/google/vim-maktaba. | |
Plugin 'google/vim-maktaba' | |
" Configuring maktaba plugins. See https://github.com/google/vim-glaive | |
Plugin 'google/vim-glaive' | |
" Standard code formatting. See https://github.com/google/vim-codefmt | |
Plugin 'google/vim-codefmt' | |
" Fuzzy finder. See https://github.com/kien/ctrlp.vim | |
Plugin 'kien/ctrlp.vim' | |
call vundle#end() | |
call glaive#Install() | |
" Color scheme | |
let base16colorspace=256 | |
if filereadable(expand("~/.vimrc_background")) | |
let base16colorspace=256 | |
source ~/.vimrc_background | |
colorscheme base16-default-dark | |
endif | |
set background=dark | |
set colorcolumn=0 " set colorcolumn=+1 | |
" Color scheme > Prevent burn-in | |
" http://vimdoc.sourceforge.net/htmldoc/syntax.html#coloring | |
highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE | |
highlight StatusLine term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE | |
highlight StatusLineNC term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE | |
highlight TabLine term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE | |
highlight TabLineFill term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE | |
highlight TabLineSel term=bold cterm=NONE ctermfg=Grey ctermbg=NONE | |
highlight VertSplit term=bold cterm=NONE ctermfg=Black ctermbg=NONE | |
" Remaps > Tmux-style navigation for panels. | |
nnoremap <C-H> <C-W><C-H> | |
nnoremap <C-J> <C-W><C-J> | |
nnoremap <C-K> <C-W><C-K> | |
nnoremap <C-L> <C-W><C-L> | |
" Remaps > Assorted | |
map <space> viw | |
nnoremap ; : | |
noremap zz :let &scrolloff=999-&scrolloff<CR> | |
" Misc Settings | |
cabbrev help tab help | |
filetype plugin indent on | |
set autoindent | |
set autoread | |
set expandtab | |
set hidden | |
set hlsearch incsearch | |
set ignorecase smartcase | |
set laststatus=2 | |
set matchpairs+=<:> | |
set mouse= | |
set number | |
set scrolloff=999 | |
set shiftwidth=2 | |
set showcmd | |
set showtabline=2 | |
set smartindent | |
set softtabstop=2 | |
set t_ut= | |
set tabpagemax=25 | |
set tabstop=2 | |
set textwidth=80 | |
set wildmenu | |
set wildmode=list:longest,full | |
syntax enable | |
" Undo logic | |
set undodir=$HOME/.vim/undo | |
set undofile | |
set undolevels=100 | |
set undoreload=1000 | |
" Autoformat settings. | |
" Uncomment as needed. | |
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,sass,scss,less,json AutoFormatBuffer js-beautify | |
" autocmd FileType java AutoFormatBuffer google-java-format | |
autocmd FileType python AutoFormatBuffer yapf | |
" autocmd FileType python AutoFormatBuffer autopep8 | |
augroup END | |
" Protobuffer ".proto" filetype maniuplation. | |
" from https://github.com/protocolbuffers/protobuf/blob/master/editors/proto.vim | |
augroup filetype | |
au! BufRead,BufNewFile *.proto setfiletype proto | |
augroup end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment