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:GLOW_CONFIG_HOME- Custom config directory (highest priority)XDG_CONFIG_HOME/glow- XDG Base Directory specification- 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:- 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
Configuration Options
Here are all available configuration options with their default values:Style Settings
style
Type: StringDefault:
"auto"
The style name or path to a custom JSON stylesheet. Built-in styles include:
auto- Automatically adapts to your terminal’s color schemedark- Dark color schemelight- Light color schemepink- Pink color schemedracula- Dracula themenotty- No TTY style (used when output is not a terminal)
Layout Options
width
Type: IntegerDefault:
80 (or terminal width if detected)
Word-wrap width for rendered markdown. Set to 0 to disable word wrapping.
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: BooleanDefault:
false
Use a pager to display markdown output. Glow uses the $PAGER environment variable (defaults to less -r if not set).
mouse
Type: BooleanDefault:
false
Enable mouse wheel support in TUI mode.
File Handling
all
Type: BooleanDefault:
false
Show all files, including hidden files and system files (TUI mode only).
Configuration Precedence
Glow follows this order of precedence when determining option values:- Command-line flags (highest priority)
- Environment variables (prefixed with
GLOW_) - Configuration file
- Default values (lowest priority)
Example: Overriding Config with Flags
Even if your config file setswidth: 80, you can override it:
Environment Variables
You can also use environment variables to override config values:Example Configurations
Minimal Configuration
Developer Configuration
Writer Configuration
Custom Style Configuration
File Format Requirements
Glow configuration files must:- Use
.ymlor.yamlextension - Follow valid YAML syntax
- Be located in one of the searched directories
Default Configuration
When Glow creates a new configuration file, it uses these defaults:config_cmd.go
Troubleshooting
Finding Your Active Config File
To see which config file Glow is using:Configuration Not Loading
If your configuration isn’t being applied:- Verify the file is in the correct location
- Check the YAML syntax is valid
- Ensure the file has
.ymlor.yamlextension - Check for environment variables that might override your settings