" di-prompt - Prompt for a number after using [I, [D, ]I and ]D " Maintainer: Andreas Louv " Date: 01 Apr 2013 " List and jump to define and include " \022\027 is ^R^W (Pasting word under cursor) function! PromptAndExec(cmd) let ans = input('Type number and (empty cancels): ', '') if ans =~# '^\s*$' return endif silent execute 'normal! ' . printf(a:cmd, ans) . "\r" endfunction nnoremap [I [I:call PromptAndExec(":ijump! %d \022\027") nnoremap ]I ]I:call PromptAndExec(":+1,$ijump! %d \022\027") nnoremap [D [D:call PromptAndExec(":djump %d \022\027") nnoremap ]D ]D:call PromptAndExec(":+1,$djump %d \022\027")