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.
OhMyZSH and command history autocompletion. It’ll change your life.
Thx! I’ve got zsh and ohmyzsh installed but my workflow hasn’t changed really. Also, I really want to store and see a command history.
Back when I used traditional distros I hated that I had no history of user installed packages/apps
Now I could just write a file and append all installs. With atomic distros, it’s clearer nowadays, but I can also save packages for later
I am really confused. Every shell over used has had a command history. zsh takes it to the next level, with optional history syncing between running terminals. Histories are always persistent, unless you unset HISTFILE. I’ve got my HISTSIZE set to an absurd 10,000 commands, with uniqueness enabled. Ctrl-R lets you autocomplete type-ahead search through history. Tools like fzf can make it marginally better, but ^r has nearly always been enough. You have !? history searching; !nnnn for referring to commands by number, the
history
command to actually print out all of you history which you can then grep.Most of this has been available in shells at lest since the mid-90’s, when I really started using Unix in earnest.
So I’m really confused about why you think shells haven’t had persistent histories. What’s new or different about this thing to which you refer?
man bash
orman zshall
and/HIST
, and that’ll get you started.atuin is really great for command history completion