* ZshArrays A lot of zsh things are the same as in bash, some things are slightly different. I'd recommend the book "From Bash to Z Shell" by Kiddle, Peek and Stephenson #### Key bindings ```plaintext bindkey # print out current keymap bindkey 'key' command # create binding bindkey -r 'key' # remove binding bindkey -d # delete all bindings and reset to default bindkey -e # switch to emacs mode bindkey -v # switch to vi mode bindkey '\C-d' # show binding for Ctrl-D (note the backslash) bindkey -M keymap_name # print out mappings in keymap_name bindkey -A new_bindings emacs # new bindings based on emacs bindings bindkey -N new_keymap # new empty keymap bindkey -D keymap_name # delete keymap_name bindkey -R -M keymap_name 'a-z' self-insert # usual behaviour for a-z ``` ##### Key Timeout When you bind, e.g. ```plaintext C-xd -> print "hello" C-xdx -> print "byebye" ``` then zsh doesn't know, if you press `C-x`, whether or not `x` is coming. The variable `KEYTIMEOUT` tells zsh how long to wait before assuming that the key combo is complete. ```plaintext KEYTIMEOUT= # e.g. KEYTIMEOUT=200 # two seconds ``` ### Shell options ```plaintext setopt +o no match # pass through unmatched command line wildcard arguments ``` ### Pattern matching ```plaintext if [[ $x = *hello ]]; then echo hello; fi # test for string ending with 'hello' ```