3 ms·
I have so many common one-liners I use in my current project (that I access using fuzzy search via ctr-R) that I'm thinking about having a file a'la "my-command
by wodenokoto 6y ago
I have so many common one-liners I use in my current project (that I access using fuzzy search via ctr-R) that I'm thinking about having a file a'la "my-commands" and have it appended to my history, somehow.
That would truly be the opposite of this advice.
Maybe I need to think about this a bit more :)
- camnora 6y agoGreenclips [1] works well for this if you're a rofi [2] user. You can set a staticHistoryPath that points to a file. When activating Greenclips, you can search for the desired command. I've been using this on my Linux box for the last year or so and haven't looked back. [1] https://github.com/erebe/greenclip https://github.com/erebe/greenclip [2] https://github.com/davatorium/rofi https://github.com/davatorium/rofi
- sbt567 6y agoI'm using navi (https://github.com/denisidoro/navi https://github.com/denisidoro/navi) for commands that long enough and used less frequently. And it works great.
- lytedev 6y agoMakefile!
- dylan604 6y ago> have it appended to my history, somehow isn't that what .aliases is for?
- wodenokoto 6y agoI honestly don’t know.
- marcosdumay 6y agoShell aliases are your friend. just give them some memorable names, and add them to your .bashrc. Or, if they are very context sensitive (that's not great), there is a way to source a file every time you enter a directory, I just don't remember it.
- chubot 6y agoShell functions do the same thing as aliases, and have fewer parsing problems, and they have more flexible arguments. Instead of: alias ls='ls --color' Better: ls() { command ls --color "$@" } (The "command" prefix avoids recursion)
- deleted 6y ago[deleted]
- mdiesel 6y agoThere is a history command, with a way to reload, so this would be possible by writing to bash_history from bashrc, then reloading the history I think. Not tested. This is a short guide that is an eye opener as to just how much can be done with bash history: https://www.digitalocean.com/community/tutorials/how-to-use-bash-history-commands-and-expansions-on-a-linux-vps https://www.digitalocean.com/community/tutorials/how-to-use-...
- gcmeplz 6y agoYou can set up a per-directory bash history: https://unix.stackexchange.com/questions/305524/create-history-log-per-working-directory-in-bash https://unix.stackexchange.com/questions/305524/create-histo... And a Makefile sounds like it'd be pretty helpful too!
- blandflakes 6y agoYou can also use direnv to add aliases when you enter a certain directory.