Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy Vim Version Information to Clipboard

Tags:

vim

I am using gvim 7.3 on Windows 7 64 bit Professional. Within vim I can type :version to get information about my vim installation. How can I copy this version information to the clipboard?

like image 567
still_dreaming_1 Avatar asked Dec 28 '22 22:12

still_dreaming_1


2 Answers

:redir @+> | version | redir END

Unlike @Gareth McCaughan solution this will send :version output directly to clipboard register.

like image 135
ZyX Avatar answered Jan 05 '23 17:01

ZyX


:redir > C:\path\to\my\file.txt
:version
:redir END

and then open the file and copy the data from there. If you need to do it automagically in a Vim script, you can make Vim read the file into a buffer and copy the contents into the + register. That's more work, though, and I suspect you want this for a one-off purpose for which doing it manually will suffice.

like image 27
Gareth McCaughan Avatar answered Jan 05 '23 16:01

Gareth McCaughan