Readit News logoReadit News
alzee commented on Start all of your commands with a comma (2009)   rhodesmill.org/brandon/20... · Posted by u/theblazehen
listeria · 2 days ago
Global aliases are a zsh feature and not avaliable in bash. So if you want:

  openssl ,v
to expand to...

  openssl --version
readline seems like the way to go.

Then again most of the examples OP gave are usually available as short options, and aliasing ,s to sudo is certainly possible. So the only one which makes sense to me is ,,=$. But it's probably not worth the trouble to my muscle memory.

alzee · a day ago
> most of the examples OP gave are usually available as short options

Yes, but a lot of commands behave differently for -h and --help.

> aliasing ,s to sudo is certainly possible

Sure, but my ,s key sequence doesn’t just expand to sudo. It actually moves the cursor to the start of the current line, prefixes the command with sudo, and then moves the cursor to the end of the line. The idea is when you type a command which requires root privileges but forget to use sudo, you can just hit ctrl+p ,s to fetch the previous command and prefix it with sudo. This is what it looks like in ~/.inputrc: ",s":"^Asudo ^E"

alzee commented on Start all of your commands with a comma (2009)   rhodesmill.org/brandon/20... · Posted by u/theblazehen
pmarreck · 2 days ago
also. did you mean .inputrc ?
alzee · a day ago
Yes, I meant ~/.inputrc .
alzee commented on Start all of your commands with a comma (2009)   rhodesmill.org/brandon/20... · Posted by u/theblazehen
alzee · 2 days ago
Using commas in filenames feels kind of weird to me, but I do use a comma as the initiator for my Bash key sequences. For example: ,, expands to $ ,h expands to --help ,v expands to --version ,s prefixes sudo

You put keyseqs in ~/.inputc, set a keyseq-timeout, and it just works.

alzee commented on Show HN: 1Code – Open-source Cursor-like UI for Claude Code   github.com/21st-dev/1code... · Posted by u/Bunas
alzee · 23 days ago
You shouldn’t start filenames or identifiers with digits.

u/alzee

KarmaCake day12May 24, 2022View Original