# The default text editing behaviour bindkey "^[[1;5C" forward-word #Ctrl+right goes forwards one word bindkey "^[[1;5D" backward-word #Ctrl+left goes backwards one word bindkey "^[[1;3C" forward-word #Alt+right goes forwards one word bindkey "^[[1;3D" backward-word #Alt+left goes backwards one word if echo "$TERM" | grep xterm >> /dev/null; then # Applies specifically to xterm - tested on st, and it doesn't seem to work bindkey '^[[H' beginning-of-line #Home goes to the beginning of the line bindkey '^[[F' end-of-line #End goes to the end of the line else # Applies to all terminals (hopefully) bindkey '^[[H' beginning-of-line #Home goes to the beginning of the line bindkey '^[[4~' end-of-line #End goes to the end of the line fi