我用的是
```sh
alias vim='nvim'
alias vi='/usr/bin/vim'
```
" 映射 Ctrl+上下左右来切换窗口
nnoremap <silent><C-Right> :<C-u>wincmd l<CR>
nnoremap <silent><C-Left> :<C-u>wincmd h<CR>
nnoremap <silent><C-Up> :<C-u>wincmd k<CR>
nnoremap <silent><C-Down> :<C-u>wincmd j<CR>
if has('nvim')
tnoremap <silent><C-Right> <C-\><C-n>:<C-u>wincmd l<CR>
tnoremap <silent><C-Left> <C-\><C-n>:<C-u>wincmd h<CR>
tnoremap <silent><C-Up> <C-\><C-n>:<C-u>wincmd k<CR>
tnoremap <silent><C-Down> <C-\><C-n>:<C-u>wincmd j<CR>
tnoremap <silent><esc> <C-\><C-n>
endif
"for buftabs
noremap <silent><Leader>bp :bprev<CR>
noremap <silent><Leader>bn :bnext<CR>
"Quickly add empty lines
nnoremap <silent>[<space> :<c-u>put! =repeat(nr2char(10), v:count1)<cr>
nnoremap <silent>]<space> :<c-u>put =repeat(nr2char(10), v:count1)<cr>
"Use jk switch to normal model
inoremap jk <esc>
"]e or [e move current line ,count can be useed
nnoremap <silent>[e :<c-u>execute 'move -1-'. v:count1<cr>
nnoremap <silent>]e :<c-u>execute 'move +'. v:count1<cr>
"]<End> or ]<Home> move current line to the end or the begin of current buffer
nnoremap <silent>]<End> ddGp``
nnoremap <silent>]<Home> ddggP``
vnoremap <silent>]<End> dGp``
vnoremap <silent>]<Home> dggP``
"Ctrl+Shift+上下移动当前行
nnoremap <silent><C-S-Down> :m .+1<CR>==
nnoremap <silent><C-S-Up> :m .-2<CR>==
inoremap <silent><C-S-Down> <Esc>:m .+1<CR>==gi
inoremap <silent><C-S-Up> <Esc>:m .-2<CR>==gi
"上下移动选中的行
vnoremap <silent><C-S-Down> :m '>+1<CR>gv=gv
vnoremap <silent><C-S-Up> :m '<-2<CR>gv=gv
"background
noremap <silent><leader>bg :call ToggleBG()<CR>
"numbers
noremap <silent><leader>nu :call ToggleNumber()<CR>
" yark and paste
vmap <Leader>y "+y
vmap <Leader>d "+d
nmap <Leader>p "+p
nmap <Leader>P "+P
vmap <Leader>p "+p
vmap <Leader>P "+P
" Start new line
inoremap <S-Return> <C-o>o
" Improve scroll, credits:
https://github.com/Shougonnoremap <expr> zz (winline() == (winheight(0)+1) / 2) ?
\ 'zt' : (winline() == 1) ? 'zb' : 'zz'
noremap <expr> <C-f> max([winheight(0) - 2, 1])
\ ."\<C-d>".(line('w$') >= line('$') ? "L" : "H")
noremap <expr> <C-b> max([winheight(0) - 2, 1])
\ ."\<C-u>".(line('w0') <= 1 ? "H" : "L")
noremap <expr> <C-e> (line("w$") >= line('$') ? "j" : "3\<C-e>")
noremap <expr> <C-y> (line("w0") <= 1 ? "k" : "3\<C-y>")
" Select blocks after indenting
xnoremap < <gv
xnoremap > >gv|
" Use tab for indenting in visual mode
xnoremap <Tab> >gv|
xnoremap <S-Tab> <gv
nnoremap > >>_
nnoremap < <<_
" smart up and down
nnoremap <silent><Down> :normal! gj<cr>
nnoremap <silent><Up> :normal! gk<cr>
" Select last paste
nnoremap <silent><expr> gp '`['.strpart(getregtype(), 0, 1).'`]'
" Disable Q and gQ
nnoremap Q <Nop>
nnoremap gQ <Nop>
" Navigate window
nnoremap <silent><C-q> <C-w>
nnoremap <silent><C-x> <C-w>x
" Navigation in command line
cnoremap <C-a> <Home>
cnoremap <C-b> <Left>
cnoremap <C-f> <Right>
" When pressing <leader>cd switch to the directory of the open buffer
" map <Leader>cd :cd %:p:h<CR>:pwd<CR> "I use <Plug>RooterChangeToRootDirectory
" Fast saving
nnoremap <Leader>w :w<CR>
vnoremap <Leader>w <Esc>:w<CR>
nnoremap <C-s> :<C-u>w<CR>
vnoremap <C-s> :<C-u>w<CR>
cnoremap <C-s> <C-u>w<CR>
" Toggle editor visuals
nmap <Leader>ts :setlocal spell!<cr>
nmap <Leader>tn :setlocal nonumber! norelativenumber!<CR>
nmap <Leader>tl :setlocal nolist!<CR>
nmap <Leader>th :nohlsearch<CR>
nmap <Leader>tw :setlocal wrap! breakindent!<CR>
" Tabs
nnoremap <silent>g0 :<C-u>tabfirst<CR>
nnoremap <silent>g$ :<C-u>tablast<CR>
nnoremap <silent>gr :<C-u>tabprevious<CR>
" Remove spaces at the end of lines
nnoremap <silent> ,<Space> :<C-u>silent! keeppatterns %substitute/\s\+$//e<CR>
" C-r: Easier search and replace
xnoremap <C-r> :<C-u>call VSetSearch('/')<CR>:%s/\V<C-R>=@/<CR>//gc<Left><Left><Left>
" Location list movement
nmap <silent><Leader>lj :lnext<CR>
nmap <silent><Leader>lk :lprev<CR>
nmap <silent><Leader>lq :lclose<CR>
" quickfix list movement
nmap <silent><Leader>qj :cnext<CR>
nmap <silent><Leader>qk :cprev<CR>
nmap <silent><Leader>qq :cclose<CR>
" Duplicate lines
nnoremap <Leader>d m`YP``
vnoremap <Leader>d YPgv