2
1
In my text editor, I would like to define a keyboard shortcut (say, CTRL-D
) with "delete until character is found" functionality. For example, if the cursor is placed before the "H" of this text:
Here comes the colon:Did you see it?
and you press CTRL-D
followed by :
, then the text should change to
Did you see it?
just as if you had pressed the Delete button 21 times. (Note that the colon is deleted as well.)
If the character isn't found in the edited text (for instance, if you type CTRL-D
followed by x
in the above example) I would prefer that nothing happens, but this is not very important. My current text editor is Notepad++, but feel free to suggest solutions involving other editors.
For text on just a single line? – iglvzx – 2012-03-28T20:02:26.460
2If you were using vim, it would be
dt:
(Delete To colon) ordf:
(Delete until Find colon). The latter deletes the colon, the former doesn't. However, you aren't using vim, so this is just a passing comment, not an answer. – RedGrittyBrick – 2012-03-28T20:55:12.507@iglvzx I was having "for a single line" in mind, but "for entire remaining text" is also good enough. – user12816 – 2012-04-01T11:39:43.603