I spend a lot of time copying the paths output by grep, and pasting them after a command that opens a visual editor.
Is there a way of programming a terminal emulator to open selected text in a specific editor? Perhaps a middle-click on selected text, or an addition to the context menu?
Is this perhaps a feature of some terminal I don't know?
Best Answer
Create a script:
Include the following code:
*You can replace
xdg-open
with another command of your choice to open the selection with this program.Make the script executable
Create a shortcut for this script.
Then only select a file name in your terminal and use your shortcut. A detour via the clipboard is not required.