Closed t9md closed 7 years ago
:+1: I think this is what I have been missing from occurrence, an easy way to visual select all occurrences rather than any other operation, I always got confused about and forgot about g (cmd)d
(isn't command d the default?). Also while on the topic, is there a way to 'make cursors at occurrence'? I guess now it'd just be s o <text-object> <esc>
?
What is your plan to replace s
for its current behaviour of "change character"? Or don't you ever use that?
👍 I think this is what I have been missing from occurrence, an easy way to visual select all occurrences rather than any other operation, I always got confused about and forgot about g (cmd)d (isn't command d the default?). Also while on the topic, is there a way to 'make cursors at occurrence'? I guess now it'd just be s o
?
I created set-cursor-at-start
etc, operator in local experiment but removed.
Here is it https://gist.github.com/t9md/c70f5d6528904601755422ae66124f26.
Why I removed is I thinks s o TARGET
then escape
is enough.
What is your plan to replace s for its current behaviour of "change character"? Or don't you ever use that?
I WILL replace default s
with select
operator by keymapSToSelect
conditional keymap.
It's opt-in config disabled by default, so not breaking default s
unless explicitly enabled it.
But I will of course enabled this in my config.
Also while on the topic, is there a way to 'make cursors at occurrence'? I guess now it'd just be
s o <text-object> <esc>
?
@jackcasey we already discussed this question here: #890. Maybe that will be helpful :)
Came up with idea while thinking for question in #890.
This PR expose
Select
operator as normal command.Select
operator is super essential operator for vim.visual-mode
.Select
operator is implicit operator used when text-object or motion is executed invisual-mode
, in other word, it's used in operation which move cursor invisual-mode
.v j
,j
is executed invisual-mode
.j
asSelect
operation with targetingj
motion.Why I haven't exposed this operator till now is, vmp's this part was not clean/consistent enough to expose user. Also I didn't understand for
select
operation clearly as I do now.g d
(select-occurrence
) keymap, :tada:keymapSToSelect
conditional keymap have enabled,s
is mapped toselect
operator,s o
is equivalent tog d
.(via conditional keymap)s O
to selectsubword-occurrence
.s p
to select paragraph, less keystroke thanv i p
.s
enteroperator-pending-mode
, thus user can usep
operator-pending-mode specific shorthand rather than normali p
.Changes summary.
visual-mode
is renamed fromSelect
toSelectInVisualMode
.Select
is normal operator which behave as in same way as other operator.Select
operator just select target then finish(normal operator start mutation after select).Select
andSelectInVisualMode
isSelectInVisualMode
does not autoAcceptpreset-occurrence
orpersistent-selection
so that user can modify selection without being interfered by pre-existingpersistent-selection
orpreset-occurrence
marker.