mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-27 05:34:35 +00:00
Update keybinds
This commit is contained in:
parent
51a193be98
commit
70ee76a2be
|
@ -14,13 +14,8 @@ if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
|
||||||
zle -N zle-line-finish
|
zle -N zle-line-finish
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use vim keybindings
|
# Use emacs keybindings
|
||||||
bindkey -v
|
bindkey -e
|
||||||
|
|
||||||
# [PageUp] - Up a line of history
|
|
||||||
[[ -n "${terminfo[kpp]}" ]] && bindkey "${terminfo[kpp]}" up-line-or-history
|
|
||||||
# [PageDown] - Down a line of history
|
|
||||||
[[ -n "${terminfo[knp]}" ]] && bindkey "${terminfo[knp]}" down-line-or-history
|
|
||||||
|
|
||||||
# Start typing + [Up-Arrow] - fuzzy find history forward
|
# Start typing + [Up-Arrow] - fuzzy find history forward
|
||||||
if [[ -n "${terminfo[kcuu1]}" ]]; then
|
if [[ -n "${terminfo[kcuu1]}" ]]; then
|
||||||
|
@ -36,39 +31,36 @@ if [[ -n "${terminfo[kcud1]}" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# [Home] - Go to beginning of line
|
# [Home] - Go to beginning of line
|
||||||
[[ -n "${terminfo[khome]}" ]] && bindkey "${terminfo[khome]}" beginning-of-line
|
bindkey "^[[H" beginning-of-line
|
||||||
# [End] - Go to end of line
|
# [End] - Go to end of line
|
||||||
[[ -n "${terminfo[kend]}" ]] && bindkey "${terminfo[kend]}" end-of-line
|
bindkey "^[[F" end-of-line
|
||||||
|
|
||||||
# [Shift-Tab] - move through the completion menu backwards
|
# [Shift-Tab] - move through the completion menu backwards
|
||||||
[[ -n "${terminfo[kcbt]}" ]] && bindkey "${terminfo[kcbt]}" reverse-menu-complete
|
[[ -n "${terminfo[kcbt]}" ]] && bindkey "${terminfo[kcbt]}" reverse-menu-complete
|
||||||
|
|
||||||
# [Backspace] - delete backward
|
# [Backspace] - delete backward
|
||||||
bindkey '^?' backward-delete-char
|
bindkey '^?' backward-delete-char
|
||||||
# [Delete] - delete forward
|
# [Ctrl-Supr] - delete forward
|
||||||
if [[ -n "${terminfo[kdch1]}" ]]; then
|
bindkey "^[[3~" delete-char
|
||||||
bindkey "${terminfo[kdch1]}" delete-char
|
# [Ctrl-Delete]
|
||||||
else
|
bindkey "^[3;5~" kill-word
|
||||||
bindkey "^[[3~" delete-char
|
|
||||||
bindkey "^[3;5~" delete-char
|
|
||||||
fi
|
|
||||||
|
|
||||||
# [Ctrl-Delete] - delete whole forward-word
|
# [Ctrl-Delete] - delete whole forward-word
|
||||||
bindkey '^[[3;5~' kill-word
|
bindkey '^[[3;5~' kill-word
|
||||||
|
|
||||||
# [Ctrl-RightArrow] - move forward one word
|
# [Ctrl-RightArrow] - move forward one word
|
||||||
bindkey '^[[1;5C' forward-word
|
bindkey '^[[1;5C' forward-word
|
||||||
# [Ctrl-LeftArrow] - move backward one word
|
# [Ctrl-LeftArrow] - move backward one word
|
||||||
bindkey '^[[1;5D' backward-word
|
bindkey '^[[1;5D' backward-word
|
||||||
|
|
||||||
bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
|
# [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
|
||||||
bindkey ' ' magic-space # [Space] - don't do history expansion
|
bindkey '^r' history-incremental-search-backward
|
||||||
|
# [PageUp] - Up a line of history
|
||||||
# Edit the current command line in $EDITOR
|
[[ -n "${terminfo[kpp]}" ]] && bindkey "${terminfo[kpp]}" up-line-or-history
|
||||||
autoload -U edit-command-line
|
# [PageDown] - Down a line of history
|
||||||
zle -N edit-command-line
|
[[ -n "${terminfo[knp]}" ]] && bindkey "${terminfo[knp]}" down-line-or-history
|
||||||
bindkey '\C-x\C-e' edit-command-line
|
|
||||||
|
|
||||||
|
# [Space] - do history expansion on space
|
||||||
|
bindkey ' ' magic-space
|
||||||
|
|
||||||
# [ctrl+space] Accept suggestion from zsh-autosuggestions plugin
|
# [ctrl+space] Accept suggestion from zsh-autosuggestions plugin
|
||||||
bindkey '^ ' autosuggest-accept
|
bindkey '^ ' autosuggest-accept
|
||||||
|
|
Loading…
Reference in a new issue