Replies: 2 comments
-
One edge case that seems impossible without a "backward-exclusive" motion (current
resulting in
That is, targeting an empty line, but not as a linewise motion. Not terribly frequent, and probably doesn't matter much in practice, but an annoying, ugly gap nevertheless. |
Beta Was this translation helpful? Give feedback.
-
Proposal no. 2: Use evil-snipe's arrangement (basically just switch our
Note: vim-seek also uses x/X the same way. "Exclusive" is definitely the most obvious mnemonic for these keys, it's hard to argue with that. I've also grown to like evil-snipe's "end-inclusive" |
Beta Was this translation helpful? Give feedback.
-
My proposal is really simple. In Visual and Operator-pending mode:
x
= currentx
X
= currentZ
That is,
If you have the default keymaps already set, you can try this out with:
Pro
z/Z/x/X
.vz
=vx
makes it even more awkward. I think this is the most important point and the strongest argument in favor of rethinking the current arrangement.Why keep the "inclusive" pair?
forward/+1/inclusive
can extend selections till EOL, i.e., it is always applicable, whileforward/+0
is not. Symmetry is also an advantage. For example, you would select a rectangular block from the top-left and the bottom-right corner using the same pair./?
, but since the pattern length is fixed, it is just as, if not more intuitive to think about the matches as solid chunks, and include them in the selection.Cons
/?
also has its logic.x/X
anymore (not even the "geometric" one on QWERTY, i.e., being the right neighbour ofz/Z
).Regarding the choice of
x/X
:Pro
x/X
do not conflict with (n)vim-surround at all, even in Visual mode (yay!). (Also, visual surround can uses
/S
instead of its defaultgs
/S
, and can be fully consistent, since we're taking over the natives/S
anyway.)Con
x
instead ofd
for visual deletion.Fact
z
cannot be used in Visual mode (native fold operations).s
cannot really be used in operator-pending mode (surround plugins use it, and rightly so). Sox
remains.Beta Was this translation helpful? Give feedback.
All reactions