stage has four ways to find something. They look similar and they answer different questions.
| Question | Tool | Keys |
|---|---|---|
| Where is that file? | Explorer | E, then / |
| Where is that text, in the repository? | Search | ctrl+g |
| Where is that text, in this file? | Find in view | / in the main pane |
| Show me less of this list | Panel filter | / in a panel |
The explorer
Section titled “The explorer”Press E to open the explorer. The explorer shows the whole working tree, and
not only the files that you changed. Press E again to go back to the git panel
that you used before.
The explorer and the search are the two panels of one window. Press ] or [
to move between them. You can also click the name of a panel.
| Keys | Action |
|---|---|
enter |
Open the file, or expand the directory |
l |
Expand the directory, then move into it |
h |
Collapse the directory, or move out to the parent |
e |
Open the file in your editor |
- / = |
Collapse or expand everything |
ctrl+v |
Change what the main pane shows |
] / [ |
Move to the search, and back |
E |
Go back to the git panel that you used before |
1-5 |
Go to a git panel |
Files that git ignores are shown in grey.
Move through the tree
Section titled “Move through the tree”h and l work one level at a time, as they do in a vim file explorer. The
arrow keys ← and → do the same. enter is different: it is one key for both
directions.
l expands the directory under the cursor. A second l moves into it. On a
file, l opens the file in the main pane.
h collapses the directory under the cursor. From a file, or from a directory
that is already collapsed, h moves to the parent directory and collapses it.
h walks back out of the tree that l walked into.
Edit a file
Section titled “Edit a file”e opens the file under the cursor in your editor. The files panel shows only
the files that you changed, so the explorer is the way to edit a clean file.
When the explorer shows the tree of a commit or a branch (U in a git panel),
e refuses. The file on screen is the copy from that commit, and your editor
would open the file on disk. Press esc to go back to the working tree.
Find a file by name
Section titled “Find a file by name”- Press
/. The filter input takes the keys. - Type part of the name.
- Press
enteron the file you want.
patch.ts is optional.The match is a subsequence, so patchts finds src/core/patch.ts. The search
also accepts a small number of wrong letters, so wathcer finds watcher.ts.
Search the whole repository
Section titled “Search the whole repository”Press ctrl+g to open the search. Other editors put this search behind a global
search command. The search is the second panel of the explorer window, so ]
and [ also reach it.
- Press
/in the search. The input takes the keys. - Type the text you want.
- Press
jorkto move through the results. - If the input is open, press
escfirst. An input takes every key. - Press
ctrl+gto go back to the git panel that you used before. Press1-5to go to a different panel.
The results change while you type. stage waits for a short pause before it runs the search. A fast typist gets one search, and not one search per letter. The panel shows the first 100 results.
The main pane previews the file of the result under the cursor, and it highlights the line that matched.
Search inside one file
Section titled “Search inside one file”Press / in the main pane to search the view you are reading.
| Keys | Action |
|---|---|
/ |
Start the search |
n |
Go to the next match |
N |
Go to the previous match |
enter |
Keep the position and close the input |
esc |
Cancel, and go back to where you were |
stage shows the number of matches while you type. n and N move through them
and continue from the start after the last one.
Filter a panel
Section titled “Filter a panel”Press / in any panel to narrow that list. Press esc to clear the filter.
The search engine
Section titled “The search engine”stage embeds fff, a search engine written in Rust. stage uses it for the file
filter and for the search. Git information never comes from fff — the
git binary is the only source for that.
If fff cannot load, the filter matches plain substrings instead, and the search says that it is not available. stage starts either way.
To read which mode you are in, press ; and open the About section.
| Method | Effect |
|---|---|
STAGE_NO_FFF=1 |
Starts stage without fff |