update better git mappings

This commit is contained in:
ManjaroOne666 2018-11-25 19:32:05 +00:00
parent b8a453bf48
commit 968b36b827
1 changed files with 15 additions and 14 deletions

29
vimrc
View File

@ -483,9 +483,14 @@ let g:mta_filetypes = {
Plug 'studio-vx/wordpress.vim', { 'branch': 'universal-ctags' }
"}}}
" #fugitive-vim{{{
" #vim-fugitive{{{
" https://github.com/tpope/vim-fugitive/blob/master/README.markdown
Plug 'tpope/vim-fugitive'
command! GdiffInTab tabedit %|Gdiff
nnoremap <space>gs :Gstatus<CR>
nnoremap <space>gd :GdiffInTab<CR>
nnoremap <space>gc :Gcommit<CR>
nnoremap <space>gl :Glog<CR>
"}}}
" #vim-git{{{
@ -974,6 +979,8 @@ set spelllang=en_gb
set dictionary+=/usr/share/dict/brit-a-z.txt,/usr/share/dict/britcaps.txt
set thesaurus+=/usr/share/dict/mthesaur.txt
set diffopt+=vertical
set tabstop=8
set softtabstop=2
set shiftwidth=2
@ -1026,7 +1033,7 @@ nnoremap 0 ^
nnoremap <silent><space>cs :let @/=""<cr>
nnoremap : :setlocal norelativenumber<CR>:
nnoremap <silent> <space>rc :so $MYVIMRC<CR>
nnoremap <silent> <space>nn :set invrelativenumber<CR>
nnoremap <silent> <space>nn :setlocal invrelativenumber<CR>
nnoremap <silent><expr> <space>nh (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n"
nnoremap <silent> <space>sl :set invlist<CR>
nnoremap <space>aa A<left>
@ -1049,29 +1056,18 @@ nnoremap <space>dd :DD<CR>
nnoremap <space>bx :w\|bd<cr>
" sync highlighting from start
nnoremap <silent><space>ss :syntax sync fromstart<CR>
" Chain multiple path completions with / key. Selects the first suggestion if
" no current selection. Use ctrl-y to finish completion as normal.
inoremap <expr> / pumvisible()
\ ? len(v:completed_item) ? '<C-Y><C-X><C-F>' : '<C-N><C-Y><C-X><C-F>'
\ : '/'
"}}}
" terminal{{{
tnoremap <Esc> <C-\><C-n>
"}}}
" git mappings {{{
nnoremap <space>gs :Gstatus<CR>
nnoremap <space>gd :Gdiff<CR>
" also see vim-fugitive plugin section
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 :Gcommit<CR>
nnoremap <space>gg :!clear; git add %; git commit -m ''<Left>
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 :pedit | read ! echo 'git push'; git push<CR>
nnoremap <space>gl :Glog<CR>
"}}}
" netrw {{{
@ -1112,6 +1108,11 @@ inoremap jkrg <c-o>:reg<cr>
inoremap :w<cr> :w<cr>
inoremap [:w<cr> :w<cr>
inoremap {:w<cr> :w<cr>
" Chain multiple path completions with / key. Selects the first suggestion if
" no current selection. Use ctrl-y to finish completion as normal.
inoremap <expr> / pumvisible()
\ ? len(v:completed_item) ? '<C-Y><C-X><C-F>' : '<C-N><C-Y><C-X><C-F>'
\ : '/'
"}}}
" brace/quotes completion {{{