Overview
Glow’s TUI (Terminal User Interface) supports extensive keyboard navigation, inspired by Vim and popular pagers likeless. 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.Navigation
| Shortcut | Action | Description |
|---|---|---|
j, ↓, ctrl+j | Move down | Move cursor down one item |
k, ↑, ctrl+k | Move up | Move cursor up one item |
g, home | Go to top | Jump to first document |
G, end | Go to bottom | Jump to last document |
h, ← | Previous page | Go to previous page |
l, → | Next page | Go to next page |
b, u | Page up | Scroll up one page |
f, d | Page down | Scroll 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
| Shortcut | Action | Description |
|---|---|---|
enter | Open file | Open selected markdown file in pager |
e | Edit file | Open file in $EDITOR |
r | Refresh | Reload file list from disk |
F | Force refresh | Re-scan directory for files |
Filtering and Search
| Shortcut | Action | Description |
|---|---|---|
/ | Start filter | Enter filtering mode |
esc | Clear filter | Cancel filter or return to normal mode |
enter | Confirm filter | Apply filter and show results |
ctrl+j, ctrl+k | Navigate results | Move 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
enterwith one result to open it immediately - Press
enterwith multiple results to browse the filtered list - Press
escto cancel and return to the full file list
Sections and Tabs
| Shortcut | Action | Description |
|---|---|---|
tab, L | Next section | Switch to next section/tab |
shift+tab, H | Previous section | Switch to previous section/tab |
Sections appear when you have both regular documents and filtered results. Use tabs to switch between them.
General
| Shortcut | Action | Description |
|---|---|---|
? | Toggle help | Show/hide full help menu |
! | Show errors | Display error messages (if any) |
q | Quit | Exit Glow |
Document Viewer Shortcuts
The pager view appears when you open a markdown document from the file browser or directly from the command line.Navigation
| Shortcut | Action | Description |
|---|---|---|
k, ↑ | Up | Scroll up one line |
j, ↓ | Down | Scroll down one line |
b, pgup | Page up | Scroll up one page |
f, pgdn | Page down | Scroll down one page |
u | Half page up | Scroll up half a page |
d | Half page down | Scroll down half a page |
g, home | Go to top | Jump to beginning of document |
G, end | Go to bottom | Jump to end of document |
ui/pager.go
Document Operations
| Shortcut | Action | Description |
|---|---|---|
c | Copy contents | Copy entire document to clipboard |
r | Reload | Reload document from disk |
e | Edit | Open 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 presse:
- 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
View Controls
| Shortcut | Action | Description |
|---|---|---|
? | Toggle help | Show/hide keyboard shortcuts |
esc | Back | Return to file browser |
q | Back | Return 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)
glow.yml
Context-Specific Shortcuts
Status Message Active
When a status message is displayed:| Shortcut | Action |
|---|---|
q, esc | Dismiss message and return to normal mode |
Error View
When viewing errors (press! in stash):
| Shortcut | Action |
|---|---|
| Any key | Return 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- openj/k ↑/↓- choose/- findr- refreshe- editq- 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
Cheat Sheet
Quick Reference: File Browser
Quick Reference: Document Viewer
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 terminalsshift+tab- May require terminal configuration
Special Keys
home,end,pgup,pgdn- Usually work but may vary by terminal
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,Gnavigation - less -
b,f,d,upaging - Standard TUI - Arrow keys,
enter,esc,tab
Tips for Efficient Navigation
Learning Path
- Start with arrow keys - Familiar and intuitive
- Add vim keys -
j/kfor up/down,g/Gfor top/bottom - Master paging -
d/ufor half-page,f/bfor full-page - Use filtering -
/to quickly find files
Pro Tips
- Combine shortcuts: Press
gthen?to see help from the top - Use filtering over scrolling:
/+ fuzzy search is faster than scrolling through long lists - Edit at position: Press
ein the pager to open your editor at the current line - Quick refresh: After editing files externally, press
rorFto 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
rstill works)
ui/pager.go