Skip to content

Instantly share code, notes, and snippets.

@sarnobat
Last active September 25, 2017 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sarnobat/143830c83ec84511bb62c753d991364e to your computer and use it in GitHub Desktop.
Save sarnobat/143830c83ec84511bb62c753d991364e to your computer and use it in GitHub Desktop.
Key binding equivalents between Bash and Zsh
# bash
bind '"\el":"ls -lrtha --color=always\n"'
bind '"\ef":"find $PWD -type f -iname \"**\""'
bind '"\eg":"| xargs grep --delimiter \"\\n\" grep --color=always -ni \"*\""'
bind '"\e[1;3D": backward-word'
bind '"\e[1;3C": forward-word'
bind '"\e[1;3A": history-search-backward'
bind '"\e[1;3B": history-search-forward'
bind '"\ep":"pwd\n"'
bind '"\e4"':yank-last-arg
bind '"\ek"':kill-line
# zsh
bindkey -s "^[l" 'ls -lr --time=ctime --ignore-backups --color=always --classify --almost-all --reverse --human-readable --group-directories-first --ignore=".fuse*" --ignore="._*" | tac\n'
bindkey -s "^[f" 'find $PWD -type f -iname "**"^[[D^[[D'
bindkey -s "^[g" '^[[F | xargs --delimiter "\\n" grep --color=always -ni ""^[[D'
bindkey "^[[1;3D" backward-word
bindkey "^[[1;3C" forward-word
bindkey "^[[1;3A" history-beginning-search-backward
bindkey "^[[1;3B" history-beginning-search-forward
bindkey "^[4" insert-last-word
bindkey "^[k" vi-kill-eol
# Other notes:
# (-) If using iTerm (Mac OS X) some keyboard settings are necessary: http://netgear.rohidekar.com:44452/media/sarnobat/Unsorted/new/screenshots/tutorials/iterm_profile2.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment