Thursday, May 29, 2014

Re: Copy the full path of the file opened in my current buffer.

On Thursday, May 29, 2014 9:52:15 AM UTC-5, Arup Rakshit wrote:
>
> Thanks. I am away from my PC, so not able to test it. Just wanted to know "ap
>
> will copy the file path to *clipboard* right ? Basically I want it to copy and
>
> paste in my console for my project related works.
>
>

Um...no.

This command is two parts. '"a' specifies register 'a', which is internal to Vim. This is NOT the system clipboard. 'p' is the "put" or "paste" command. So this command pastes from an internal register, it does not copy to the system clipboard.

For that, instead of :let @a=expand("%:p") you need to specify the system clipboard:

:let @+=expand("%:p")

This assumes your Vim is compiled to be capable of copy-paste with the system clipboard.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: