How to quickly open files with your editor

I often need to open a specific file in a deeply nested folders project. ZSH globbing does help but I wanted to have something faster.

Most of the time I already know the exact name of the file I want to open with my favorite editor $EDITOR . The only thing I need to do is to find the first matching file in my current tree that matches the filename I want to edit.

Here’s a quick look of how my solution works.

Below the snippet to make it work. Simply paste it into your .bashrc/.zshrc file.

Enjoy! 🎉

UPDATE: I've also made an autocomplete function that works with zsh.

Here is how it looks like:

Simple example for matching two files or a single file with autocomplete on

Simply paste the following code in .oh-my-zsh/custom/vs.zsh