Yank file name / path of current buffer in Vim

后端 未结 8 1372
死守一世寂寞
死守一世寂寞 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:55

    I use xclip to access X's clipboard, so I use:

    nmap d :call system("xclip -i -selection clipboard", expand("%:p"))
    

提交回复
热议问题