Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9063747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:05:08+00:00 2026-06-16T16:05:08+00:00

In vim when I’m using :find to open another file, it misses the first

  • 0

In vim when I’m using :find to open another file, it misses the first component of the relative path.

For example, if I’m looking for a file that’s in:

./foo/bar/file.txt

I’ll type

:find **/file.txt

It finds the file but then tries to open

bar/file.txt

It works correctly if I type

./**/file.txt

But I’m lazy and don’t want to type that much. Is there some config I’m missing that will correctly locate and open this path?

My Solution

I simply appended the main source code dir to my path

exec "set path^=src/**"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:05:09+00:00Added an answer on June 16, 2026 at 4:05 pm

    Is your 'path' set? That (IMO) is a pretty handy way to keep from even typing the **/ bit.

    In my setup, there’s an environment variable that defines which project I’m currently in so I use that and construct a path with that as the root. In a nutshell:

    let s:rootdir = $PROJECT_DIR
    let s:path = 'src/**;' . s:rootdir . ',scripts/**;' . s:rootdir
    execute "set path=" . s:path
    

    Then I can just :find a_file.txt and it searches my src hierarchy then my scripts hierarchy for the file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Vim can open a file under cursor using gf . For example, if I
Using VIM, it is easy to display line numbers for any given file with:
Using Vim 6.0. Say I'm editing this file: sdfsdg dfgdfg 34 12 2 4
In vim, I like using relative linenumbers to see how many lines I need
Using vim's :source command on a vimscript file with dos line endings is giving
In vim it's very easy to find a file without knowing which directory the
VIM seems integrated to the terminal. Can I open a remote file from the
Using VIM I want to execute current sql file and see results. I've tried
Using vim 7.3.1, ubuntu 11.10 I am creating a tag file using ctags while
Vim has the terrific shortcut [{ for going to the last open { character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.