update better git mappings
This commit is contained in:
parent
b8a453bf48
commit
968b36b827
29
vimrc
29
vimrc
|
@ -483,9 +483,14 @@ let g:mta_filetypes = {
|
||||||
Plug 'studio-vx/wordpress.vim', { 'branch': 'universal-ctags' }
|
Plug 'studio-vx/wordpress.vim', { 'branch': 'universal-ctags' }
|
||||||
|
|
||||||
"}}}
|
"}}}
|
||||||
" #fugitive-vim{{{
|
" #vim-fugitive{{{
|
||||||
" https://github.com/tpope/vim-fugitive/blob/master/README.markdown
|
" https://github.com/tpope/vim-fugitive/blob/master/README.markdown
|
||||||
Plug 'tpope/vim-fugitive'
|
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{{{
|
" #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 dictionary+=/usr/share/dict/brit-a-z.txt,/usr/share/dict/britcaps.txt
|
||||||
set thesaurus+=/usr/share/dict/mthesaur.txt
|
set thesaurus+=/usr/share/dict/mthesaur.txt
|
||||||
|
|
||||||
|
set diffopt+=vertical
|
||||||
|
|
||||||
set tabstop=8
|
set tabstop=8
|
||||||
set softtabstop=2
|
set softtabstop=2
|
||||||
set shiftwidth=2
|
set shiftwidth=2
|
||||||
|
@ -1026,7 +1033,7 @@ nnoremap 0 ^
|
||||||
nnoremap <silent><space>cs :let @/=""<cr>
|
nnoremap <silent><space>cs :let @/=""<cr>
|
||||||
nnoremap : :setlocal norelativenumber<CR>:
|
nnoremap : :setlocal norelativenumber<CR>:
|
||||||
nnoremap <silent> <space>rc :so $MYVIMRC<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><expr> <space>nh (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n"
|
||||||
nnoremap <silent> <space>sl :set invlist<CR>
|
nnoremap <silent> <space>sl :set invlist<CR>
|
||||||
nnoremap <space>aa A<left>
|
nnoremap <space>aa A<left>
|
||||||
|
@ -1049,29 +1056,18 @@ nnoremap <space>dd :DD<CR>
|
||||||
nnoremap <space>bx :w\|bd<cr>
|
nnoremap <space>bx :w\|bd<cr>
|
||||||
" sync highlighting from start
|
" sync highlighting from start
|
||||||
nnoremap <silent><space>ss :syntax sync fromstart<CR>
|
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{{{
|
" terminal{{{
|
||||||
tnoremap <Esc> <C-\><C-n>
|
tnoremap <Esc> <C-\><C-n>
|
||||||
"}}}
|
"}}}
|
||||||
" git mappings {{{
|
" git mappings {{{
|
||||||
nnoremap <space>gs :Gstatus<CR>
|
" also see vim-fugitive plugin section
|
||||||
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>
|
||||||
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>gA :!clear; git add .; git status<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 :!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 :pedit | read ! echo 'git push'; git push<CR>
|
|
||||||
nnoremap <space>gl :Glog<CR>
|
|
||||||
|
|
||||||
"}}}
|
"}}}
|
||||||
" netrw {{{
|
" 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>
|
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 {{{
|
" brace/quotes completion {{{
|
||||||
|
|
Loading…
Reference in New Issue