Skip to main content
Glow respects several environment variables that control configuration paths, editor selection, pager behavior, and rendering options.

Configuration Variables

GLOW_CONFIG_HOME

Specifies the directory where Glow looks for its configuration file.
GLOW_CONFIG_HOME
string
default:"platform-specific"
Override the default config directory. Glow will look for glow.yml in this directory.
Priority:
  1. $GLOW_CONFIG_HOME/glow.yml (highest priority)
  2. $XDG_CONFIG_HOME/glow/glow.yml
  3. Platform-specific config directory (lowest priority)
Example:
export GLOW_CONFIG_HOME="$HOME/.config/glow"
glow README.md
Source: main.go:438-440

XDG_CONFIG_HOME

Standard XDG Base Directory specification for config files.
XDG_CONFIG_HOME
string
default:"~/.config"
If set, Glow looks for configuration at $XDG_CONFIG_HOME/glow/glow.yml. This follows the XDG Base Directory specification.
Example:
export XDG_CONFIG_HOME="$HOME/.config"
glow README.md
# Config read from ~/.config/glow/glow.yml
Source: main.go:434-436
GLOW_CONFIG_HOME takes precedence over XDG_CONFIG_HOME. If both are set, Glow uses GLOW_CONFIG_HOME.

Display Variables

PAGER

Specifies the pager program to use when the --pager flag is enabled.
PAGER
string
default:"less -r"
Command to use for paging output. The command is split on spaces to extract the program and arguments.
Example:
# Use bat as pager
export PAGER="bat --paging=always"
glow -p README.md

# Use less with custom flags
export PAGER="less -R -X -F"
glow -p document.md

# Use more
export PAGER="more"
glow -p notes.md
Source: main.go:317-329
The default less -r enables raw color output. The -r flag allows ANSI color codes to be displayed correctly.

EDITOR

Specifies the text editor for the glow config command.
EDITOR
string
default:"system-dependent"
Editor command used when running glow config. Falls back to system defaults if not set (typically vi or nano).
Example:
# Use VS Code
export EDITOR="code --wait"
glow config

# Use vim
export EDITOR="vim"
glow config

# Use nano
export EDITOR="nano"
glow config
Source: config_cmd.go:40-43

Rendering Variables

GLAMOUR_STYLE

Specifies the default Glamour rendering style for TUI mode.
GLAMOUR_STYLE
string
default:"auto"
Default style for rendering markdown in TUI mode. Can be a built-in style name or path to a JSON style file.
Example:
# Use dark style in TUI
export GLAMOUR_STYLE="dark"
glow

# Use custom style
export GLAMOUR_STYLE="$HOME/.config/glow/custom-style.json"
glow
Source: ui/config.go:10

Development and Debugging Variables

GLOW_HIGH_PERFORMANCE_PAGER

Enables high-performance paging mode in the TUI.
GLOW_HIGH_PERFORMANCE_PAGER
boolean
default:"true"
When set to true, enables optimized rendering performance in the TUI pager. This is primarily for debugging.
Example:
# Disable high-performance mode for debugging
export GLOW_HIGH_PERFORMANCE_PAGER="false"
glow
Source: ui/config.go:18

GLOW_ENABLE_GLAMOUR

Controls whether Glamour rendering is enabled.
GLOW_ENABLE_GLAMOUR
boolean
default:"true"
When set to false, disables Glamour rendering. This is primarily used for debugging and testing.
Example:
# Disable glamour rendering
export GLOW_ENABLE_GLAMOUR="false"
glow README.md
Source: ui/config.go:19

System Variables

HOME

User’s home directory, used for path resolution.
HOME
string
default:"system-defined"
Home directory for the current user. Used when resolving ~ in paths and locating default config directories.
Source: ui/config.go:8

GOPATH

Go workspace directory, tracked by the TUI.
GOPATH
string
default:"~/go"
Go workspace path. The TUI uses this to provide better navigation in Go projects.
Source: ui/config.go:7

Configuration Precedence

When multiple configuration sources are available, Glow uses this precedence order:
  1. Command-line flags (highest priority)
  2. Environment variables
  3. Configuration file (glow.yml)
  4. Built-in defaults (lowest priority)

Complete Example

Here’s a comprehensive example showing how to configure Glow using environment variables:
# Set config directory
export GLOW_CONFIG_HOME="$HOME/.config/glow"

# Set custom pager
export PAGER="less -R -X -F"

# Set editor for config command
export EDITOR="vim"

# Set rendering style for TUI
export GLAMOUR_STYLE="dark"

# Use XDG base directory
export XDG_CONFIG_HOME="$HOME/.config"

# Now use Glow
glow README.md                    # Uses settings above
glow config                       # Opens in vim
glow -p large-file.md            # Uses custom pager
glow                             # TUI with dark style

Persistent Configuration

To make environment variables permanent, add them to your shell profile:
# Glow configuration
export GLOW_CONFIG_HOME="$HOME/.config/glow"
export GLAMOUR_STYLE="dark"
export PAGER="less -R"
export EDITOR="vim"

Troubleshooting

Config File Not Found

If Glow can’t find your config file, verify the search paths:
# Check which config file Glow is using
glow --help
# Look for "config file (default ...)" in the --config flag description

Editor Not Opening

If glow config doesn’t open an editor:
# Verify EDITOR is set
echo $EDITOR

# Set it if empty
export EDITOR="vim"  # or nano, emacs, code, etc.

Pager Not Working

If the pager doesn’t display correctly:
# Verify PAGER is set correctly
echo $PAGER

# Test your pager directly
echo "test" | $PAGER

# Use default pager
unset PAGER
glow -p README.md

Build docs developers (and LLMs) love