zsh is very nice and powerful. Here are some things to put into your .zshrc
#turns the key \C-x F into a command complete-file #(which goes straight to the completion system's file completion command, ignoring the normal context) zle -C complete-file complete-word _generic zstyle ':completion:complete-file::::' completer _files bindkey '^F' complete-file
Now pressing CTRL-f at any time makes the completion show (and suggest) all the files in the directory
# make ALT+<Backspace> delete backwards until last slash (very useful when editing paths) backward-delete-to-slash () { local WORDCHARS=${WORDCHARS//\//} zle .backward-delete-word } zle -N backward-delete-to-slash bindkey "^[^?" backward-delete-to-slash
# Allow comments in interactive shell setopt interactivecomments # Say how long a command took, if it took more than 30 seconds export REPORTTIME=30 # Prompts for confirmation after 'rm *' etc ...Helps avoid mistakes like 'rm * o' when 'rm *.o' was intended setopt RM_STAR_WAIT # Don’t nice background processes setopt NO_BG_NICE # Watch other user login/out watch=notme export LOGCHECK=60 # make every cd command also a pushd setopt autopushd
See “man 1 zshexpn” for documentation. Some examples:
vi **/muh.txt # edit muh.txt no matter in which subdirectory it hides echo *(oL) # sort directory contents by size echo *(om) # sort directory contents by modification time echo **/*(F) # list full directories echo **/*(/^F) # list empty directories (NOT full) echo *(m4) # list files modified exactly 4 days ago