some binds
This commit is contained in:
@@ -20,4 +20,16 @@ WORDCHARS=${WORDCHARS//\//}
|
||||
# Rookie keybindings :)
|
||||
bindkey '^[[1;5D' backward-word # C-Left
|
||||
bindkey '^[[1;5C' forward-word # C-Right
|
||||
bindkey '^H' backward-kill-word # C-Backspace
|
||||
bindkey '^H' backward-kill-word # C-Backspace (also C-H)
|
||||
bindkey '^Z' undo # C-z
|
||||
|
||||
|
||||
# A-s to prepend sudo
|
||||
uy_prepend_sudo() {
|
||||
if [[ $BUFFER != sudo\ * ]]; then
|
||||
BUFFER="sudo $BUFFER"
|
||||
CURSOR+=5
|
||||
fi
|
||||
}
|
||||
zle -N uy_prepend_sudo
|
||||
bindkey '^[s' uy_prepend_sudo
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
_oops_confirm() {
|
||||
uy_oops_confirm() {
|
||||
if [[ ! -f "$HISTFILE" ]]; then
|
||||
print -P "%F{red}Failed to locate history file: $HISTFILE%f"
|
||||
return 1
|
||||
@@ -26,4 +26,4 @@ _oops_confirm() {
|
||||
fi
|
||||
}
|
||||
|
||||
alias oops=' _oops_confirm'
|
||||
alias oops=' uy_oops_confirm'
|
||||
|
||||
@@ -6,7 +6,12 @@ C b 字符后移
|
||||
A f 单词前移
|
||||
A b 单词后移
|
||||
|
||||
C w 删除前一个单词
|
||||
A d 删除后一个单词
|
||||
|
||||
C u 从光标位置到行首删除
|
||||
C k 从光标位置到行末删除
|
||||
|
||||
A s sudo
|
||||
|
||||
A . 上一个命令的最后一个参数
|
||||
Reference in New Issue
Block a user