On Oct 14, 4:33 am, Sergii Boiko <[email protected]> wrote:
> Ingo, thanks for positive comment. Because i'm switching to dvorak and
> 'f' isn't so useful at this layout as 't'. And this behaviour very
> annoys me, because 't' is not so handy as 'f'.
>
> I don't know vim-script very well to write some prototype, but if
> someone takes care of it, i will test it thoroughly.
>
Here's a quick proof-of-concept, for the ';' command only. It may fail
in some situations. I couldn't get it working right in visual mode:
nnoremap ; :<C-U>call DoubleJumpIfNoMove(v:count1)<CR>
onoremap ; v:<C-U>call DoubleJumpIfNoMove(v:count1)<CR>
fun! DoubleJumpIfNoMove(count)
if a:count==1
let curpos=getpos('.')
normal! ;
if curpos==getpos('.')
normal! 2;
else
normal! ;
endif
else
exec 'normal! '.a:count.';'
endif
endfun
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php