LinuxQuestions.org
Help answer threads with 0 replies.
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 06-15-2003, 12:42 PM   #1
IamDaniel
Member
 
Registered: Mar 2003
Location: Sungai Petani
Distribution: Slackware
Posts: 143

Rep: Reputation: 15
Unhappy vi question


I am wonder how to do the following:

Assume that I wanna copy a line of text and paste it in the 'n' line, but in the middle of the sentence, the problem is that every time I paste, it just pasted in the new line, instead the current cursor.

which like the following format:
Code:

//I use 'yy' to copy the following line
//and paste with 'p'
I am in problem,
this is annoying when thing not in control 
this is annoying when thing not in control 

//instead, I want it like this
I am in problem, this is annoying when thing not in control :(
This also raise me a second question:

The backspace is supposed to be:
Code:
1  I am in problem, this is annoying when thing <------
                                                       | 
2  not in control   -----------------------------------
how to make the second line resume in the word 'thing'
 
Old 06-15-2003, 01:00 PM   #2
Qzukk
Member
 
Registered: Jun 2003
Posts: 132

Rep: Reputation: 15
The problem is that the "yy" command copies an entire line, including the linebreaks. Try moving the cursor to the start of the line, and pressing "y$" to copy from the cursor to the end of the line. This command does not include the line breaks.
 
Old 06-15-2003, 01:55 PM   #3
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
"J" joins lines, so you could place your cursor on the first line and hit "J" and it will remove whitespace until there is only one space between "thing" and "not".
You have to remember that vi works on lines, so when there is a break between lines, a backspace will not go from one line to the previous. (I think this has been changed in newer versions of vi, but I'm not sure, maybe vim or gvim)

Last edited by moses; 06-15-2003 at 01:57 PM.
 
  


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
Question, Apples Contribution to Open Source + MacOs file structure question Higgy3k Other *NIX 5 07-25-2005 04:23 AM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 01:51 PM
2 part question: Speeding up MDK9.1/GNOME question wardialer Linux - Newbie 6 10-14-2004 03:16 PM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 02:02 PM
RE: Suse 8.0 hardware question {newbie question, pls help} Radiouk Linux - Distributions 2 06-04-2002 12:53 PM

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

All times are GMT -5. The time now is 07:36 AM.

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