I’ve been using the terminal for 5 years.
99% of attempts at keeping valuable code snippets failed. Or having a useful command history.
Finally, I looked up how to send a line to terminal.
I use vscode since Atom was discontinued (looking forward to zed). But in the meanwhile, I just added
{
"key": "ctrl+enter",
"command": "workbench.action.terminal.runSelectedText",
"when": "terminalProcessSupported && editorTextFocus && editorLangId =~ /shell|bash|zsh|fish/"
}
Maybe it helps someone :)
With this, I can finally keep a history of all useful commands I run. Like I can have a systemd shell file where I store the commands that I ran. Or a file to store all my podman commands. Now I do not have to type them anymore, I can just run them.
atuin is really great for command history completion