From 3e7a01c3a9d7c71a9e4a1981815efe54f7ed282e Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Wed, 20 Nov 2019 20:35:04 +0100 Subject: [PATCH] lesskey: don't color indicator for overlong lines Recent versions of less draw an indicator when an overlong line is not wrapped but cut off. The indicator is nice but the strong color is annoying. Also add compatibility to setup.sh for older less versions. --- shell/lesskey | 4 +++- shell/setup.sh | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/shell/lesskey b/shell/lesskey index 502bffa..964a719 100644 --- a/shell/lesskey +++ b/shell/lesskey @@ -47,11 +47,13 @@ l right-scroll # --ignore-case: # Ignore case if the search string doesn't contain any uppercase letters. # If there are uppercase letters respect case. +# --rscroll=*n> +# Draw ">" ("*" means with "normal" attributes) when hiding wrapped lines. # # Don't use --search-skip-screen as it makes it easy to miss matches on the # current page. Don't use --clear-screen which always prints a full screen # (padded with "~" lines). -LESS = --no-init --quit-if-one-screen --RAW-CONTROL-CHARS --ignore-case +LESS = --no-init --quit-if-one-screen --RAW-CONTROL-CHARS --ignore-case --rscroll=*n> # Store less' history file in this directory. HISTORY_PATH is replaced by # setup.sh because lesskey doesn't expand ~/. diff --git a/shell/setup.sh b/shell/setup.sh index 7db9722..e8cff62 100755 --- a/shell/setup.sh +++ b/shell/setup.sh @@ -67,9 +67,14 @@ mkdir -p zsh/cache # file in this directory; this requires replacing the constant HISTORY_PATH in # lesskey. echo 'lesskey: generating .lesskey' -simple_cpp /dev/null; then + sed_i 's/--rscroll=[^ ]*//' lesskey.tmp +fi +simple_cpp < lesskey.tmp \ HISTORY_PATH -- "`pwd`/lesshistory" \ | lesskey - +rm lesskey.tmp chmod 0600 ~/.less # Custom colors for GNU ls. -- 2.45.2