(Undo revision 32164 by 193.15.95.2 (talk) yeah, it works...but it's an Ex command not a normal one, that's why it was in that section) |
JohnBeckett (talk | contribs) m (Reverted edits by 105.99.69.89 (talk) to last revision by Nquinlan) Tag: Rollback |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 68: | Line 68: | ||
<pre> |
<pre> |
||
<Cmd-A><Cmd-C> |
<Cmd-A><Cmd-C> |
||
+ | </pre> |
||
+ | |||
+ | |||
+ | <pre> |
||
+ | :w !pbcopy |
||
</pre> |
</pre> |
||
Latest revision as of 07:48, 16 August 2022
Tip 960 Printable Monobook Previous Next
created July 20, 2005 · complexity basic · author Ivan Tishchenko · version 5.7
Vim can access two different clipboard registers: * (primary selection) and + (clipboard). On Windows, either one can be used.
There are a number of ways of copying the entire contents of a file to the clipboard. These include:
Normal Mode
gg"*yG gg"+yG :set go+=a ggVG ggVGy :set cb+=unnamed ggyG
Ex Mode
:%y+ :set cb+=unnamed :%y
Visual Mode (linewise)
ggoG"+y :set go+=a ggoG
Visual Mode (characterwise or blockwise)
VggoG"+y :set go+=a VggoG
Windows Specific (with Windows key bindings in effect)
ggVG<c-ins> <C-A><C-C>
Macintosh Specific
<Cmd-A><Cmd-C>
:w !pbcopy