nvim: Add function to easily work with jump list & access change list
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
parent
33148207ec
commit
b42d4cc7a7
1 changed files with 18 additions and 0 deletions
|
@ -195,6 +195,10 @@ inoremap <Esc> <Nop>
|
|||
cnoremap <Esc> <Nop>
|
||||
" Use Q to execute default register.
|
||||
nnoremap Q <Nop>
|
||||
" Jump and change list
|
||||
nnoremap <Leader>o :call GotoJump()<CR>
|
||||
nnoremap <Leader>; :changes<CR>:keepjumps norm g;<Left><Left>
|
||||
nnoremap <Leader>, :changes<CR>:keepjumps norm g,<Left><Left>
|
||||
|
||||
" For Fuzzy
|
||||
nnoremap <Leader>ff :GFiles<CR>
|
||||
|
@ -592,3 +596,17 @@ function! PrevHunkAllBuffers()
|
|||
endif
|
||||
endwhile
|
||||
endfunction
|
||||
|
||||
function! GotoJump()
|
||||
jumps
|
||||
let j = input("Please select your jump: ")
|
||||
if j != ''
|
||||
let pattern = '\v\c^\+'
|
||||
if j =~ pattern
|
||||
let j = substitute(j, pattern, '', 'g')
|
||||
execute "normal " . j . "\<C-i>"
|
||||
else
|
||||
execute "normal " . j . "\<C-o>"
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
|
Loading…
Reference in a new issue