vis icon indicating copy to clipboard operation
vis copied to clipboard

Cannot repeat shift with .

Open donaldcallen opened this issue 1 month ago • 5 comments

Problem

If you select multiple lines with shift-v and then j, pressing < produces the expected left shift. But trying to repeat the shift with '.' fails -- nothing happens. The same is true of >.

Steps to reproduce

No response

vis version (vis -v)

vis 0.9 +curses +lua +tre +ac

Terminal name/version

No response

$TERM environment variable

No response

donaldcallen avatar Nov 27 '25 14:11 donaldcallen

The question is whether left shift should be included in the operations covered by dot-repeat. Does manpage says anything about this? Which operations are covered by nvi/Berkeley-vi?

@rnpnr any thoughts?

mcepl avatar Nov 28 '25 02:11 mcepl

Its a bug in my view. I find it quite annoying that doing this exact operation (specifically <) clears the selection and is not repeatable. Re-indenting a block of code is a very common operation and this is the most obvious way to do it. Note that it if you select in parentheses (e.g. vi{) and then use < the selection does not clear but . doesn't work.

Conceptually I don't see why 'repeat the last editor command' wouldn't apply to </>.

rnpnr avatar Nov 28 '25 02:11 rnpnr

This works in vim and nvim and is extremely useful.

The dot command is defined as repeating changes (see vim and nvim docs and :help). Shifting in either direction is a change.

donaldcallen avatar Nov 28 '25 03:11 donaldcallen

Having this change repeatable is very useful (at least in my work flow) and also more consistent (as all other changes seem to be repeatable using .).

I'm also in favor of changing the behavior (or is it fixing a bug?) in this case.

Shugyousha avatar Nov 29 '25 08:11 Shugyousha

Yeah, I feel persuaded. It is a bug.

mcepl avatar Dec 01 '25 09:12 mcepl