FindItFaster: Sonar
Fork of FindItFaster. Linux + WSL. File/content search powered by What's new
What's different from upstream
Install
Missing WSL on Windows
CommandsPrefix:
The Query syntax
fzf extended-search syntax (Search file, Search within current file)
Examples:
rg regex +
|
| Token | Effect | rg flag |
|---|---|---|
c |
rg type (e.g. .c/.h) |
-t c |
!c |
exclude C files | -T c |
*.c |
glob | -g '*.c' |
!*_test.c |
negated glob | -g '!*_test.c' |
src/** |
top-level src/ only |
-g 'src/**' |
!node_modules/** |
top-level node_modules/ only |
-g '!node_modules/**' |
.md |
shorthand for *.md |
-g '*.md' |
Glob vs type: contains *?/. → glob, otherwise rg type. rg --type-list for types.
Path globs are root-anchored. src/** matches top-level src/ only — use **/src/** for nested. Same for !node_modules/**.
Examples:
todo // c # "todo" in C files
handler // py !*_test.py # "handler" in Python, skip test files
foo // src/** # "foo" under top-level src/ (use **/src/** for nested)
config // *.json !**/dist/** # "config" in JSON, skip dist dirs
^import .* from // ts # regex on the left, file filter on the right
Empty pattern: // py lists every .py file.
Recipes
First word = which command to run.
Find files
Search file .svg$ every SVG
Search file ^src/ .ts$ | .tsx$ TS/TSX under src/
Search file 'README literal "README" in name
Search file migration !.sql$ "migration" but not .sql
Search file !test !spec neither test nor spec
Search file ^docs .md$ markdown under docs/
Search file config | settings .json$ config.json or settings.json
Search within files
Search within files TODO // py TODOs in Python
Search within files ^def\s+\w+ // py Python function defs
Search within files use[A-Z]\w+ // ts React hooks (ts covers .tsx)
Search within files from 'lodash' // ts js lodash imports
Search within files ^class\s+\w+ // java kotlin class declarations
Search within files https?://\S+ // md URLs in markdown
Search within files TODO|FIXME|XXX // !*_test.* todos outside tests
Search within files FIXME // src/** !*.lock fixmes under src/, not lockfiles
Search within files // py list all .py files
Search within current file
Search within current file .error$ lines ending in "error"
Search within current file ^return lines starting with `return`
Search within current file 'throw lines with literal "throw"
Search within current file TODO | FIXME either tag
Fastest: rg pre-filter (large repos)
ctrl+shift+alt+j → "svg" # only .svg files
ctrl+shift+alt+u → "py" # within .py only
Tips
ctrl+p/ctrl+n— query history (30 entries, persisted)ctrl+v— paste (needs fzf ≥ 0.38 + clipboard tool)ctrl+x— clear query
Settings
@ext:stoffej.fif-sonar in settings. Keys under fif-sonar.*.
General
| Key | Default | Purpose |
|---|---|---|
general.hideTerminalAfterSuccess |
true |
Hide terminal after pick. |
general.hideTerminalAfterFail |
true |
Also hide on cancel. |
general.clearTerminalAfterUse |
true |
clear before hiding. |
general.killTerminalAfterUse |
true |
Dispose terminal fully. |
general.showMaximizedTerminal |
false |
Maximize while picking. |
general.useGitIgnoreExcludes |
true |
Honor .gitignore. |
general.useWorkspaceSearchExcludes |
true |
Honor search.exclude. |
general.batTheme |
"1337" |
Preview theme. |
general.openFileInPreviewEditor |
false |
Open as Preview tabs. |
general.restoreFocusTerminal |
false |
Re-focus prior terminal after pick. |
general.useTerminalInEditor |
true |
Terminal in editor area. |
general.shellPathForTerminal |
"/bin/bash" |
Shell used. |
general.shellArgsForTerminal |
["--norc", "--noprofile"] |
Skip rc for fast spawn. |
Find files
| Key | Default | Purpose |
|---|---|---|
findFiles.showPreview |
true |
bat preview pane. |
findFiles.previewCommand |
(built-in) | {} = filename. |
findFiles.previewWindowConfig |
(built-in) | fzf --preview-window. |
findFiles.fzfDefaultCommand |
"" |
Custom lister; empty = rg --files. |
Find within files
| Key | Default | Purpose |
|---|---|---|
findWithinFiles.showPreview |
true |
Preview pane. |
findWithinFiles.previewCommand |
(built-in) | {1} = file, {2} = line. |
findWithinFiles.previewWindowConfig |
(built-in) | --preview-window. |
findWithinFiles.fuzzRipgrepQuery |
false |
Whitespace → .*. |
Advanced
| Key | Default | Purpose |
|---|---|---|
advanced.disableStartupChecks |
true |
Skip per-activation tool checks. |
advanced.useEditorSelectionAsQuery |
true |
Seed query from selection. |
Example settings
// git ls-files as lister
"fif-sonar.findFiles.fzfDefaultCommand": "git ls-files --cached --others --exclude-standard"
// keep terminal after pick
"fif-sonar.general.hideTerminalAfterSuccess": false,
"fif-sonar.general.killTerminalAfterUse": false
// use zsh
"fif-sonar.general.shellPathForTerminal": "/bin/zsh",
"fif-sonar.general.shellArgsForTerminal": []
// loose matching
"fif-sonar.findWithinFiles.fuzzRipgrepQuery": true
FAQ
Ctrl+K doesn't move up in fzf. Set "terminal.integrated.allowChords": false.
Files from other folders don't show up. Picker uses terminal cwd. Open the wider folder, or set findFiles.fzfDefaultCommand.
Terminal closes before I can read an error. On precondition failure the extension keeps it open. If it still disappears, a workspace override on hideTerminalAfterFail may be overriding the extension.
ctrl+v doesn't paste. Requires fzf ≥ 0.38 + one of wl-paste / xclip / powershell.exe.
Preview empty. bat missing. Install it.
Native Windows? Not supported. Use WSL.
Credits
Thanks to Tom Rijndorp for FindItFaster — this fork is built on it.