Make ^l clear screen and scrollback
This commit is contained in:
		
							
								
								
									
										13
									
								
								init.zsh
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								init.zsh
									
									
									
									
									
								
							| @ -171,6 +171,19 @@ zle -N zle-line-init | ||||
| # Fast switch of modes | ||||
| KEYTIMEOUT=1 | ||||
|  | ||||
| # Clear scrollback on ^l | ||||
| __zsh_clear_screen_and_scrollback() { | ||||
|     echoti civis >"$TTY" | ||||
|     printf '%b' '\e[H\e[2J' >"$TTY" | ||||
|     zle .reset-prompt | ||||
|     zle -R | ||||
|     printf '%b' '\e[3J' >"$TTY" | ||||
|     echoti cnorm >"$TTY" | ||||
| } | ||||
|  | ||||
| zle -N __zsh_clear_screen_and_scrollback | ||||
| bindkey '^L' __zsh_clear_screen_and_scrollback | ||||
|  | ||||
| # Direnv | ||||
| if which direnv >/dev/null 2>&1; then | ||||
|     eval "$(direnv hook zsh)" | ||||
|  | ||||
		Reference in New Issue
	
	Block a user