Configuration

The configuration for lnav is stored in the following JSON files in ~/.lnav:

  • config.json - Contains local customizations that were done using the :config command.
  • configs/default/*.json - The default configuration files that are built into lnav are written to this directory with .sample appended. Removing the .sample extension and editing the file will allow you to do basic customizations.
  • configs/installed/*.json - Contains configuration files installed using the -i flag (e.g. $ lnav -i /path/to/config.json).
  • configs/*/*.json - Other directories that contain *.json files will be loaded on startup.

Options

The following high-level configuration options are available:

/ui/clock-format

The format for the clock displayed in the top-left corner using strftime(3) conversions
type string
examples %a %b %d %H:%M:%S %Z

/ui/dim-text

Reduce the brightness of text (useful for xterms). This setting can be useful when running in an xterm where the white color is very bright.
type boolean

/ui/default-colors

Use default terminal background and foreground colors instead of black and white for all text coloring. This setting can be useful when transparent background or alternate color theme terminal is used.
type boolean

/ui/theme

The name of the theme to use.
type string

/ui/keymap

The name of the keymap to use.
type string

Theme Definitions

User interface themes are also defined through the JSON configuration files.

/ui/theme-defs/<theme_name>/vars

Variables definitions that are used in this theme.
type object
patternProperties
  • (\w+)
/ui/theme-defs/<theme_name>/vars/<var_name>
A theme variable definition
type string
additionalProperties False

/ui/theme-defs/<theme_name>/styles

Styles for log messages.
type object
properties
  • identifier
/ui/theme-defs/<theme_name>/styles/identifier
Styling for identifiers in logs
style
  • text
/ui/theme-defs/<theme_name>/styles/text
Styling for plain text
style
  • alt-text
/ui/theme-defs/<theme_name>/styles/alt-text
Styling for plain text when alternating
style
  • error
/ui/theme-defs/<theme_name>/styles/error
Styling for error messages
style
  • ok
/ui/theme-defs/<theme_name>/styles/ok
Styling for success messages
style
  • warning
/ui/theme-defs/<theme_name>/styles/warning
Styling for warning messages
style
  • hidden
/ui/theme-defs/<theme_name>/styles/hidden
Styling for hidden fields in logs
style
  • adjusted-time
/ui/theme-defs/<theme_name>/styles/adjusted-time
Styling for timestamps that have been adjusted
style
  • skewed-time
/ui/theme-defs/<theme_name>/styles/skewed-time
Styling for timestamps
style
  • offset-time
/ui/theme-defs/<theme_name>/styles/offset-time
Styling for hidden fields
style
  • popup
/ui/theme-defs/<theme_name>/styles/popup
Styling for popup windows
style
  • scrollbar
/ui/theme-defs/<theme_name>/styles/scrollbar
Styling for scrollbars
style
additionalProperties False

style

type object
properties
  • color
/color
The foreground color value for this style. The value can be the name of an xterm color, the hexadecimal value, or a theme variable reference.
type string
examples #fff
Green
$black
  • background-color
/background-color
The foreground color value for this style. The value can be the name of an xterm color, the hexadecimal value, or a theme variable reference.
type string
examples #2d2a2e
Green
  • underline
/underline
Indicates that the text should be underlined.
type boolean
  • bold
/bold
Indicates that the text should be bolded.
type boolean
additionalProperties False

Keymap Definitions

Keymaps in lnav map a key sequence to a command to execute.

/ui/keymap-defs/<keymap_name>

The keymap definitions
type object
patternProperties
  • ((?:x[0-9a-f]{2})+)
/ui/keymap-defs/<keymap_name>/<key_seq>
The hexadecimal encoding of key codes to map to a command.
type object
properties
  • command
/ui/keymap-defs/<keymap_name>/<key_seq>/command
The command to execute for the given key sequence.
type string
pattern [:|;].*
  • alt-msg
/ui/keymap-defs/<keymap_name>/<key_seq>/alt-msg
The help message to display after the key is pressed.
type string
additionalProperties False
additionalProperties False