LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-23-2015, 10:10 PM   #1
Huamin
Member
 
Registered: May 2011
Posts: 562

Rep: Reputation: 12
Copy all text


Hi,
I choose all text of the file, by

gg"*yG

does it mean the text already goes to Clipboard, as I cannot paste them out?
 
Old 11-23-2015, 10:15 PM   #2
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
You should mention what editor you're using.
By the keys you entered, my guess is vi(m)

The "gg" goes to the top of the screen, y indicates copying data to the buffer, and G means go to bottom of file.
The buffer is inside of vi(m) so you can use p to paste it.
 
Old 11-24-2015, 01:55 AM   #3
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Thanks. I'm using vi editor. If I've gone to web browser. How to paste the text?
 
Old 11-24-2015, 02:17 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
http://vim.wikia.com/wiki/Accessing_...stem_clipboard

use + instead of *
 
Old 11-24-2015, 02:51 AM   #5
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
I tried and I cannot copy all text of the file by

gg"+yG
 
Old 11-24-2015, 02:53 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
what do you mean by that? What have you tried, what happened?
 
Old 11-24-2015, 03:57 AM   #7
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
I press

gg"+yG

on Text file within vi editor, then have gone to web browser, but I cannot paste the whole text file into web email.
 
Old 11-24-2015, 03:58 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
what kind of vi(m) do you use? Version??
 
Old 11-24-2015, 04:12 AM   #9
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Sorry, how to get the version of vi editor being used?
 
Old 11-24-2015, 05:11 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
:version
 
Old 11-24-2015, 09:09 AM   #11
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Sorry, it's VIM 7.0
 
Old 11-24-2015, 11:13 AM   #12
LanceTaylor
Member
 
Registered: Nov 2015
Location: Houston, Texas, US
Distribution: RHEL/CentOS, Debian/Linux Mint, SLES
Posts: 40

Rep: Reputation: 19
If you are copying text from your vi window to a browser window, you may be able to highlight the text with your mouse in vi, then right-click in your browser window and paste.
 
Old 11-24-2015, 07:04 PM   #13
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
This is not good actually! How about that there're one million lines inside the file?
 
Old 11-24-2015, 07:10 PM   #14
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,646

Rep: Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969
Quote:
Originally Posted by Huamin View Post
This is not good actually! How about that there're one million lines inside the file?
How about you try to read the documentation on VIM yourself???
Code:
:%y+
...or look something up on Google, which would show you:
Code:
shift v  -- visual mode
shift g -- jump to eof
"*y -- yank select text
:e my_new_file -- create a new file
"*p -- paste into a new file
 
Old 11-27-2015, 09:30 AM   #15
debguy
Member
 
Registered: Oct 2014
Location: U.S.A.
Distribution: mixed, mostly debian slackare today
Posts: 207

Rep: Reputation: 19
in vi (elvis), enter ed mode with : as seen here

KEYSTROKES

:1,$y

now do

$ man ed

read the ed(1) manpage about what ed does and that entering : mode allows you to give ed commands (also vi features). realize in vim, ed slighly altered not "full", thank elvis for providing access to ed within vi(1)

for scripting sh(1), ed(1) is extremely useful for automated text editing (awk(1) is as well)

whooo baby!

if your using xterm, vi(1) selections of course do NOT go into X11's Clipboard automatically, they must be selected (usu. with mouse)

HOWEVER elvis(1) has a an X11 mode which does work with X11's Clipboard, just install evis and use in X11 mode if you like it

Last edited by debguy; 11-27-2015 at 09:37 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] text copying can't do in epdfview for files why? also,how to copy text in zathura? rubankumars Linux - Software 1 01-10-2014 11:38 AM
How to copy text from vmware from linux text terminal to word document in windows? meandsushil Linux - Newbie 40 01-12-2011 06:06 AM
[SOLVED] Able to Copy Text from uneditable Text Boxes(JTextfields) in Linux harry8potter Linux - Software 5 09-09-2010 06:51 AM
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration