set C-l to clear the scrollback buffer as well as the screen

This commit is contained in:
sadan 2025-05-01 17:38:22 -04:00
parent 84e9516ed2
commit a4eb132908
No known key found for this signature in database

View file

@ -45,6 +45,21 @@
cnd() {
mkdir $1 && cd $1;
}
# MUST COME AFTER p10k
# make clear the scrollback buffer as well as the screen
# copy clear-screen into _orig_clear_Screen
zle -A clear-screen _orig_clear_screen
# define zsh widget func
_CLEAR() {
# clears the scrollback buffer
printf '\033[3J'
# call the orig clear-screen to do some housekeeping
zle _orig_clear_screen
}
# define our new widget
zle -N _CLEAR _CLEAR
# bind it to
bindkey _CLEAR
'';
enableCompletion = true;
plugins = [