Neovim for Beginners — Fuzzy File Search (Part 1)

File searching in Neovim, with and without plugins.

6 min readJan 6, 2022


Neovim for Beginners — Fuzzy File Search

Efficient file navigation and searching are essential for developers. We are going to

  • Understand existing Neovim features to help us find files efficiently.
  • Configure options to help us find files efficiently without plugins.
  • Configure fuzzy file finder plugins — fzf.vim and fzf-lua.
  • Share other fuzzy finder plugins you can explore.

In later articles, we shall look into other Lua-based plugins liketelescope.nvim.

This article is part of the Neovim for Beginners series.

The Neovim configuration files can be found in this repository.

Built-in File Searching

Default File Search

Type :set path? and we can see the value of the file search path. By default, its value is set to .,/usr/include,,.

This is a list of directories that will be searched when using the gf, [f, ]f,^Wf, :find, :sfind, :tabfind and other commands provided that the file being searched for has a relative path (not starting with /, ./ or ../). The directories in the pathoption may be relative or absolute.

Given a project with the following folder structure, by default, the command only searches for files under the current and the /usr/include directories.

Our Project Structure
File Search with Default Option

Configure File Search

The default file search is not so useful. Let’s fine-tune it the Lua way.

Configure path

In after/plugin/defaults.lua, we add the following lines to remove the /usr/include folder from the search and add all subdirectories in the current folder to the search.

opt.path:remove "/usr/include"
opt.path:append "**"




Software engineer, Data Science and ML practitioner.