Last Updated: February 25, 2016
·
2.537K
· jamesmartin

Vim: Copy Current Buffer’s Full Path and Filename to Clipboard

:!echo % | pbcopy

I use this all the time, so it's mapped to a key.

1 Response
Add your response

autocmd BufDelete * let g:latestdeletedbuffer = expand("<afile>:p")

nnoremap <F8> :e <C-R>=fnameescape(g:latestdeletedbuffer)<CR><CR>

over 1 year ago ·