Vim Fuzzy file search and navigation without plugins

Search for a command to run...

Alternatively you can use "ripgrep" to manage all these process. rg --files
Other alternative is fd command.
Good job. keep going!
Yeah rg --files is great and even faster. This one is more about navigating to files in a fuzzy manner using builtin vim features. vim's :find command find and open the file in vim all in one go :)
Bhanuka Mallawaarachchi then maybe you can also add the map assignment to your command. For example i am using :
--INFO: select all
["<C-a>"] = { "<Esc>gg<S-v>G<CR>", desc = "Select All" },
to select all in normal mode in AstroNvim. This kind of assignments also can be useful for your command usages.
Remember my post about switching to VSCode? Well, plot twist: the very next day after publishing it, I switched to WebStorm. And guess what? I've been on JetBrains IDEs ever since. I know, I know. Another "why I switched editors" post. But hear me ou...

I had been doing some basic interpreter work in Go and wanted to redo it in another language to solidify my understanding. Naturally, I chose Odin, it’s another great language, with a Go-like, easy-to-approach syntax and no unnecessary complexity. I ...

Why Emacs Keybindings? I've always preferred Emacs-style editing, especially the way it handles cursor movement and text manipulation. Even though I have switched to using VSCode for most of my development work, I often found myself missing the intui...

In my previous post about building C/C++ projects with CMake, I shared a simple CMakeLists.txt setup for compiling a basic project. Today, I’ll dive into a specific need that many developers encounter: linking libraries directly from project folders ...

Some time ago, I wrote a post about using Vim to look cool and why that’s not a good idea. Now, funny enough, here I am—having switched to VSCode after years of hopping between Vim and Emacs. This isn’t one of those "Vim sucks, I'm going back to VSCo...

Recently, I got curious about how Vim’s built-in commands handle file finding and navigation. Even though I was using modern fuzzy finding plugins at the time, I decided to explore Vim’s native mechanisms. To my surprise, I started enjoying the simplicity and effectiveness of these built-in tools.
If you prefer to see these tips in action, check out the video linked at the end of this post!
:find for Fuzzy SearchingBy default, the :find command in Vim requires the full path of the file you want to open. For instance, you might type :find src/parser/parser.odin.
Here’s a handy trick: if you set the path option to **, Vim will search through all directories from your current working directory. You can do this by adding the following line to your .vimrc:
set path=**
With this setting, :find becomes much more flexible. For example, if you type :find par and hit Tab, Vim will suggest files that match “par” anywhere in your directory. It’s a simple way to perform fuzzy searches without extra plugins.
:bufferTo switch between open files, you can use the :buffer command (or just :b). Suppose you have these files open:
src/parser/parser.odin
src/main.odin
src/tokenizer/tokenizer.odin
Typing :b to and pressing Enter will take you to the buffer that matches the input. In this case it’ll open the src/tokenizer/tokenizer.odin file. It’s a straightforward method for navigating between your open files.
As I started using these built-in commands more, I found them to be quite effective. They offer a simple and efficient way to search and navigate files and buffers without relying on additional plugins.
If you prefer a vertical completion menu, similar to what you might see in Neovim, you can enable it in Vim by setting wildoptions to pum. Unlike Neovim, this isn’t the default in Vim. Add this to your .vimrc:
set wildoptions=pum
Exploring Vim’s built-in file finding and navigation features has been a rewarding experience. By adjusting :find and using :buffer, you can navigate and manage your files effectively with just the default tools.
You can see these techniques in action in the video below.
Happy Vimming!