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:
The backspace is supposed to be: Code:
1 I am in problem, this is annoying when thing <------ |
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.
|
"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) |
All times are GMT -5. The time now is 08:30 AM. |