Reputation: 1004
I would like to get a file path or a file name in netrw easily.
Is there any way to get a file path or a file name in netrw of Vim?
Upvotes: 1
Views: 1875
Reputation: 1574
You can select the file name under cursor in netrw, copy it to the buffer with y
and enter the following command: :echo @%."/".@"
.
Explanation: @{0-9a-z".=*+}
executes the contents of the register {0-9a-z".=*+}
. The %
register is a name of the current file. For netrw, this is the name of the open directory. The "
register contains the copied file name. The .
operator means concatenation of the strings in the vimscript.
Upvotes: 0