say I type
$ sudo pacman -Syu
$ sudo chown blah blah
$ sudo pa
I just get `sudo chown blah blah` instead of `sudo pacman -Syu`Does anybody know how to fix this? :)
31–40 of 44 posts
say I type
$ sudo pacman -Syu
$ sudo chown blah blah
$ sudo pa
I just get `sudo chown blah blah` instead of `sudo pacman -Syu`Does anybody know how to fix this? :)
interestingly you can s/bash/zsh/ and s/zsh/bash/ in this text and everything also works.
Something I've noticed is that osx users believe bash to be less capable than it is because of the poor out of the box configuration of bash on that platform (in addition to the ancient version installed). Particularly the tab completion stuff. It doesn't pop up menus and all that, but the ubuntu install of bash has a ton of context-sensitive tab completion stuff in it, and the git package properly installs __git_ps1…
I guess "bad PR" like this is actually one downside for projects switching to GPL3.
Clever history doesn't really work for me when I use `sudo` say I type $ sudo pacman -Syu $ sudo chown blah blah $ sudo pa I just get `sudo chown blah blah` instead of `sudo pacman -Syu` Does anybody know how to fix this? :)
$ sudo foo
$ sudo bar
$ sudo fo
gives me `sudo foo`.I'm using zsh 5.0.7 (x86_64-apple-darwin14.0.0) on OS X 10.10 (with prezto[1]).
Earlier quoted context omitted.
So what do you do when you want to ls a file called "L"?
I put L in 'single quotes' or I \escape it touch 'L' ls 'L' ls \L
Much better is to use abbreviations which expand to the full command they abbreviate after you hit the space bar.[1]
This way you can see exactly what's going to be done before you hit ENTER. It does cost one extra keystroke, but the safety is worth it.
One of my favorites instead of aliasing ".."'s is this function: rationalise-dot() { if [[ $LBUFFER = *.. ]]; then LBUFFER+=/.. else LBUFFER+=. fi } zle -N rationalise-dot bindkey . rationalise-dot When you hit ... it will produce a slash and a ../ for each . you type after that.
alias ..="cd .."
alias ...="cd ../.."
After that, the more dots you type, the more error-prone it is, as you start to have to carefully count exactly how many directories you have to go up to get to where you want.A better alternative is a script that shows a list of parent directories and lets you select them by typing the number or letter associated with them.
For example, if your current directory is "/a/b/c/d/e/f/g/h", then the script would display something like:
List of parent directories:
1 - a
2 - b
3 - c
4 - d
5 - e
6 - f
7 - g
Please choose a directory: _
and you could type "3" to get to directory "c". That would be equivalent to typing "......", but much less error-prone and it'll save you the tedium of counting dots too.The tab completion isn't limited to the beginning of file names either. Useful when many of your file names start with the same pattern but then diverge. ls something will complete to ls prefixSomething.sh if it's unique enough. This is probably my single favorite zsh feature.
Having gotten used to ido in emacs, I must say that I am now disappointed in most all autocompletes. Shame it doesn't work in the shell. (Quick, someone prove me wrong! Please! :) )
It's like ido, but reorders the commands it presents to you in most-frequently-used order, which can be a real time-saver.
One of my favorites instead of aliasing ".."'s is this function: rationalise-dot() { if [[ $LBUFFER = *.. ]]; then LBUFFER+=/.. else LBUFFER+=. fi } zle -N rationalise-dot bindkey . rationalise-dot When you hit ... it will produce a slash and a ../ for each . you type after that.
Nice. But all you really need are: alias ..="cd .." alias ...="cd ../.." After that, the more dots you type, the more error-prone it is, as you start to have to carefully count exactly how many directories you have to go up to get to where you want. A better alternative is a script that shows a list of parent directories and lets you select them by typing the number or letter associated with them. For example, if you…