Glow Markdown in the terminal

Version 3.0.0 · source

Start here

glow
Browse Markdown files
glow <file.md>
Render a file
glow -p <file.md>
Read in a pager
glow <owner>/<repo>
Show a GitHub README
glow <url>
Render a remote file
<cmd> | glow -
Render stdin
glow -s dark
Pick a style
?
Show keys in the viewer

Concepts

  1. Source file, stdin, repo, URL
  2. Styled text -s, -w
  3. Terminal or pager less -r by default

Rendering

glow
Browse Markdown in the current directory
glow <file.md>
Render a file to the terminal
glow <dir>
Browse a specific directory
<cmd> | glow -
Render Markdown from stdin
glow <owner>/<repo>
Show a GitHub or GitLab README
glow github.com/<owner>/<repo>
Same, with explicit host
glow https://<host>/<file>.md
Fetch and render a URL
glow -t
Force the TUI browser
glow --version
Print the version
glow --help
List flags and the config path

Output options

glow -p <file.md>
Show output in a pager
glow -s <style>
Choose a style by name or JSON path
glow -s dark
Use the dark style
glow -s light
Use the light style
glow -s <file>.json
Use a custom style file
glow -w <cols>
Wrap lines at a width
glow -n
Keep single newlines as line breaks
glow -a
Include hidden and ignored files in TUI
glow -l
Show line numbers in the TUI viewer
glow -m
Enable mouse wheel in the TUI

Keys (browser and viewer)

j / k
Move or scroll down / up
Enter
Open the selected document
/
Filter the file list
Esc
Back to the list; clear the filter
g / G
Jump to top / bottom
Tab / Shift+Tab
Next or previous section
e
Edit the selected or open file
F
Reload the local file search
f / b
Page down / up
?
Toggle the key help
q
Quit
d / u
Viewer: half page down / up
c
Viewer: copy document to clipboard
r
Viewer: reload file from disk

Config and environment

glow config
Open glow.yml in your editor
PAGER=<cmd> glow -p <file.md>
Use another pager for -p
GLOW_STYLE=<style>
Set the default style via env
GLOW_WIDTH=<cols>
Set the default wrap width via env
glow completion <shell>
Generate shell completions
glow man
Print a man page
Keys in glow.yml
Key Effect
style default style (auto)
width wrap width
pager always use the pager
tui always open the TUI
showLineNumbers line numbers in TUI
preserveNewLines keep newlines

Recipes

Read a project README in a pager
glow -p README.mdglow -p -w 80 docs/guide.md
Preview Markdown from a command
git show HEAD:README.md | glow -curl -s https://<host>/notes.md | glow -
Try a style or a custom theme
glow -s light README.mdglow -s ./mytheme.json README.md
Browse docs in a monorepo
cd <repo>glow docs