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:
Combining information from a couple of other answers: If you want to yank the current full path to a file and put it into the command buffer in another window, first do :let @" = expand("%:p"), then move to another window and type Ctrl+R ".
Useful for copying a file while staying in the same directory and keeping the old one open. For example:
Start: Editing src/com/benatkin/paint/shapes/Circle.java
Type
:let @" = expand("%:p")(The path gets yanked to the main clipboard buffer.)Open a new window with
:spType
:e Ctrl+R"Use the arrow keys to go back to Circle and change it to Square, and press
End: Editing src/com/benatkin/paint/shapes/Square.java