Skip to content

pirey/autopath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Autopath

This is a neovim plugin which automatically :set path=... in the project, make it possible to use :find <search> without relying on fuzzy finder plugins.

See :h :find for more information.

  • It will use fd, if exists.
  • If not, then it will use git ls-files if it is currently inside a git project.
  • Otherwise, it will set path=** as fallback.

Why

Did you know that vim has a built-in file finder? Here's me browsing files in the neovim project, using nothing but vim's :find cmd.

vim-file-finder.mov

This approach is suitable for those looking for a way to fuzzy find files in neovim but don't want to rely on external fuzzy finder.

Installation

-- lazy.nvim
{
  "pirey/autopath",
  opts = { set_keymap = true }
}
-- setup manually
require('autopath').setup({
  set_keymap = true
})

Usage

Type in :find followed by partial filename or pattern, then press <tab> to find any matches.

For example:

:find main<tab>

fuzzy match using pattern

:find long*filename<tab>

NOTE: this does not support real fuzzy matching, i.e. if the filename is "my_long_filename" we cannot type :find myfile<tab> but we can type :find my*file<tab> and it will match

Keymaps

By default this plugin will set a keymap, <leader>f as a shortcut to invoke :find .

We can skip the keymap creation by passing { set_keymap = false } when calling setup().

About

Easier to use built-in neovim file finder

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages