103 lines
2.5 KiB
VimL
103 lines
2.5 KiB
VimL
" key #mappings{{{
|
|
|
|
nnoremap <space>rc :so $MYVIMRC<CR>
|
|
|
|
" Focus on current fold, close the rest
|
|
nnoremap <space>zz zMzvzt
|
|
|
|
" replace current word with last yanked/deleted text
|
|
nnoremap <space>rr "_diwP
|
|
" replace current word with last yanked text
|
|
nnoremap <space>ry diw"0P
|
|
|
|
inoremap jk <esc>
|
|
|
|
nnoremap A :call CheckLineEnding()<CR>
|
|
|
|
nnoremap <space>co :!clear;
|
|
|
|
nnoremap <space>gs :!clear; echo 'git status'; git status<CR>
|
|
nnoremap <space>gd :!clear; echo 'git diff'; git diff<CR>
|
|
nnoremap <space>ga :!clear; git add %; git status<CR>
|
|
nnoremap <space>gA :!clear; git add .; git status<CR>
|
|
nnoremap <space>gc :!clear; git commit -m ''<Left>
|
|
nnoremap <space>gg :!clear; git add %; git commit -m ''<Left>
|
|
nnoremap <space>gp :!clear; echo 'git push'; git push<CR>
|
|
nnoremap <space>gl :!clear; git log<CR>
|
|
|
|
" netrw
|
|
nnoremap <space>ex :Ex<CR>
|
|
nnoremap <space>ee :e .<CR>
|
|
nnoremap <space>eq :Rex<CR>
|
|
|
|
" better window navigaton
|
|
nnoremap <C-h> <C-w>h
|
|
nnoremap <C-l> <C-w>l
|
|
nnoremap <C-k> <C-w>k
|
|
nnoremap <C-j> <C-w>j
|
|
|
|
nnoremap <Esc>j :resize -5<CR>
|
|
nnoremap <Esc>k :resize +5<CR>
|
|
nnoremap <Esc>l :vertical resize +5<CR>
|
|
nnoremap <Esc>h :vertical resize -5<CR>
|
|
nnoremap <Esc>= <C-w>=
|
|
|
|
"location list and quickfix mappings
|
|
nnoremap <space>lo :botright lwindow<CR>
|
|
nnoremap <space>lp :lprev<CR>zv
|
|
nnoremap <space>ln :lnext<CR>zv
|
|
nnoremap <space>lc :lclose<CR>
|
|
nnoremap <space>lh :lhistory<CR>
|
|
nnoremap <space>lhp :lolder<CR>
|
|
nnoremap <space>lhn :lnewer<CR>
|
|
|
|
nnoremap <space>qo :botright cwindow<CR>
|
|
nnoremap <space>qp :cprev<CR>zv
|
|
nnoremap <space>qn :cnext<CR>zv
|
|
nnoremap <space>qc :cclose<CR>
|
|
nnoremap <space>qh :chistory<CR>
|
|
nnoremap <space>qhp :colder<CR>
|
|
nnoremap <space>qhn :cnewer<CR>
|
|
|
|
nnoremap <space>nh :noh<CR>
|
|
|
|
" quick grep of visual selection
|
|
vnoremap <space>gr y:grep! -R <C-r>" .
|
|
|
|
" open quickfix window of TODOs
|
|
nnoremap <space>td :grep! -R '// *TODO' .<CR>:botright cwindow<CR>:echo len(getqflist()) 'TODOs'<CR>
|
|
|
|
" brace/quotes completion
|
|
inoremap {{ {}<left>
|
|
inoremap {<CR> {<CR>}<esc>O
|
|
inoremap {; {<CR>};<esc>O
|
|
inoremap }} {{}}<Left><Left>
|
|
|
|
inoremap (( ()<Left>
|
|
inoremap (; ();<Left><Left>
|
|
|
|
inoremap [[ []<Left>
|
|
inoremap [<CR> [<CR>]<esc>O
|
|
|
|
inoremap "" ""<Left>
|
|
inoremap "; "";<Left><Left>
|
|
inoremap '' ''<Left>
|
|
inoremap '; '';<Left><Left>
|
|
|
|
inoremap ;; ;<esc>
|
|
|
|
nnoremap <space>nn :set invrelativenumber<CR>
|
|
nnoremap <space>hl :nohlsearch<CR>
|
|
|
|
" devdocs mapping
|
|
nnoremap <space>dd :DD<CR>
|
|
"}}}
|
|
|
|
" #abbreviations{{{
|
|
iabbrev adn and
|
|
iabbrev waht what
|
|
iabbrev tehn then
|
|
"}}}
|
|
|
|
" vim: foldmethod=marker
|