mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Show message like "Hunk 4 of 11" after hunk jumping
This commit is contained in:
@@ -162,6 +162,12 @@ nmap ]h <Plug>(GitGutterNextHunk)
|
|||||||
nmap [h <Plug>(GitGutterPrevHunk)
|
nmap [h <Plug>(GitGutterPrevHunk)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
When you jump between hunks, a message like `Hunk 4 of 11` is shown on the command line. If you want to turn the message off, you can use:
|
||||||
|
|
||||||
|
```viml
|
||||||
|
let g:gitgutter_show_msg_on_hunk_jumping = 0
|
||||||
|
```
|
||||||
|
|
||||||
You can load all your hunks into the quickfix list with `:GitGutterQuickFix`. Note this ignores any unsaved changes in your buffers. If the option `g:gitgutter_use_location_list` is set, this command will load hunks into the current window's location list instead.
|
You can load all your hunks into the quickfix list with `:GitGutterQuickFix`. Note this ignores any unsaved changes in your buffers. If the option `g:gitgutter_use_location_list` is set, this command will load hunks into the current window's location list instead.
|
||||||
|
|
||||||
You can stage or undo an individual hunk when your cursor is in it:
|
You can stage or undo an individual hunk when your cursor is in it:
|
||||||
|
|||||||
@@ -61,6 +61,9 @@ function! gitgutter#hunk#next_hunk(count) abort
|
|||||||
let hunk_count += 1
|
let hunk_count += 1
|
||||||
if hunk_count == a:count
|
if hunk_count == a:count
|
||||||
execute 'normal!' hunk[2] . 'Gzv'
|
execute 'normal!' hunk[2] . 'Gzv'
|
||||||
|
if g:gitgutter_show_msg_on_hunk_jumping
|
||||||
|
redraw | echo printf('Hunk %d of %d', index(hunks, hunk) + 1, len(hunks))
|
||||||
|
endif
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -86,6 +89,9 @@ function! gitgutter#hunk#prev_hunk(count) abort
|
|||||||
if hunk_count == a:count
|
if hunk_count == a:count
|
||||||
let target = hunk[2] == 0 ? 1 : hunk[2]
|
let target = hunk[2] == 0 ? 1 : hunk[2]
|
||||||
execute 'normal!' target . 'Gzv'
|
execute 'normal!' target . 'Gzv'
|
||||||
|
if g:gitgutter_show_msg_on_hunk_jumping
|
||||||
|
redraw | echo printf('Hunk %d of %d', index(hunks, hunk) + 1, len(hunks))
|
||||||
|
endif
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -308,6 +308,10 @@ Signs:~
|
|||||||
|g:gitgutter_sign_modified_removed|
|
|g:gitgutter_sign_modified_removed|
|
||||||
|g:gitgutter_set_sign_backgrounds|
|
|g:gitgutter_set_sign_backgrounds|
|
||||||
|
|
||||||
|
Hunk jumping:~
|
||||||
|
|
||||||
|
|g:gitgutter_show_msg_on_hunk_jumping|
|
||||||
|
|
||||||
Hunk previews:~
|
Hunk previews:~
|
||||||
|
|
||||||
|g:gitgutter_preview_win_floating|
|
|g:gitgutter_preview_win_floating|
|
||||||
@@ -524,6 +528,11 @@ Default: 0
|
|||||||
When switched on, the :GitGutterQuickFix command populates the location list
|
When switched on, the :GitGutterQuickFix command populates the location list
|
||||||
of the current window instead of the global quickfix list.
|
of the current window instead of the global quickfix list.
|
||||||
|
|
||||||
|
*g:gitgutter_show_msg_on_hunk_jumping*
|
||||||
|
Default: 1
|
||||||
|
|
||||||
|
When switched on, a message like "Hunk 4 of 11" is shown on hunk jumping.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
HIGHLIGHTS *gitgutter-highlights*
|
HIGHLIGHTS *gitgutter-highlights*
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ call s:set('g:gitgutter_async', 1)
|
|||||||
call s:set('g:gitgutter_log', 0)
|
call s:set('g:gitgutter_log', 0)
|
||||||
call s:set('g:gitgutter_use_location_list', 0)
|
call s:set('g:gitgutter_use_location_list', 0)
|
||||||
call s:set('g:gitgutter_close_preview_on_escape', 0)
|
call s:set('g:gitgutter_close_preview_on_escape', 0)
|
||||||
|
call s:set('g:gitgutter_show_msg_on_hunk_jumping', 1)
|
||||||
|
|
||||||
call s:set('g:gitgutter_git_executable', 'git')
|
call s:set('g:gitgutter_git_executable', 'git')
|
||||||
if !executable(g:gitgutter_git_executable)
|
if !executable(g:gitgutter_git_executable)
|
||||||
|
|||||||
Reference in New Issue
Block a user