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.
# --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 ~/.
# file in this directory; this requires replacing the constant HISTORY_PATH in
# lesskey.
echo 'lesskey: generating .lesskey'
-simple_cpp <lesskey \
+cp lesskey lesskey.tmp
+if ! less --help | grep rscroll= > /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.