Finds files and text within files, but faster than VS Code normally does.
Make sure to check the Requirements below (TL;DR: have fzf
, rg
, bat
on your
PATH
).
Default key bindings:
cmd+shift+j
/ctrl+shift+j
to search files,cmd+shift+u
/ctrl+shift+u
to search for text within files,cmd+shift+ctrl+u
/ctrl+shift+alt+u
to search for text within files with type pre-filtering.
You can change these using VS Code's keyboard shortcuts.
Update: Native Windows support is now implemented (still experimental)! Also see Known Issues.
This plugin is useful if you deal with very large projects with lots of files (which makes VS Code's
search functionality quite slow), or when you simply love using fzf
and rg
and would like to
bring those tools inside VS Code, similar to how the excellent fzf.vim
plugin works for Vim.
This extension exposes four commands:
- Search for files and open them. Uses a combination of
fzf
,rg
, andbat
. - Search within files for text and open them. Uses a combination of
fzf
,rg
, andbat
. - Like 2., but you can limit the file types that will be searched.
- Resume search. Repeats the last run command with the previous query prepopulated.
If your active text editor has a selection, it will be used as the initial query (you can disable this setting).
⬇️ Find text within files, with file type filter
This extension has also been tested on remote workspaces (e.g. SSH sessions).
This plugin opens a terminal inside VS Code. Make sure that you can run fzf
, rg
, bat
, and
sed
by running these commands directly in your terminal. If those work, this plugin will work as
expected. If it doesn't, confirm that you are running recent versions of all three tools.
If you're not familiar with these command line tools, you might want to check them out. They are awesome tools that can be individually used and make you more productive. And when combined such as for instance in this extension, they're very powerful. They're available for many platforms and easy to install using package managers or by simply installing a binary.
I have no affiliation with any of these tools, but hugely appreciate them, and wanted to bring them into a VS Code context.
See the settings for this extension in the GUI.
You might want to play with fzf
, rg
and bat
on the command line and read their manuals in
order to get a better understanding of some of the settings in this extension. It will be worth
your time.
fzf
can also be configured through various environment variables. This extension does nothing to
disable that behavior, so feel free to use those. You can also check whether fzf
is running inside
this extension by checking whether the FIND_IT_FASTER_ACTIVE
environment variable is set.
Windows. There are two ways of running this extension on Windows:
- Natively using Powershell. This feature was added as of May 2022 and is experimental at this stage. Please file an issue on Github if you find one.
- Through WSL (Windows Subsystem for Linux). You can run this extension inside a Remote-WSL workspace.
Not tested on Docker / Github code spaces. Will likely work without issues as the functionality is very similiar to other remote sessions (e.g. SSH, WSL).
Various small terminal issues. VS Code gives developers little control over the terminal. We can't know if you typed text into the terminal we create, so that might interfere with the extension. There are various subtle ways in which in which things can break, many of which can't be detected. That said, if you don't touch the FindItFaster terminal, things should work well!
➥ Whatever defaults are present on your system (and read by VS Code) are used. For fzf
, this means
<Ctrl+K> moves the selection up, <Ctrl+J> moves down, and <Enter> selects. You can
also use the up and down arrows if that's your thing. <TAB> for multiple select when
available. Read the excellent fzf
documentation to learn
more about using fzf
.
➥ Probably VS Code is waiting for you to complete a multi-step keyboard shortcut (chord). Change the following setting in your preferences to disable chords:
"terminal.integrated.allowChords": false
➥ This extension enables you to search through multiple directories: the process working directory,
the workspace directories, and any additional directories you specify in the extension settings.
What paths are included is configured through the settings. There's a listSearchLocations
command that can show you which paths are currently being indexed.
➥ I don't the VS Code API enables me to do this. Shoot me a message if you think I'm mistaken and
I'll try to make this better.
Update: Added a setting find-it-faster.general.killTerminalAfterUse
. When true, it will kill the
extension's terminal which may result in VS Code focusing the previous one. It may help you.
➥ Yeah, that's not unlikely. There are a lot of edge cases with this sort of tooling. Three options:
- Shrug :)
- File a Github issue. Please give detailed information as the devil is in the details. Please
provide at least:
- OS
- VS Code version
- Does it happen after you reset to default settings (if relevant)?
- Anything special about your configuration / workspace. Did you have spaces in there? Is it on a network share or some other thing I definitely didn't test? Did you modify the extension settings?
- Create a fix and open a PR. If it's a straightforward fix that doesn't require a lot of testing on my side, I'll probably merge it. Please don't underestimate the amount of testing I need to do even for a trivial fix, and consider that this is just a tiny side project for me. I might not respond that quickly.
➥ This is not impossible for me to do, but realistically, there's little value to it. The experience
will never be quite as good, and won't be as performant either.
rg
especially is a beast that outperforms grep
and even tools like ag
. Give them a try.
Plus, not supporting additional tools means more time to make this extension better and fewer
opportunities for creating bugs. You can file a Github issue and see if there's support for it,
but unless people really want this it's unlikely I'll support it.
You can actually already use other preview tools than bat
, e.g. cat
. I've left some hints in
the settings.
➥ You can, by adding something like this to ~/.bashrc
or whatever configures your enviroment:
if [[ $FIND_IT_FASTER_ACTIVE -eq 1 ]]; then
FZF_DEFAULT_OPTS='--height=50%'
fi
🎄 I'd like to customize this tool a little but I need access to <insert something here>. Can you expose that?
➥ I probably can. Maybe create a Github issue and ask for it? Especially if other people vote on it, that would be a compelling argument to do it.
➥ To minimize redundancy, have a look at CONTRIBUTING.md
.
➥ Thanks for asking, but no. The amount of work that went into this extension is tiny compared to
the countless hours that have gone into the command line tools that are leveraged in this
extension. Please support those tools instead.
What I do appreciate is if you'd help others find this extension by spreading the word and/or
leaving a rating!
- Fixed an issue with the killTerminalAfterUse feature
- Add option to restore the previously active terminal
- Small improvements to resumeSearch and query fuzzing
- Fixed a bug that caused the extension to stop working altogether.
- Add setting to fuzzy match on space bar in
search within files
function - Add
FIND_IT_FASTER_ACTIVE
environment variable when running inside extension
- Resume search added as a new command. Resumes the last invoked command with the same query. Thanks for implementing @alexrenz!
- Add feature to kill terminal after each use such that focus goes back to the previous terminal
- Fix for UTF-8 paths on Windows. Thanks @ch0pex!
- No user facing changes
- Address Dependabot security issues
- Bug fix on Windows that caused files to not open. Thank you @ObieMunoz for reporting and @Coombszy! for submitting a fix!
- Add option to open editors in preview window. Thank you @phrabos!
- Experimental windows support! Thanks so much @ihdavids!
- Add a new command:
search file (with type filter)
. Thanks for suggesting @prime31! - Add option to set the
bat
theme. Thanks for suggesting @mariush2! - Add
--cycle
tofzf
call. Thanks for suggesting @shlomocarmeter! - Fix some bugs that caused
search within files
to behave incorrectly
- Add an option to use the contents of
.gitignore
files to limit search paths (on by default)
- Fix a bug that caused
search within files
to not search in all paths
- Ensure text selection searches immediately
- Small bug fix where the extension wouldn't correctly initialize when a text selection was present
- Show relative paths when only one directory is on the search path
- Fix a bug in
search within files
on Linux - Prevent custom PS1 prompt from leaking into user's history
- Fix a bug regarding fzf version discovery (e.g. Homebrew, Ubuntu 21.04 installs)
- Lower minimum required VS Code version to 1.48
- Small bug fix in type filtering window
- New screen captures in README
- Option to "find within files", but pre-filter by file type.
Exposes a new keyboard shortcut (default:cmd+shift+ctrl+u
/ctrl+shift+alt+u
).
The selection is stateful; it will be kept across searches such that you can easily re-run a search with the same file types. Should add new screen captures, but will do that in 0.0.13.
- Bug fix: bring back preview window in "Find Files"
- No new features, but this version should be automatically published through Github Actions.
- Much better search path support (see extension settings)
- Option to add the process working directory under various conditions
- Option to disable searching the workspace folders
- Option to add additional search paths through the settings under various conditions
- Better error message for native Windows use case
- Filtering out stderr output when searching. Prevents messing up
fzf
's layout when permissions errors arise during searching. - Add basic CI sanity checks and badge.
- Small logo update
- Text selections: if you have text selected, we'll use that to fill
fzf
's query. There's an option to disable it. - Clean up some terminal spam
- Honor search.exclude setting and add option to disable
- Don't store command history
- Always run bash in terminal, add warning to PS1
- Support multiple sessions at the same time without interfering with one another.
- Option to disable checks (e.g.
which bat
). Useful if you want to use e.g.cat
instead. - Option to disable previews for each of the find commands
- Settings overhaul; they're now empty when default. Enables some more flexibility on the backend.
- Cosmetic improvements if using fzf >= 0.27
- SSH support 🎉
- Ignore .git directory
- Always show error dialog box when a dependency isn't found
- Default search location preference for when a session has no workspace
- Add screen captures showing functionality
- Add an ugly icon
- Various smaller fixes
You gotta start somewhere!
Tested on these configurations:
Mac OS:
OS : Darwin 20.1.0 (MacOS Big Sur 11.0.1)
bat version: bat 0.18.0
fzf version: 0.27.1 (brew)
rg version : ripgrep 13.0.0
Linux:
OS : Linux 5.8.0-55-generic (Ubuntu 20.04)
bat version: bat 0.12.1
fzf version: 0.20.0
rg version : ripgrep 12.1.1 (rev 7cb211378a)