IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Okay, a question then
Vi lets you mark an arbitrary location in the file. You mark it with m followed by another letter which is the name of the mark. Users who don't use marks much usually drop mark 'm' because that's the simplest key sequence, but all 26 letters work for marking (so you can mark upto 26 different locations!).


You go to a marked location with the single quote followed by the mark's name/letter.


Could I use this to, for example, mark a page to not wrap when using the gqG command? I have one particular file that has a poem at the end of the e-mail I sent to everyone, but when I use the gqG command it wraps the poem as well. Would there be a way to put the mark M command in in front of the poem and then say, "wrap to the mark M and stop?" If so, what would be the sequence to use?

Meanwhile, John's wrap program is succeeding in wrapping that file for each person's e-mail, I just have to keep switching between his wrap.exe and the gqG comand.

Just curious if there's an easy way to use the Mark M command to accomplish the same thing.

Thanks,

Brenda




"When you take charge of your life, there is no longer need to ask permission of other people or society at large. When you ask permission, you give someone veto power over your life."

By Geoffrey F. Abert
New Don't know the specifics
but look in motion.txt to find out how to do a motion from the current cursor up to a mark, then when that's done, move the cursor to just after the poem and do it to the end of the file.
--\n-------------------------------------------------------------------\n* Jack Troughton                            jake at consultron.ca *\n* [link|http://consultron.ca|http://consultron.ca]                   [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\n* Kingston Ontario Canada               [link|news://news.consultron.ca|news://news.consultron.ca] *\n-------------------------------------------------------------------
New ICLRPD (new thread)
Created as new thread #246401 titled [link|/forums/render/content/show?contentid=246401|ICLRPD]
--
Steve
[link|http://www.ubuntulinux.org|Ubuntu]
New Here's how to do it!
You go to the place where you want to mark, (i.e. in my case, the very last page which only has the poem), and put the mark where you want it to stop. I used 'a for the mark.

You can't see the mark, so you check this by going anywhere else in the file and typing 'a which takes you to the mark, and you know it's been set.

Then you go to the place where you want to start wrapping and do the gq thing only instead of typing G after that, you type gq'a. John said that means wrap until this mark.

It worked! Thanks!

Brenda



"When you take charge of your life, there is no longer need to ask permission of other people or society at large. When you ask permission, you give someone veto power over your life."

By Geoffrey F. Abert
New You figured it out before I got to reply. :-)
"Insert crowbar. Apply force."
New That's ok :)
Now you can answer the questions I was afraid to ask at first. ;) See my response to Conrad. :)

Brenda



"When you take charge of your life, there is no longer need to ask permission of other people or society at large. When you ask permission, you give someone veto power over your life."

By Geoffrey F. Abert
New Bravo! You found out exactly what Wade told you a week ago!
New Actually, it was four days ago. :)
And despite reading what he said:

With that sort of command, you've definitely scraped below the surface. Remember you can combine gq with any sort of movement: I often uses it with just j (down 1 line) and then repeat it with . because that lets me incrementally re-format paragraphs. But you could do things like gq'm to re-format to mark 'm'.


I didn't completely get it. I wasn't sure what combine gq with any sort of movement meant, until I discovered that the capital G meant to go to the end of the file, and that replacing it with the mark is what he was saying, so the mark would serve as the end of the "wrap" in the file.

I also don't know what he means by using it with just J (down one line). I know J is the join command, but what does the (down one line) mean?

I got lost somewhere when he explained about incrementally re-formatting paragraphs, I'm not sure what that means. And I didn't know what re-format meant, unless it's a term for the wrapping command. I thought file formatting was mostly about fonts and things.

I'm still learning, but at least I admit when I'm not sure of something. I just didn't want to ask these questions then and look stupid, until I had a chance to try and figure it out first.

So it took a combination of reading what he said, looking it up, and talking to John, and I got the hang of the command. :)

The part that was throwing me most was when Jake said to mark something after the poem and continue to the end of the file. There's nothing after the poem, and the wrapping needed to stop at the top of the poem. But we got it all figured out. :)

Brenda




"When you take charge of your life, there is no longer need to ask permission of other people or society at large. When you ask permission, you give someone veto power over your life."

By Geoffrey F. Abert
New I've given lots of advice about vi over the years.
Mostly to beginners, encouraging them to learn just enough to keep them interested.

I'm sure you really know this, but vi's commands are case sensitive. Lowercase j is just move down 1 line*. Uppercase J is join this line to the next. So gqj will re-wrap the current line and the next line, leaving the cursor on the last line re-wrapped. Re-wrapping lines is sometimes called re-formatting in context where the text has no font information.

Wade.

* I just realized you might not have known that at all! Modern vi's recognize the cursor keys for movement, but the standard keys are hjkl for left, down, up and right respectively. I strongly recommend you teach yourself to use the latter because as you gain more skill and experience at vi, it will be faster to use the letters rather than the arrow keys to move the cursor.
"Insert crowbar. Apply force."
New I knew part of that
I'm sure you really know this, but vi's commands are case sensitive. Lowercase j is just move down 1 line*. Uppercase J is join this line to the next. So gqj will re-wrap the current line and the next line, leaving the cursor on the last line re-wrapped. Re-wrapping lines is sometimes called re-formatting in context where the text has no font information.


* I just realized you might not have known that at all! Modern vi's recognize the cursor keys for movement, but the standard keys are hjkl for left, down, up and right respectively. I strongly recommend you teach yourself to use the latter because as you gain more skill and experience at vi, it will be faster to use the letters rather than the arrow keys to move the cursor.


I knew the part about Shift-J joining lines. I don't think I ever figured out that lower-case j meant down one line. But I'm a little confused about the comment, "So gqj will re-wrap the current line and the next line, leaving the cursor on the last line re-wrapped." I get the part about wrapping the current line and next line, but what does it mean when you say "leaving the cursor on the last line rewrapped?" Are you saying it wraps only two lines at a time?

I knew some of the movement. I knew h=left and l= right. I have always had problems moving up and down though, so that's nice to know. Remember, I figured the majority of vi out myself, by guesswork. John only taught me mostly the longer strings in order to help me format my e-mail for archiving.

For example, when first using the DOS vi version, I found out that dG would delete everything below the line I put it in at. However, now from our discussion and the new vi program, I know that what that actually means is "delete to the end of the file."

And I'd never read a manual or had a help file on vi before, and still really haven't really read over it, as I haven't had the patience and time to sit here and read it yet. But I plan to. I just do things like that better late at night, and lately I'm too anxious to stay up much. So I always used a combination of h and l and arrow keys to move around. Now I know why the error sound would sometimes beep when I moved wrong. ;)

So I guess that you can say it's kind of like how I learn music. I know how to play the notes correctly, but I couldn't explain the rhythm, the time, or the reason they have to be that way. Same with vi. I know how to use use the letters and strings to format a file, but I never before grasped the "reason" certain letter combinations made things work that way. :)

Thanks!

Brenda



"When you take charge of your life, there is no longer need to ask permission of other people or society at large. When you ask permission, you give someone veto power over your life."

By Geoffrey F. Abert
Expand Edited by Nightowl March 1, 2006, 12:37:09 PM EST
New Cursor location in vi.
Just a quick reply...

... But I'm a little confused about the comment, "So gqj will re-wrap the current line and the next line, leaving the cursor on the last line re-wrapped." I get the part about wrapping the current line and next line, but what does it mean when you say "leaving the cursor on the last line rewrapped?" Are you saying it wraps only two lines at a time?


Yes, gqj will re-wrap only two lines at a time: the current and the next. It's just that one or both are very very long, you may get more than 2 lines as a result. After the re-wrapping, the cursor is on the last line it changed. Using gqj again will re-wrap that line - which may be short, BTW - with whatever it can do with the next line. And so on.

Wade.
"Insert crowbar. Apply force."
     The new Improved VI - (Nightowl) - (25)
         [surprise!] - (Another Scott) - (24)
             Re: [surprise!] - (Nightowl) - (23)
                 Here's how to set up wrapping - (jake123) - (22)
                     Thanks! I'll give it a try! -NT - (Nightowl)
                     More info - (Nightowl) - (20)
                         Ah, if you're trying to do that, here's how you wanna go - (jake123) - (19)
                             COOL!!!!!!! - (Nightowl) - (16)
                                 Right on - (jake123) - (1)
                                     I will, I promise! - (Nightowl)
                                 Vi is much more powerful than many people realize. - (static) - (13)
                                     I agree - (Nightowl) - (12)
                                         Marking. - (static) - (11)
                                             Okay, a question then - (Nightowl) - (10)
                                                 Don't know the specifics - (jake123) - (9)
                                                     ICLRPD (new thread) - (Steve Lowe)
                                                     Here's how to do it! - (Nightowl) - (7)
                                                         You figured it out before I got to reply. :-) -NT - (static) - (1)
                                                             That's ok :) - (Nightowl)
                                                         Bravo! You found out exactly what Wade told you a week ago! -NT - (CRConrad) - (4)
                                                             Actually, it was four days ago. :) - (Nightowl) - (3)
                                                                 I've given lots of advice about vi over the years. - (static) - (2)
                                                                     I knew part of that - (Nightowl) - (1)
                                                                         Cursor location in vi. - (static)
                             I wanted to reply to a few other things here :) - (Nightowl) - (1)
                                 Re: I wanted to reply to a few other things here :) - (jake123)

With the mochas he was strong.
222 ms