vim - Putting the current file on the Windows clipboard

http://vim.wikia.com/wiki/VimTip432

command! Copyfile let @*=substitute(expand("%:p"), '/', '\', 'g')
command! Copyfile let @+=substitute(expand("%:p"), '/', '\', 'g')
This copies the entire path and filename of the current file (with any slashes replaced with backslashes) onto the clipboard.

posted @ 2016-11-29 17:54  cnblogist  阅读(90)  评论(0编辑  收藏  举报