formatting

This commit is contained in:
ManjaroOne666 2018-03-29 00:03:11 +01:00
parent 0be5555df0
commit dc745898e1
1 changed files with 28 additions and 20 deletions

View File

@ -1,22 +1,31 @@
" key #mappings{{{ " key #mappings{{{
let mapleader = ' ' let mapleader = ' '
" miscallaneous
"{{{
nnoremap <silent> <space>rc :so $MYVIMRC<CR> nnoremap <silent> <space>rc :so $MYVIMRC<CR>
nnoremap <silent> <space>nn :set invrelativenumber<CR>
nnoremap <silent><expr> <space>nh (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n"
inoremap jk <esc>
nnoremap <silent> A :call CheckLineEnding()<CR>
nnoremap <space>co :!clear;
" Focus on current fold, close the rest " Focus on current fold, close the rest
nnoremap <silent> <space>zz zMzvzt nnoremap <silent> <space>zz zMzvzt
" replace current word with last yanked/deleted text " replace current word with last yanked/deleted text
nnoremap <silent> <space>rr "_diwP nnoremap <silent> <space>rr "_diwP
" replace current word with last yanked text " replace current word with last yanked text
nnoremap <silent> <space>ry diw"0P nnoremap <silent> <space>ry diw"0P
" 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>
" devdocs mapping
nnoremap <space>dd :DD<CR>
inoremap jk <esc> "}}}
nnoremap <silent> A :call CheckLineEnding()<CR>
nnoremap <space>co :!clear;
" git mappings
"{{{
nnoremap <space>gs :Gstatus<CR> nnoremap <space>gs :Gstatus<CR>
nnoremap <space>gd :Gdiff<CR> nnoremap <space>gd :Gdiff<CR>
nnoremap <space>gD :!clear; echo 'git diff'; git diff<CR> nnoremap <space>gD :!clear; echo 'git diff'; git diff<CR>
@ -24,17 +33,22 @@ nnoremap <space>ga :!clear; git add %; git status<CR>
nnoremap <space>gA :!clear; git add .; git status<CR> nnoremap <space>gA :!clear; git add .; git status<CR>
nnoremap <space>gc :Gcommit<CR> nnoremap <space>gc :Gcommit<CR>
nnoremap <space>gg :!clear; git add %; git commit -m ''<Left> nnoremap <space>gg :!clear; git add %; git commit -m ''<Left>
" nnoremap <space>gp :pedit | read ! echo 'git push'; git push<CR>
nnoremap <space>gp :!clear; echo 'git push'; git push<CR> nnoremap <space>gp :!clear; echo 'git push'; git push<CR>
" nnoremap <space>gp :terminal echo ':git push' & git push<CR>
" nnoremap <space>gp :Gpush<CR> " nnoremap <space>gp :Gpush<CR>
" nnoremap <space>gp :pedit | read ! echo 'git push'; git push<CR>
nnoremap <space>gl :Glog<CR> nnoremap <space>gl :Glog<CR>
"}}}
" netrw " netrw
"{{{
nnoremap <space>ex :Ex<CR> nnoremap <space>ex :Ex<CR>
nnoremap <space>ee :e .<CR> nnoremap <space>ee :e .<CR>
nnoremap <space>eq :Rex<CR> nnoremap <space>eq :Rex<CR>
"}}}
" better window navigaton " better window management
"{{{
nnoremap <C-h> <C-w>h nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l nnoremap <C-l> <C-w>l
nnoremap <C-k> <C-w>k nnoremap <C-k> <C-w>k
@ -45,8 +59,10 @@ nnoremap <Esc>k :resize +5<CR>
nnoremap <Esc>l :vertical resize +5<CR> nnoremap <Esc>l :vertical resize +5<CR>
nnoremap <Esc>h :vertical resize -5<CR> nnoremap <Esc>h :vertical resize -5<CR>
nnoremap <Esc>= <C-w>= nnoremap <Esc>= <C-w>=
"}}}
"location list and quickfix mappings "location list and quickfix mappings
"{{{
nnoremap <space>lo :botright lwindow<CR> nnoremap <space>lo :botright lwindow<CR>
nnoremap <up> :lprev<CR>zv nnoremap <up> :lprev<CR>zv
nnoremap <down> :lnext<CR>zv nnoremap <down> :lnext<CR>zv
@ -62,14 +78,10 @@ nnoremap <space>qc :cclose<CR>
nnoremap <space>qh :chistory<CR> nnoremap <space>qh :chistory<CR>
nnoremap <space>qp :colder<CR> nnoremap <space>qp :colder<CR>
nnoremap <space>qn :cnewer<CR> nnoremap <space>qn :cnewer<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 " brace/quotes completion
"{{{
inoremap {{ {}<left> inoremap {{ {}<left>
inoremap {<CR> {<CR>}<esc>O inoremap {<CR> {<CR>}<esc>O
inoremap {; {<CR>};<esc>O inoremap {; {<CR>};<esc>O
@ -87,12 +99,8 @@ inoremap '' ''<Left>
inoremap '; '';<Left><Left> inoremap '; '';<Left><Left>
inoremap ;; ;<esc> inoremap ;; ;<esc>
"}}}
nnoremap <silent> <space>nn :set invrelativenumber<CR>
nnoremap <silent><expr> <space>nh (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n"
" devdocs mapping
nnoremap <space>dd :DD<CR>
"}}} "}}}
" #abbreviations{{{ " #abbreviations{{{