Vim Tips Wiki
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Vim Tips Wiki
1,649
pages
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
Editing
Copy an Entire Buffer to the Clipboard
Back to page
Edit
Edit source
View history
Talk (0)
Edit Page
Copy an Entire Buffer to the Clipboard
We recommend that you
log in
before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your
Watchlist
.
Creating an account
is quick and free.
The edit appears to have already been undone.
Anti-spam check. Do
not
fill this in!
{{TipImported |id=960 |previous=958 |next=961 |created=July 20, 2005 |complexity=basic |author=Ivan Tishchenko |version=5.7 |rating=65/35 |category1=Integration |category2=Usage }} 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''' <pre> gg"*yG gg"+yG :set go+=a ggVG ggVGy :set cb+=unnamed ggyG </pre> '''Ex Mode''' <pre> :%y+ :set cb+=unnamed :%y </pre> '''Visual Mode (linewise)''' <pre> ggoG"+y :set go+=a ggoG </pre> '''Visual Mode (characterwise or blockwise)''' <pre> VggoG"+y :set go+=a VggoG </pre> '''Windows Specific (with Windows key bindings in effect)''' <pre> ggVG<c-ins> <C-A><C-C> </pre> '''Macintosh Specific''' <pre> <Cmd-A><Cmd-C> </pre> <pre> :w !pbcopy </pre> ==References== *{{help|:yank}} *{{help|G}} *{{help|registers}} *{{help|"+}} *{{help|'guioptions'}} *{{help|'clipboard'}} ==Comments==
Summary:
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Help
(
view source
)
Template:Navigation
(
view source
)
Template:TipImported
(
view source
)
Follow on IG
TikTok
Join Fan Lab