how to open a file in a list of files in vim?

后端 未结 10 1505
遇见更好的自我
遇见更好的自我 2020-12-05 02:22

I have a longish list of files opened in vim that looks like this:

/dir1/file1
/dir2/file2
/dir2/file3
.....

How can I open all of them one

10条回答
  •  一整个雨季
    2020-12-05 02:57

    You can use quickfix mode, as following

    :set errorformat=%f
    :cf myfilelist
    

    at this point you can use the normal quickfix shortcuts to go through your files, :cn for the next file, :cp for the previous one and :cr to go to the first again.

    EDIT:

    oh, if you want to read the list from the current buffer, use :cb instead of :cf in in the instructions above

提交回复
热议问题