nvim: keymappings: Add enhanced helper for ijump
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
parent
76017dc434
commit
fd606aa465
1 changed files with 14 additions and 0 deletions
|
@ -173,3 +173,17 @@ inoremap <silent><expr> <TAB>
|
|||
" Asynchronous make
|
||||
command! -bang -nargs=* -complete=file Make call asyncdo#run(<bang>0, &makeprg, <f-args>)
|
||||
command! -bang -nargs=* -complete=file LMake call asyncdo#lrun(<bang>0, &makeprg, <f-args>)
|
||||
|
||||
nnoremap [i [I:call <SID>PromptAndExec(":ijump! %d \022\027\015")<CR>
|
||||
nnoremap ]i ]I:call <SID>PromptAndExec(":+1,$ijump! %d \022\027\015")<CR>
|
||||
|
||||
function! s:PromptAndExec(cmd) abort
|
||||
let ans = input('Type number and <Enter> (empty cancels): ')
|
||||
|
||||
if ans !~# '^\s*$'
|
||||
try
|
||||
silent execute 'normal! ' . printf(a:cmd, ans)
|
||||
catch /E387/ "E387: Match is on current line
|
||||
endtry
|
||||
endif
|
||||
endfunction
|
||||
|
|
Loading…
Reference in a new issue