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'
|
||||
|
||||
Reference in New Issue
Block a user