From 364b68475731eee662bd9e854d585511d1915208 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Sun, 29 Oct 2017 11:35:05 -0500 Subject: [PATCH] [vim] tweak vimrc https://dougblack.io/words/a-good-vimrc.html --- .gitmodules | 3 ++ .vim/pack/alpha/start/gundo.vim | 1 + .vimrc | 49 ++++++++++++++++++++++++++------- 3 files changed, 43 insertions(+), 10 deletions(-) create mode 160000 .vim/pack/alpha/start/gundo.vim diff --git a/.gitmodules b/.gitmodules index c61b0fe..9f52cb7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -103,3 +103,6 @@ [submodule ".vim/pack/alpha/start/rainbow"] path = .vim/pack/alpha/start/rainbow url = git@github.com:luochen1990/rainbow.git +[submodule ".vim/pack/alpha/start/gundo.vim"] + path = .vim/pack/alpha/start/gundo.vim + url = git@github.com:sjl/gundo.vim.git diff --git a/.vim/pack/alpha/start/gundo.vim b/.vim/pack/alpha/start/gundo.vim new file mode 160000 index 0000000..46c443e --- /dev/null +++ b/.vim/pack/alpha/start/gundo.vim @@ -0,0 +1 @@ +Subproject commit 46c443ee9d5854320eb965a1fdee781ba83a070e diff --git a/.vimrc b/.vimrc index 28d904a..4b41b72 100644 --- a/.vimrc +++ b/.vimrc @@ -1,4 +1,6 @@ -""" Mappings +" vim:foldmethod=marker:foldlevel=0 + +" Mappings {{{ let mapleader="\" @@ -15,12 +17,16 @@ nnoremap / :nohlsearch " don't unindent lines starting with # inoremap # X# -""" Commands +" }}} + +" Commands {{{ set undolevels=1000 set wildmode=list:longest,full -""" Display +"}}} + +" Display {{{ set background=dark let g:solarized_termcolors=256 @@ -29,6 +35,8 @@ set background=dark fun! s:highlight() highlight Normal ctermbg=235 + highlight CursorLine ctermbg=236 + highlight MatchParen ctermbg=238 endfun augroup MyHighlight @@ -40,22 +48,27 @@ call s:highlight() " highlight LongLine term=reverse cterm=reverse ctermfg=1 guifg=Black guibg=Yellow " match LongLine /\%101v./ -set foldlevelstart=4 +set foldlevelstart=6 +set foldmethod=indent set linebreak set list let &listchars="tab:\u21e5 ,trail:\u2423,extends:\u21c9,precedes:\u21c7,nbsp:\u00b7" set number -" set ttyfast +set ttyfast set splitbelow set splitright +set lazyredraw +" only show cursorline in current window augroup CursorLine au! au VimEnter,WinEnter,BufWinEnter * setlocal cursorline au WinLeave * setlocal nocursorline augroup END -""" Editing +" }}} + +" Editing {{{ " set hidden if !has("nvim") @@ -86,7 +99,9 @@ augroup netrw_buf_hidden_fix \| endif augroup end -""" GUI +" }}} + +" GUI {{{ if has("gui_running") set background=light @@ -102,7 +117,9 @@ if !has("nvim") endif set mousehide -""" Persistence +" }}} + +" Persistence {{{ set directory=~/.vim_tmp set encoding=utf8 @@ -112,13 +129,17 @@ set nobackup set undodir=~/.vim_undo set undofile -""" Search +" }}} + +" Search {{{ set gdefault set hlsearch set smartcase -""" Plugins +" }}} + +" Plugins {{{ " incsearch let g:incsearch#auto_nohlsearch = 1 @@ -151,3 +172,11 @@ if isdirectory('/usr/local/opt/fzf') nmap f :Files nmap t :Tags endif + +" rainbow +let g:rainbow_active = 0 + +" gundo +nnoremap u :GundoToggle + +" }}}