On 03/12/12 08:16, Dotan Cohen wrote:
On Mon, Mar 12, 2012 at 14:18, Tim Chase<[email protected]>  wrote:
While an odd request, is there something I'm missing about just doing

  :nnoremap ii hi

And of course, by this I mean "nnoremap ii h" :-)

I have no problem waiting for the limeoutlen to time out, I already
use that for other movements. The problem with the mapping that you
mention is that one must press ii for an equivalent h, so moving four
spaces to the left requires iiiiiiiii. I could get used to pressing
4ii to move four spaces back though.

I suppose you could make an expression mapping to a function something like

function! IorH()
    let l:count=0
    let l:c=nr2char(getchar())
    while l:c == 'i'
        let l:count += 1
        let l:c=nr2char(getchar())
    endwhile
    return (l:count?(repeat('h', l:count)):'i').(l:c)
endfunction
nnoremap <expr> i IorH()

It feels a little weird using it since it lags by one character while you're in this sub-mode, but it seems to do what you describe.

-tim



--
You received this message from the "vim_use" 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

Reply via email to