119 lines
5.9 KiB
Markdown
119 lines
5.9 KiB
Markdown
# Search
|
|
|
|
Search covers the whole window, edge to edge, like the [Git view](git.md). One query searches the open file, the contents of the project and the file names at the same time.
|
|
|
|
[Guide index](index.md) · Related: [Go to file](go-to-file.md), [File view](file-view.md), [Explorer](explorer.md)
|
|
|
|
## At a glance
|
|
|
|
```text
|
|
+----------------------------------------------------------------------------+
|
|
| (1) Q handle_ (2) [php][md] (3) 3 here . 39 hits . 2 f |
|
|
+----------------------+---------------------------------+-------------------+
|
|
| (4) app.php 3 | (5) PROJECT 39 | (6) FILES 2 |
|
|
| 12 function handle | src/app.php 3 | Handler.php |
|
|
| 40 $this->handle( | 12 function handle() { | src/ |
|
|
| 88 handle($r); | 40 $this->handle($x); | handle.md * |
|
|
| | tests/AppTest.php 1 | docs/ |
|
|
| | 7 ->handle() | |
|
|
+----------------------+---------------------------------+-------------------+
|
|
| (7) Cmd+Left / Cmd+Right column Cmd+Up / Cmd+Down row Enter open esc |
|
|
+----------------------------------------------------------------------------+
|
|
```
|
|
|
|
1. **Query field**: type here. The field has the keyboard as soon as Search opens.
|
|
2. **Type chips**: one chip per file type in the results. Click one to show only that type.
|
|
3. **Summary**: hits in this file, hits in the project, and matching file names.
|
|
4. **This file**: matches in the open file. Only shown when a file is open.
|
|
5. **Project**: content matches in the whole project, grouped per file.
|
|
6. **Files**: file names that match the query.
|
|
7. **Footer**: the keys, and an `esc` chip.
|
|
|
|
## Features
|
|
|
|
### Opening search
|
|
- Press `Cmd+F`, or click **Search** in the [title bar](title-bar.md).
|
|
- With text selected in the file view, the query starts with the first line of that selection.
|
|
- Search covers the whole window, title bar and status bar included, with no margin. Press `Esc` to close it.
|
|
|
|
### Typing
|
|
- Results update as you type.
|
|
- **This file** and **Files** search from the first character.
|
|
- **Project** searches from two characters, after a very short pause. Each new key cancels the older search.
|
|
- Leading and trailing spaces are ignored.
|
|
- **This file** ignores case.
|
|
- **Project** ignores case, unless the query holds a capital letter. Then it matches case exactly.
|
|
- **Files** is fuzzy: the letters must appear in order, not next to each other. `hdlr` finds `Handler.php`. Matched letters are amber.
|
|
- File names that match on the name come first, before matches that only hit the folder path. Earlier and shorter matches rank higher.
|
|
|
|
### The three columns
|
|
- The columns keep a fixed width: This file 30 percent, Project 45 percent, Files 25 percent. Without an open file: Project 65 percent, Files 35 percent.
|
|
- Moving the focus does not change a width. The focused column's title and count turn amber.
|
|
- Each project file shows its path and its number of hits. Up to 12 hit lines are shown per file; the count still tells the full number.
|
|
- Each hit line shows its line number and the line, with the match highlighted.
|
|
- In **Files**, the folder sits below the name. An amber dot marks a file with uncommitted git changes.
|
|
|
|
### Type chips
|
|
- Chips appear when the results hold more than one file type. The most common type comes first.
|
|
- Click a chip to show only that type in Project and Files. Click it again to show every type.
|
|
- Hover a chip to see how many results it has.
|
|
|
|
### Opening a result
|
|
- Press `Enter` or click a row. Search closes and the file opens in the [file view](file-view.md).
|
|
- A content hit opens the file at that line.
|
|
- Click a file header in Project to open the file at its first hit.
|
|
- A file name opens the file at the top.
|
|
- When the focused column is empty, `Enter` opens the first result of the other kind.
|
|
|
|
### Mouse and keyboard
|
|
- Moving the pointer over a row selects it and focuses its column.
|
|
- When you move with the keyboard, a pointer that does not move does not steal the selection.
|
|
|
|
### What is searched
|
|
- The whole project, including dotfiles such as `.env`.
|
|
- Hidden files and folders (those starting with a dot) only show when **Hidden** (`Cmd+.`) is on. See [Layout](layout.md).
|
|
- Some folders are always skipped: `node_modules`, `.git`, `vendor`, `dist`, `build`, `out`, `coverage`, `.cache`, `.next`, `.nuxt`, `.turbo`, `.idea`, `.vscode` and `.helder`.
|
|
- Add your own skips with `files.exclude`.
|
|
- Git-ignored files are searched too, unless you set `files.followGitignore` to `true`.
|
|
|
|
### No results
|
|
Each column says why it is empty:
|
|
- "Type to search this file." / "No matches in this file."
|
|
- "Type at least two characters." / "No content matches."
|
|
- "Type to search file names." / "No file names match."
|
|
|
|
### Limits
|
|
- Project: at most 400 files and 50 hits per file. Very long lines are cut.
|
|
- Files: the first 40 matches are listed. The count shows the full number.
|
|
- This file: at most 200 hits.
|
|
- Up to 12 type chips.
|
|
|
|
## Keyboard
|
|
|
|
| Keys | Action |
|
|
|---|---|
|
|
| `Cmd+F` | Open Search |
|
|
| `Cmd+Left` / `Cmd+Right` | Previous / next column |
|
|
| `Up` / `Down` | Previous / next row in the column |
|
|
| `Cmd+Up` / `Cmd+Down` | Previous / next row in the column |
|
|
| `Enter` | Open the selected result |
|
|
| `Esc` | Close Search |
|
|
|
|
## Settings
|
|
|
|
| Setting | Default | Effect |
|
|
|---|---|---|
|
|
| `files.exclude` | `[]` | Extra globs to leave out of search and the Explorer. |
|
|
| `files.followGitignore` | `false` | `true` leaves git-ignored files out. |
|
|
|
|
See [Configuration](configuration.md).
|
|
|
|
## Related
|
|
|
|
- [Go to file](go-to-file.md): jump back to a file you opened before.
|
|
- [File view](file-view.md): where a result opens.
|
|
- [Explorer](explorer.md): uses the same excludes.
|
|
- [Layout](layout.md): the Hidden toggle that shows dotfiles in search.
|
|
- [Title bar](title-bar.md): the Search button.
|
|
- [Keyboard shortcuts](keyboard-shortcuts.md): every key in one list.
|