GH-53: configure arrow keys for iTerm2 with cuu/d1
This commit is contained in:
parent
7a4b54b708
commit
f5c164d4c3
1 changed files with 13 additions and 5 deletions
18
README.md
18
README.md
|
|
@ -35,21 +35,29 @@ Usage
|
||||||
|
|
||||||
2. Bind keyboard shortcuts to this script's functions:
|
2. Bind keyboard shortcuts to this script's functions:
|
||||||
|
|
||||||
# bind UP and DOWN arrow keys
|
## Arrow Keys ###########################################
|
||||||
|
|
||||||
|
# OPTION 1: for most systems
|
||||||
zmodload zsh/terminfo
|
zmodload zsh/terminfo
|
||||||
bindkey "$terminfo[kcuu1]" history-substring-search-up
|
bindkey "$terminfo[kcuu1]" history-substring-search-up
|
||||||
bindkey "$terminfo[kcud1]" history-substring-search-down
|
bindkey "$terminfo[kcud1]" history-substring-search-down
|
||||||
|
|
||||||
# bind UP and DOWN arrow keys (compatibility fallback
|
# OPTION 2: for iTerm2 running on Apple MacBook laptops
|
||||||
# for Ubuntu 12.04, Fedora 21, and MacOSX 10.9 users)
|
zmodload zsh/terminfo
|
||||||
|
bindkey "$terminfo[cuu1]" history-substring-search-up
|
||||||
|
bindkey "$terminfo[cud1]" history-substring-search-down
|
||||||
|
|
||||||
|
# OPTION 3: for Ubuntu 12.04, Fedora 21, and MacOSX 10.9
|
||||||
bindkey '^[[A' history-substring-search-up
|
bindkey '^[[A' history-substring-search-up
|
||||||
bindkey '^[[B' history-substring-search-down
|
bindkey '^[[B' history-substring-search-down
|
||||||
|
|
||||||
# bind P and N for EMACS mode
|
## EMACS mode ###########################################
|
||||||
|
|
||||||
bindkey -M emacs '^P' history-substring-search-up
|
bindkey -M emacs '^P' history-substring-search-up
|
||||||
bindkey -M emacs '^N' history-substring-search-down
|
bindkey -M emacs '^N' history-substring-search-down
|
||||||
|
|
||||||
# bind k and j for VI mode
|
## VI mode ##############################################
|
||||||
|
|
||||||
bindkey -M vicmd 'k' history-substring-search-up
|
bindkey -M vicmd 'k' history-substring-search-up
|
||||||
bindkey -M vicmd 'j' history-substring-search-down
|
bindkey -M vicmd 'j' history-substring-search-down
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue