Tom Carr wrote:
In particular, here's a solution:
map = :RightShift<cr>
com! -count=1 RightShift call RightShifter(<count>)
fun! RightShifter(cnt)
exe "norm! ".(3*a:cnt)."l"
endfun
That's an interesting hack, but there are a few problems with this solution:
* This only works correctly on the first line of the buffer. If I type 5= it
will execute :.,.+4RightShift which adds the current line into the count.
* In visual mode with :behave xterm it always moves 3 regardless of the count.
* In visual mode with :behave mswin it loses the visual mode.
Sorry -- misunderstood your first point. Looks like the count passed to
the function does get added in. Compensating for it:
map <silent> = :RightShift<cr>
com! -count=1 RightShift call RightShifter(<count>)
fun! RightShifter(cnt)
let cnt= a:cnt - a:firstline + 1
exe "norm! ".(3*cnt)."l"
endfun
Regards,
Chip Campbell