If you have a file open, you can yank the current buffer’s path to a register using the
Since I’m using the unnamed buffer as system clipboard, my vim config/alias for this is:
This way, typing
cp in a buffer will copy it’s file path to the vim clipboard and to the Linux X Window system’s clipboard.
By the way: have a look at the expand() command:
:help expand, it’s very useful.