programs: less: enable color highlighting

This commit is contained in:
2024-12-30 17:00:08 +00:00
parent 0a9e5b9f68
commit 3ed002ea88

View File

@@ -2,16 +2,22 @@
{ {
sane.programs.less = { sane.programs.less = {
sandbox.autodetectCliPaths = "existingFile"; sandbox.autodetectCliPaths = "existingFile";
env.PAGER = "less";
# LESS flags: # LESS flags:
# - F = quit if output fits on one screen # - --LINE-NUMBERS (N) = render EVERY line with its number in the left column
# - K = exit on ctrl+c # - --LONG-PROMPT (M) = "long prompt"
# - M = "long prompt" # - --RAW-CONTROL-CHARS (R) = output raw control characters
# - R = output raw control characters # - --chop-long-lines (S) = chop long lines instead of wrapping
# - S = chop long lines instead of wrapping # - --incsearch = start searching immediately as you type `/<search-term>`
# - X = Don't use termcap init/deinit strings (hence, `less` output is visible on the terminal even after exiting) # - --no-init (X) = Don't use termcap init/deinit strings (hence, `less` output is visible on the terminal even after exiting)
# - --quit-if-one-screen (F) = quit if output fits on one screen
# - --quit-on-intr (K) = exit on ctrl+c
# - --shift=.n = left/right arrow-keys scroll by `n` screen widths
# - --use-color = enable color instead of just monochrome (highlights search matches)
# SYSTEMD_LESS defaults to FRSXMK # SYSTEMD_LESS defaults to FRSXMK
env.LESS = "FRMK"; env = rec {
env.SYSTEMD_LESS = "FRMK"; #< used by journalctl PAGER = "less";
LESS = "--incsearch --LONG-PROMPT --quit-if-one-screen --quit-on-intr --RAW-CONTROL-CHARS --shift=.2 --use-color";
SYSTEMD_LESS = LESS; #< used by journalctl
};
}; };
} }