2

I ran into a problem when using the quickfix feature of vim. When I open up my source file in vim, a buffer of that file is created, and its name is shown on the status bar, let's say main.cpp.

Then I compile it with :make and jump to next error with quickfix. Because the error message my compiler outputs is always absolute path, e.g. c:\folder1\folder2\main.cpp. If I jump to that error location, then a new buffer of the same file will be opened, but with the absolute path filename.

Then when I edit either of them and save it, the other buffer won't get updated and that's really annoying. I tried set autoread but it doesn't help at all. Do you guys have any suggestions? Thanks a lot!

EDIT: I am running vim on windows.

4
  • 1
    That shouldn't really happen - are you using symlinks (so two paths point to the same file)?
    – laktak
    Jun 22, 2017 at 14:25
  • I don't think so. I am using windows and I didn't do anything like symlinks. Jun 22, 2017 at 19:35
  • Windows is case insensitive - maybe you have different casing somewhere in the path?
    – laktak
    Jun 22, 2017 at 21:16
  • Yes, that is exactly the problem, thanks for leading me to that direction! Quickfix's output is always lowercased, so in order to match with its output, I changed the entire path to lowercase, except the leading ":C", since I can't change it. Because they have different casings, jump-to-error still directs me to a new buffer. Do you know what I can do to have the quickfix window output path with correct casing? Jun 22, 2017 at 23:30

1 Answer 1

0

Check that fileignorecase is set (set fileignorecase?) even though it should be the default on Windows:

                'fileignorecase' 'fic' 'nofileignorecase' 'nofic'
'fileignorecase' 'fic'  boolean (default on for systems where case in file
                                 names is normally ignored)
                        global
                        {not in Vi}
        When set case is ignored when using file names and directories.
        See 'wildignorecase' for only ignoring case when doing completion.

You are using the native Windows vim exe (not cygwin)?

1
  • Yes, that seems to be the problem. After I set it it fixed the problem. Thanks a lot man! Jun 29, 2017 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.