Back to docs
reference

CLI & TUI Reference

Terminal Interface Reference

Strayfiles includes a terminal user interface (TUI) with vim-style keybindings. This reference covers all commands and shortcuts.

Launching the TUI

strayfiles

Or with a specific directory:

strayfiles ~/notes

Global Keybindings

These work in any mode:

KeyAction
qQuit / Close dialog
?Show help
Ctrl+cForce quit
EscCancel / Back

File Browser

KeyAction
j / Move down
k / Move up
h / Collapse / Go to parent
l / Expand / Enter directory
EnterOpen note
ggGo to top
GGo to bottom
Ctrl+dPage down
Ctrl+uPage up

Numbering Mode

KeyAction
1-9Start number input
j / kMove by count
EscCancel numbering

Example: 5j moves down 5 items.

Editor Mode

The editor displays two modes:

  • VIEW: Read-only markdown preview (for .md files)
  • EDIT: Text editing with vim-style commands

Vim Commands (in EDIT mode)

KeyAction
iEnter insert mode
aEnter insert mode (after cursor)
oNew line below, enter insert
ONew line above, enter insert
IInsert at line start
AInsert at line end
sDelete char and insert
SDelete line and insert
ddDelete line
yyYank (copy) line
ccChange line
pPaste below
uUndo
Ctrl+rRedo
~Toggle case
xDelete character

Movement Keys

KeyAction
h / j / k / lLeft / Down / Up / Right
wMove to next word
eMove to end of word
bMove to previous word
0Move to line start
$Move to line end
^Move to first non-blank
GMove to end of file
ggMove to top of file

Insert Mode

KeyAction
EscReturn to normal mode
Regular typingInsert text

Operators with Motions

Combine operators (d, y, c) with motions:

CommandAction
dwDelete word
deDelete to end of word
dbDelete to previous word
d$Delete to end of line
d0Delete to start of line
diwDelete inside word
ywYank word
cwChange word

Number Prefixes

Prefix any command with a number to repeat:

CommandAction
3jMove down 3 lines
5ddDelete 5 lines
2yyYank 2 lines
10GGo to line 10

File Operations

KeyAction
:wSave
:qQuit
:wqSave and quit
:eReload file

Discovery Mode

KeyAction
/Open search
EnterExecute search
TabToggle file selection
SpaceToggle file selection
aSelect all
Enter (on results)Add selected files

Dialog Navigation

KeyAction
TabNext field
Shift+TabPrevious field
EnterConfirm
EscCancel
j / kNavigate options

Search Syntax

Within the TUI search:

# Basic search
meeting notes

# Workspace filter
workspace:work

# Tag filter
tag:urgent

# Combined
workspace:work tag:api documentation

Status Bar

The status bar shows:

[mode] filename [modified] [sync status] [line:col]
  • Mode: VIEW (preview) or EDIT (editing)
  • Modified: [+] if unsaved changes
  • Sync status: Connected, Disconnected, Syncing

Theme Customization

The TUI supports themes. Configure in settings:

~/.strayfiles/config.csv

Theme settings:

  • Colors for syntax highlighting
  • Status bar colors
  • Selection colors

Markdown Preview

KeyAction
Ctrl+pToggle preview mode

Preview mode renders Markdown with syntax highlighting.

Command Mode

Enter command mode with ::

CommandAction
:wWrite (save)
:qQuit
:wqWrite and quit
:q!Quit without saving
:eReload
:set nuShow line numbers
:set nonuHide line numbers
:helpShow help

Workspace Switching

KeyAction
gwOpen workspace picker
1-9Quick switch to workspace

Tips

Quick navigation: Use gg and G to jump to start/end of file list.

Efficient editing: Use operators with motions (e.g., dw to delete word, de to delete to end of word).

Search workflow: / to search, n/N to navigate results, Esc to return to editing.

Multiple selections: In discovery mode, use Tab to select multiple files before adding.

Troubleshooting

Keys not working:

  • Check terminal compatibility
  • Some terminals intercept certain key combinations
  • Try a different terminal emulator

Colors wrong:

  • Ensure terminal supports 256 colors
  • Set TERM=xterm-256color if needed

Unicode issues:

  • Use a font with good Unicode support
  • Check terminal encoding is UTF-8