Is there a quick way to copy the full path of current buffer to system clip board or some register?
:put=expand('%:p') then use other copy commands(like
dd) works but the typing is a little long.
You can assign to the clipboard with the special
:let @+ = expand('%:p')
:p makes it an absolute path; drop it if you want the relative path.
If you want to make this easier, you could create a command, so you only have to type
:command! CopyBuffer let @+ = expand('%:p')
and/or map it to a key:
:nnoremap <Leader>c :let @+=expand('%:p')<CR>
The post "How can I copy text to the system clipboard from Vim?" has much more information on how to interface with the system's clipboard.
:put=expand('%:p')works but the typing is a little long.
This doesn't copy the path of the buffer to the clipboard, but inserts it in the buffer...?