some binds

This commit is contained in:
2026-03-26 08:12:06 +01:00
parent 3567f83c9b
commit 4a3078edba
3 changed files with 20 additions and 3 deletions
+13 -1
View File
@@ -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
+2 -2
View File
@@ -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'