LinuxQuestions.org
Register a domain and help support LQ
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, 01: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, 02: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, 02: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: 48
"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 02:57 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:23 AM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 02:51 PM
2 part question: Speeding up MDK9.1/GNOME question wardialer Linux - Newbie 6 10-14-2004 04:16 PM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 03:02 PM
RE: Suse 8.0 hardware question {newbie question, pls help} Radiouk Linux - Distributions 2 06-04-2002 01:53 PM


All times are GMT -5. The time now is 10:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration