Joe.Z
Joe.Z

Reputation: 2745

Why my vim always chose another buffer

I got a annoying situation:

Under /path1/to, I vim a file name "file1", but it looks I was always editing another file1 under different directory like /path2/to/file1 even if I type vim ./file under "/path1/to".

I type :buffers and got:

 1 # =  "/path1/to/file1"          line 1
 2 %a + "path2/to/file1"         line 426

/*please note buffer 2 is without / prefix while 1 dose */

Even I vim the file using "vim ./file1" under /path1/to/, the buffer is always pointing to buffer 2.

What kind of operation made this happen, why there are two buffers? How to fix it?

Thanks in advance.

EDIT: They are not the same file though share the same name. If I use vi, instead of vim, the file I am editing is exactly the file that is expected to be editing.

Upvotes: 1

Views: 96

Answers (1)

kev
kev

Reputation: 161954

To narrow the problem down. You can start vim without loading vimrc and plugin:

vim -u NONE /path1/to/file1 path2/to/file1

And print verbose message before switching buffers:

:20verbose bn

Upvotes: 2

Related Questions