by bwhaley · 8mo ago · 0 comments
"I typed 'cd di↑' and you're giving me 'pwd'??"
$ a
bash: a: command not found
$ b
bash: b: command not found
$ c
bash: c: command not found
$ d
bash: d: command not found
$ <CTRL-R> b <UP>
$ a
That's great if I don't remember which command I was experimenting with, but I do know other commands that I did around that time (usually a file that I edited with VIM).I went down the “fully automatic history” path before, but it mostly turned into noise for me.
Keeping a tiny cheatsheet of things I had to look up twice ended up working better.
Completely transformed all of my workflows
> Sync your shell history to all of your machines
I think of my shell history as very machine specific. Can you give some insights on how you benefit from history sync? If you use it.
However what I do find useful is eternal history. It's doable with some .bashrc hacks, and slow because it's file based on every command, but:
- never delete history
- associate history with a session token
- set separate tokens in each screen, tmux, whatever session
- sort such that backward search (ctrl-R) hits current session history first, and the rest second
Like half my corporate brain is in a 11M history file at this point, going back years.
What I would love is to integrate this into the shell better so it's using sqlite or similar so it doesn't feel "sluggish." But even now the pain is worth the prize.
2. clone it on host_bar in /home/user/src/myproject
If you set filter_mode = "directory", you can recall project specific commands from host_foo for use on host_bar even though you're working on different machines and the search space won't be cluttered with project specific commands for other projects.