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.
These "problems" are due to out-of-scope use. You'd asked how to make a
nnoremap do something; these problems are all using the command mode to
which nnoremap doesn't apply.
The command I provided is not intended to take an address range; it
takes a count. Address range-using commands and count-using commands
are mutually exclusive, as the documentation states (:help command ,
then /Range handling).
Regards,
Chip Campbell