Skip to main content

Overview

Glow uses a YAML configuration file (glow.yml) to customize its behavior. This file allows you to set default values for various options, avoiding the need to pass them as command-line flags every time.

Configuration File Locations

Glow searches for configuration files in the following locations, in order of precedence:
  1. GLOW_CONFIG_HOME - Custom config directory (highest priority)
  2. XDG_CONFIG_HOME/glow - XDG Base Directory specification
  3. User config directories - Platform-specific configuration paths
The environment variable GLOW_CONFIG_HOME takes precedence over all other locations. Use this to specify a custom configuration directory.

Default Paths by Platform

  • Linux: ~/.config/glow/glow.yml
  • macOS: ~/Library/Application Support/glow/glow.yml
  • Windows: %APPDATA%\glow\glow.yml

Creating and Editing the Config File

The easiest way to create or edit your configuration file is using the built-in config command:
glow config
This command:
  • Opens your config file in your default $EDITOR
  • Creates the file with default values if it doesn’t exist
  • Creates all necessary parent directories automatically
You can also specify a custom config file location:
glow config --config path/to/config.yml

Configuration Options

Here are all available configuration options with their default values:

Style Settings

style

Type: String
Default: "auto"
The style name or path to a custom JSON stylesheet. Built-in styles include:
  • auto - Automatically adapts to your terminal’s color scheme
  • dark - Dark color scheme
  • light - Light color scheme
  • pink - Pink color scheme
  • dracula - Dracula theme
  • notty - No TTY style (used when output is not a terminal)
You can also provide a path to a custom JSON style file.
style: "auto"
# Or use a built-in style
style: "dracula"
# Or use a custom style file
style: "~/.config/glow/styles/custom.json"

Layout Options

width

Type: Integer
Default: 80 (or terminal width if detected)
Word-wrap width for rendered markdown. Set to 0 to disable word wrapping.
width: 80
When running in a terminal, Glow automatically detects your terminal width. If the detected width exceeds 120 characters, it’s capped at 120 for better readability.

Display Options

pager

Type: Boolean
Default: false
Use a pager to display markdown output. Glow uses the $PAGER environment variable (defaults to less -r if not set).
pager: false

mouse

Type: Boolean
Default: false
Enable mouse wheel support in TUI mode.
mouse: false
Mouse support is only available in TUI mode and may not work in all terminal emulators.

File Handling

all

Type: Boolean
Default: false
Show all files, including hidden files and system files (TUI mode only).
all: false

Configuration Precedence

Glow follows this order of precedence when determining option values:
  1. Command-line flags (highest priority)
  2. Environment variables (prefixed with GLOW_)
  3. Configuration file
  4. Default values (lowest priority)

Example: Overriding Config with Flags

Even if your config file sets width: 80, you can override it:
glow --width 120 README.md

Environment Variables

You can also use environment variables to override config values:
GLOW_STYLE=pink glow README.md
GLOW_WIDTH=100 glow README.md

Example Configurations

Minimal Configuration

# Simple config with just the essentials
style: "auto"
width: 80

Developer Configuration

# Optimized for coding and documentation
style: "dracula"
width: 120
pager: false
all: true
mouse: true

Writer Configuration

# Optimized for writing and reading
style: "light"
width: 80
pager: true
mouse: false
all: false

Custom Style Configuration

# Using a custom Glamour style
style: "~/.config/glow/styles/my-theme.json"
width: 100
pager: false
mouse: true

File Format Requirements

Glow configuration files must:
  • Use .yml or .yaml extension
  • Follow valid YAML syntax
  • Be located in one of the searched directories
If you specify an invalid file extension (not .yml or .yaml), Glow will return an error.

Default Configuration

When Glow creates a new configuration file, it uses these defaults:
config_cmd.go
# style name or JSON path (default "auto")
style: "auto"
# mouse support (TUI-mode only)
mouse: false
# use pager to display markdown
pager: false
# word-wrap at width
width: 80
# show all files, including hidden and ignored.
all: false

Troubleshooting

Finding Your Active Config File

To see which config file Glow is using:
glow config
The file path will be displayed when you save and exit your editor.

Configuration Not Loading

If your configuration isn’t being applied:
  1. Verify the file is in the correct location
  2. Check the YAML syntax is valid
  3. Ensure the file has .yml or .yaml extension
  4. Check for environment variables that might override your settings

Permission Issues

If Glow can’t create the config directory:
mkdir -p ~/.config/glow
chmod 700 ~/.config/glow

Advanced Usage

Multiple Configurations

You can maintain multiple configuration files for different use cases:
# Use work config
glow --config ~/.config/glow/work.yml README.md

# Use personal config
glow --config ~/.config/glow/personal.yml README.md

Team Configuration

Share a team configuration using environment variables:
# Set in your shell profile or CI/CD
export GLOW_CONFIG_HOME="/path/to/team/config"

Build docs developers (and LLMs) love