3

For example, I have below content in a buffer 2,

/works/a.txt
/works/b.c
/works/c.java

when I tried :lgetbuffer 2 and :lopen to open location list, it looks like

|| /works/a.txt
|| /works/b.c
|| /works/c.java

And pressing enter on the first item does not help me open /works/a.txt.

  • Just FYI, you may get better coverage on this question on the official vi/vim SE: vi.stackexchange.com – Patrick Jun 16 '17 at 13:11
1

I figured out of this, post my own answer here for others who has same requirement.

Every line in the buffer needs to be:

<file_name>:<line_number>:<content_of_the_line>

So if the buffer looks like below, it will be fine.

/works/a.txt:1:1
/works/b.c:1:1
/works/c.java:1:1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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