Hacker News new | past | comments | ask | show | jobs | submit login

Bash history completion is sometimes useful (!mysql) but mostly annoying (using ! somewhere mid-sentence)

!! is pointless because up arrow, come on.




!! is not at all pointless, "sudo !!" is much easier that Up, Ctrl-a, "sudo ".


I have alt-s in my zsh which does zle beginning-of-line; zle -U "sudo "

Also it's up, home, "sudo "


I may have to steal that alias, good tip.

Ctrl-a/Ctrl-e are equivalent to Home/End (unless you're inside a screen session, which was a terrible choice of binding on their part).


Note that these aren't bash things. They're the emacs bindings for readline, so they work with anything that uses readline (like the mysql client).

You can set them to the vi ones instead with:

    set -o vi
..and they do work with screen ;-) (0 for start, $ for end)


> escape \000\040

in my screenrc changes this to 'CTRL+spacebar', which I find much more sensible.


or sudo ESC-. which inserts the last word from the last command.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: