Yank file name / path of current buffer in Vim

后端 未结 8 1368
死守一世寂寞
死守一世寂寞 2020-12-07 07:26

Assuming the current buffer is a file open for edit, so :e does not display E32: No file name.

I would like to yank one or all of:

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 07:41

    Almost what you're asking for, and it might do: Ctrl+R % pulls the current filename into where you are (command prompt, edit buffer, ...). See this Vim Tip for more.

提交回复
热议问题