Skip to main content

Overview

Glow’s TUI (Terminal User Interface) supports extensive keyboard navigation, inspired by Vim and popular pagers like less. This guide covers all available keyboard shortcuts for both the file browser (stash) and the document viewer (pager).

File Browser Shortcuts

The file browser (stash) is the main interface when you launch Glow without arguments or with a directory.
ShortcutActionDescription
j, , ctrl+jMove downMove cursor down one item
k, , ctrl+kMove upMove cursor up one item
g, homeGo to topJump to first document
G, endGo to bottomJump to last document
h, Previous pageGo to previous page
l, Next pageGo to next page
b, uPage upScroll up one page
f, dPage downScroll down one page
The stash uses pagination when there are more documents than fit on screen. Use arrow keys or vim-style navigation to move between pages.

File Operations

ShortcutActionDescription
enterOpen fileOpen selected markdown file in pager
eEdit fileOpen file in $EDITOR
rRefreshReload file list from disk
FForce refreshRe-scan directory for files
ShortcutActionDescription
/Start filterEnter filtering mode
escClear filterCancel filter or return to normal mode
enterConfirm filterApply filter and show results
ctrl+j, ctrl+kNavigate resultsMove through filtered results
Filtering uses fuzzy search, so you don’t need to type the exact filename. Type partial matches to quickly find files.

Filter Mode Behavior

When in filter mode:
  • Type to search through file names and paths
  • Results update in real-time as you type
  • Press enter with one result to open it immediately
  • Press enter with multiple results to browse the filtered list
  • Press esc to cancel and return to the full file list

Sections and Tabs

ShortcutActionDescription
tab, LNext sectionSwitch to next section/tab
shift+tab, HPrevious sectionSwitch to previous section/tab
Sections appear when you have both regular documents and filtered results. Use tabs to switch between them.

General

ShortcutActionDescription
?Toggle helpShow/hide full help menu
!Show errorsDisplay error messages (if any)
qQuitExit Glow

Document Viewer Shortcuts

The pager view appears when you open a markdown document from the file browser or directly from the command line.
ShortcutActionDescription
k, UpScroll up one line
j, DownScroll down one line
b, pgupPage upScroll up one page
f, pgdnPage downScroll down one page
uHalf page upScroll up half a page
dHalf page downScroll down half a page
g, homeGo to topJump to beginning of document
G, endGo to bottomJump to end of document
ui/pager.go
case "home", "g":
    m.viewport.GotoTop()
case "end", "G":
    m.viewport.GotoBottom()
case "d":
    m.viewport.HalfViewDown()
case "u":
    m.viewport.HalfViewUp()

Document Operations

ShortcutActionDescription
cCopy contentsCopy entire document to clipboard
rReloadReload document from disk
eEditOpen current document in $EDITOR
The copy command (c) uses both OSC 52 terminal sequences and the native system clipboard for maximum compatibility.

Edit Behavior

When you press e:
  • Glow opens the file at the current scroll position
  • Your editor’s line number is set to match your reading position
  • After editing and exiting, Glow automatically reloads the document
ui/pager.go
case "e":
    lineno := int(math.RoundToEven(float64(m.viewport.TotalLineCount()) * m.viewport.ScrollPercent()))
    if m.viewport.AtTop() {
        lineno = 0
    }
    return m, openEditor(m.currentDocument.localPath, lineno)

View Controls

ShortcutActionDescription
?Toggle helpShow/hide keyboard shortcuts
escBackReturn to file browser
qBackReturn to file browser (same as esc)

Mouse Support

When enabled with --mouse or mouse: true in your config:
  • Scroll wheel - Scroll through documents and file lists
  • Click - Select items in file browser (limited support)
Mouse support is experimental and may not work in all terminal emulators. It’s disabled by default.
Enable mouse support:
glow --mouse
Or in your config:
glow.yml
mouse: true

Context-Specific Shortcuts

Status Message Active

When a status message is displayed:
ShortcutAction
q, escDismiss message and return to normal mode

Error View

When viewing errors (press ! in stash):
ShortcutAction
Any keyReturn to file browser

Help View Shortcuts

Both the stash and pager have built-in help accessible with ?:

Stash Help (Mini)

Shows common shortcuts in a single line at the bottom:
  • enter - open
  • j/k ↑/↓ - choose
  • / - find
  • r - refresh
  • e - edit
  • q - quit
  • ? - more

Stash Help (Full)

Press ? to expand the help menu showing all available shortcuts in a multi-column layout.

Pager Help

In the pager, press ? to see navigation shortcuts:
ui/pager.go
col1 := []string{
    "g/home  go to top",
    "G/end   go to bottom",
    "c       copy contents",
    "e       edit this document",
    "r       reload this document",
    "esc     back to files",
    "q       quit",
}
The help appears at the bottom of the screen, overlaying the document content.

Cheat Sheet

Quick Reference: File Browser

┌─ Navigation ──────────────┐  ┌─ Actions ────────────────┐
│ j/k, ↑/↓    move          │  │ enter      open          │
│ g/G          top/bottom   │  │ e          edit          │
│ h/l, ←/→     page         │  │ /          filter        │
│ b/f, u/d     scroll       │  │ esc        clear/back    │
└───────────────────────────┘  └──────────────────────────┘

┌─ General ─────────────────┐
│ tab          next section │
│ ?            help         │
│ r            refresh      │
│ q            quit         │
└───────────────────────────┘

Quick Reference: Document Viewer

┌─ Navigation ──────────────┐  ┌─ Actions ────────────────┐
│ j/k, ↑/↓    line          │  │ c          copy          │
│ g/G          top/bottom   │  │ e          edit          │
│ u/d          half page    │  │ r          reload        │
│ b/f          page         │  │ esc/q      back          │
└───────────────────────────┘  └──────────────────────────┘

┌─ View ────────────────────┐
│ ?            toggle help  │
└───────────────────────────┘

Terminal Compatibility

Most shortcuts work in all terminal emulators, but some have specific requirements:

Universal Shortcuts

  • Arrow keys (, , , )
  • Enter, Escape
  • Letters (j, k, g, G, etc.)
  • Function keys

Control Sequences

  • ctrl+j, ctrl+k - Work in most terminals
  • shift+tab - May require terminal configuration

Special Keys

  • home, end, pgup, pgdn - Usually work but may vary by terminal
If special keys don’t work in your terminal, use the alternative shortcuts (g/G instead of home/end, b/f instead of pgup/pgdn).

Customization

Currently, keyboard shortcuts are not customizable. They are hard-coded in the TUI implementation to maintain consistency with standard Unix tools.
Keyboard shortcuts follow established conventions from:
  • Vim - hjkl, gg, G navigation
  • less - b, f, d, u paging
  • Standard TUI - Arrow keys, enter, esc, tab

Tips for Efficient Navigation

Learning Path

  1. Start with arrow keys - Familiar and intuitive
  2. Add vim keys - j/k for up/down, g/G for top/bottom
  3. Master paging - d/u for half-page, f/b for full-page
  4. Use filtering - / to quickly find files

Pro Tips

  • Combine shortcuts: Press g then ? to see help from the top
  • Use filtering over scrolling: / + fuzzy search is faster than scrolling through long lists
  • Edit at position: Press e in the pager to open your editor at the current line
  • Quick refresh: After editing files externally, press r or F to reload

File Watching

Glow automatically watches files for changes when viewing them:
  • Files are monitored using fsnotify
  • Changes automatically trigger a reload
  • No manual refresh needed (but r still works)
ui/pager.go
case event, ok := <-m.watcher.Events:
    if !ok || event.Name != m.currentDocument.localPath {
        continue
    }
    if !event.Has(fsnotify.Write) && !event.Has(fsnotify.Create) {
        continue
    }
    return reloadMsg{}
This is especially useful when editing files in another window.

Build docs developers (and LLMs) love