I don’t know if this exists but I would like to have the equivalent of Shift+ Alt + Up|Down which duplicates the line up or down, but horizontally with the text selected.
For example, let’s consider this program:
print("Hello world")
If the selected text is Hello world
and I do the shortcut it will give something like:
print("Hello worldHello world")
Basically, it would ideally be Shift+ Alt + Right|Left but this shortcut doesn’t do that.
2
Answers
use extension multi-command
Define the following key bindings
Here is how to do the paste to the right repeatedly. You will need this extension which I wrote Find and Transform:
Make this keybinding:
First, select what you want to repeat to the right. Second, trigger either keybinding.
It works by doing a
find
for the clipboard content (and automatically selecting it) each time after the paste.The only caveat is it won’t work if you have the exact same text as the selected text earlier on the same line.