Search
Rune gives you several ways to find code, each suited to a different question. This guide covers the structural search built on tree-sitter (jump to a definition in the current file, or across the workspace) and the fuzzy finders for files and symbols. It also points you at the two neighboring tools: semantic symbol search for first-class languages, and the location picker for turning any command's output into a jump list.
At a glance:
| You want to | Command | Default keybinding |
|---|---|---|
| Jump to a function in the current file | jumptoast | <alt-f> |
| Jump to a variable in the current file | jumptoast | <alt-v> |
| Jump to a type in the current file | jumptoast | <alt-s> |
| Find a function definition anywhere in the workspace | searchast | <alt-shift-f> |
| Find a variable definition anywhere in the workspace | searchast | <alt-shift-v> |
| Find a type definition anywhere in the workspace | searchast | <alt-shift-s> |
| Search a file by name | searchfile | <meta-p> |
| Search file contents across the workspace | searchtext | <meta-\> |
| Jump to an arbitrary symbol's definition | lsp definition <symbol> | <alt-shift-d> |
| Open an arbitrary symbol's documentation | lsp hover <symbol> | <alt-shift-t> |
| List an arbitrary symbol's references | lsp references <symbol> | <alt-shift-r> |
Turn any grep/rg output into a jump list | locationpicker <program> | (define your own) |
Structural search and navigation
Every language package ships a tree-sitter grammar and query files, so Rune has a real parse tree for the file instead of plain text. Two commands query that tree using tree-sitter patterns:
jumptoastjumps the cursor to a node in the current file. Its syntax isjumptoast <query> <captures> <name>, where<query>is a query file (such aslocals.scm),<captures>is one or more capture names joined by|, and<name>selects the matching line.searchastruns the same kind of query across every file in the workspace and presents the matches in a fuzzy picker. Its syntax issearchast <query> <captures>.
The default config wires these to keys and prompt aliases so you rarely type the raw form.
Jump within the current file
The jumptoast bindings prefill the prompt with the command and leave
it open, so you can fuzzy search the functions, variables, or types in
the file and jump to the one you pick:
| Key | Jumps to |
|---|---|
<alt-f> | a function or method |
<alt-v> | a variable |
<alt-s> | a type |
Search across the workspace
To search every file, use the searchast aliases; each has a matching
key binding and a prompt alias you can type by name:
| Key | Alias | Searches for |
|---|---|---|
<alt-shift-f> | searchfunc | functions and methods |
<alt-shift-v> | searchvar | variables |
<alt-shift-s> | searchtype | types |
They open a fuzzy picker over every matching definition in the
workspace; selecting a result jumps you straight to it. All of these
query locals.scm filtered by the
local.definition.function/.method, local.definition.var, and
local.definition.type captures.
A language package supplies the query files these commands read, so structural search lights up for any installed language. See Supported Languages for the full list and how packages install.
The fuzzy file and symbol finders
The file finder (searchfile) and symbol finder are floating surfaces:
they appear on top of your windows, take focus while open, and get out
of the way when you are done, without disturbing the windows underneath.
Type to fuzzy-filter, move through the matches, and press <enter> to
open the selection in the window you were last working in.
The fuzzy match is deterministic, so the shortest sequence that singles out a name always ranks it first. Spend a few seconds finding that sequence once and it becomes reflex, the same way the command prompt's fuzzy finder works for commands.
Semantic symbol search
For first-class languages such as Go, Rune adds language-server symbol search on top of the structural tools. Instead of matching the parse tree, it queries the language server, so you can jump to a definition, list references, or find implementations of a symbol by name with full code intelligence. See Query any symbol by name for the commands and bindings.
Turn command output into a jump list
When the thing you want to find is best expressed as a shell command,
the location picker runs any program that prints
path:line:col locations (grep, git grep, rg, awk, or your own
script) and presents every line as a fuzzy-filterable entry with a live
preview. It is the bridge between Rune's structured search and the
text-search tools you already know.