I always use vi for editing config files.
Today I wanted to select all the text in a file (around 1000 lines), copy it, then paste into Google Docs. How can I do that?
feedback
|
This question came from our site for system administrators and desktop support professionals.
|
You can use For vi this is how you can select all text and write it into a new file:
In theory this should work on both Linux and Windows - I tried it on a Mac but it doesn't work. | |||||
feedback
|
|
If you're using a linux desktop, you could load it into the clipboard using xclip or xsel. For something that size you might just want to use the upload feature in google docs. | |||
|
feedback
|
|
or
depending on whether + or * is the system clipboard. (On many unixes, + is the mouse selection buffer for middle-mouse-clicking, and * is the system clipboard). | |||||||
feedback
|
|
Without using vi, you can upload text to google docs using their API and cURL. | |||
|
feedback
|
|
See http://vim.wikia.com/wiki/Accessing_the_system_clipboard for options on how to do this. (if compiled in "* should refer to the system clipboard). There are also instructions there for how to use xsel with vim. | |||
feedback
|
|
The simplest and fastest way is to use: : % y + and then go over to Google Docs (or wherever) and paste. Another way is g g " + y G but you will likely admitt that the above is faster and easier. | |||
|
feedback
|