Go to character #12898
Replies: 2 comments
-
So essentially what you are proposing is 2-character alternatives to I think that's a good idea. Instead of calling it Edit: I think these mappings make sense:
Edit2: Put out a PR for this. #12888 |
Beta Was this translation helpful? Give feedback.
-
Awesome, thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is coming from this post: https://www.reddit.com/r/HelixEditor/comments/1ipjmxx/best_way_to_extend_selection_to_character/
Take this code:
principal: EntityUid, #[default(entity_id("Action", "test-action"))] action: EntityUid
that's in the middle of a larger line. My cursor is atp
and I want to delete the macro.First, I need to jump to the
#
. I can do that withf#;
. Unlike Vim, I need an extra keystroke to clear the selection before starting a new selection. Next, I need to pressvta
then repeatedly pressAlt-.
There's a risk of overshooting, and I don't see a way to undo this, so I opened #12877.The other option is to use
gw
, but using it, waiting for the suggestions to come up, and then reading the label is slow (in the same line). Also,gw
would land my cursor at the end of action, so that means more keystrokes. For traversing in the same line, I prefer pressing w repeatedly.I'm proposing a
goto_character
option inside the goto menu. It will allow you to press two characters to go to unlikef
andt
s one character. It should also work withAlt-.
.Like other goto macros, it won't drag the selection with it unless you're in selection mode. Instead, it will select the two characters. With this, the above sequence becomes (I'm binding
goto_character
toc
)gc#[vgc] d
. Personally, I'd actually like to bind it tov
sincec
is taken (I didn't use it for the example since there's anotherv
in there).Alternatively, you could make a key in normal mode that drags the selection, just like
f
that selects on two characters. I prefer something in the goto menu it eliminates the keystroke to clear the character when starting at#
. Either way, you have to pressv
at the start of the selection because you might hit something incorrect that matches your two character pattern until #8761 is fixed.Beta Was this translation helpful? Give feedback.
All reactions