From d5350276dcf1297bca43c60480dbae9a32e72bea Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Sat, 14 May 2022 14:42:07 +0200 Subject: [PATCH] less: Add `--quit-if-one-screen` Before v530 `less` would need the -X flag as well for -F to be useful. With v530 it does not enter alternate mode if the content fits in one screen. --- .config/zsh/.zprofile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 25c6b75..2efdb42 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -77,6 +77,11 @@ export LESS_TERMCAP_us=$'\e[1;4;31m' LESS+="${LESS:+ }--mouse --wheel-lines=3" # Display ANSI color escape sequences LESS+="${LESS:+ }-R" +# Exit if entire file fits on screen +# NOTE: Before v530 `less` would need the -X flag as well for -F to be useful. +# With v530 it does not enter alternate mode if the content fits in one +# screen. +LESS+="${LESS:+ }-F" export LESS # Show also hidden files per default but ignore files in '.git' directories.