For example, if I type ':pwd' to get the current working directory, I can select the text in gvim but I can't figure out how to copy it to the clipboard. If I try the same in console vim, I can't even select it with the mouse. I would like this to work with all vim commands, such as set guifont to copy the guifont=Consolas:h10:cANSI output.
| ||||
|
feedback
|
|
Are you looking for this,
:redir command redirects the output of a command to a register (@*). The register @* refers to the clipboard. For more info on this,
| |||
|
feedback
|
|
If you're running vim in an xterm, holding the shift key while selecting the text will copy the text to the X equivalent of the clipboard. | |||
feedback
|
|
Try ' | |||||
|
feedback
|
|
For this particular example you could do (note the "!" which makes it go through the shell):
or
(depending on which X-selection you want). You might have to install xclip first
(or equivalent) | |||
|
feedback
|