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.
Recommended settings:
find-it-faster.general.useTerminalInEditor
to true to have the extension window open in the
editor panel rather than in the terminal panel.Native Windows support is now implemented (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:
fzf
, rg
, and bat
.fzf
, rg
, and bat
.If your active text editor has a selection, it will be used as the initial query (you can disable this setting).
⬇️ Find files
⬇️ Find text within files
⬇️ 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:
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!
The bash scripts use a shebang that conflicts with NixOs: #!/bin/bash
, as bash isn't
available in /bin
, a work around is to this to follow the instructions in Issue #44
and change the shebangs manually, after this, the extention should work normally.
➥ 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
.
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.
2023 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.
2024 Update: I recommend using find-it-faster.general.useTerminalInEditor
. This way, the
extension window won't interfere with your other terminals, and you get more real estate for
previewing files.
➥ Yeah, that's not unlikely. There are a lot of edge cases with this sort of tooling. Three options:
CONTRIBUTING.md
.fzf
/ rg
/ bat
. Can I just use find
, grep
, and cat
or something else?➥ You can actually already use other preview tools than bat
, e.g. cat
. I've left some hints in
the settings. Outside of what's available, substituting other tools is not supported.
➥ 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
➥ For the most up to date information on contributing fixes and features, see 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!
find-it-faster.general.useTerminalInEditor
. Please try it out!sed
on Windowssearch within files
functionFIND_IT_FASTER_ACTIVE
environment variable when running inside extensionsearch file (with type filter)
. Thanks for suggesting @prime31!bat
theme. Thanks for suggesting @mariush2!--cycle
to fzf
call. Thanks for suggesting @shlomocarmeter!search within files
to behave incorrectly.gitignore
files to limit search paths (on by default)search within files
to not search in all pathssearch within files
on Linuxcmd+shift+ctrl+u
/ ctrl+shift+alt+u
).fzf
's layout when permissions
errors arise during searching.fzf
's query. There's an
option to disable it.which bat
). Useful if you want to use e.g. cat
instead.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)