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

Welcome to IWETHEY!

New I wanted to reply to a few other things here :)
Do you know what a motion is? It's a motion over a certain amount of text in the buffer; none, some or all.


Is a motion like the sequence I type in? For example when I'm trying to remove leading spaces (>) from forwarded messages, I use this one:

:1,$s/^>(space)//

That takes all the >=(greater than) signs from the beginning of each line of the message. And is every command a motion? For example, is Shift-J to join a line a motion as well, or do motions require more letters? I never heard them called motions, but I do them. ;)

So, for example, to go to the end of the current paragraph as seen by vim, you hit the letter 'p'.


Yep, I knew that. :)

To go to the end of the file, you hit the 'G' character, or to the end of the current block of code (programming thing), you'd hit the '}' character. Further, you can modify these by putting more than one of them in a row.


Yep, I know the end and beginning ones, and some of the move around in paragraph ones. And I know the Shift-O for space down and little a for space over.

Type in ':help motion' to get the skinny on all the motions that are available in vim. They are incredibly useful, as you can issue any command followed by the motion you want the command to make to select where it will be applied. The complete listing is in the file 'motion.txt', and it'll be in vim/vim63/help or some such location.


John showed me how to access the help files, so I know how. I was just so excited I was getting all this past mail processed and put away that I wasn't looking to read up on it more yesterday. But I definitely plan to soon!

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 Feb. 24, 2006, 01:09:31 PM EST
New Re: I wanted to reply to a few other things here :)
Yes, a motion is like some of thse sequences you type in. The general idea is that a motion moves the cursor over the part of the file described by the motion. You can then combine the motion with a command to change the part of the file the motion moves over.

The example you use for the search and replace is not really a motion, though; instead, that's what's called a regular expression, which describes what you're looking for, and what you want to replace it with. So, the ^>(space) means "all the greater-than symbols found at the beginning of a line if it's followed by a space" or "> ". The carat (^) symbol means "beginning of line".

Regular expressions (often referred to as "regexp" for short) are another very powerful way to both search and change text; if you're interested, there's a wealth of online information about them you can peruse. Regular expressions at first appear to be pretty straightforward, but it's actually a pretty deep language concept, involving a kind of language called a "context free" language, which are all languages that are processable by a construct called a "push down automaton". To give a general handle on the first, humans speak natural languages. Context free languages are languages where the meaning of a string of characters is not dependent in any way on any strings that may surround it (eg 'abdde' is embedded in 'thdrabddethre'; the meaning of abdde is not changeable in any way by the text surrounding it in a context free language). There are context dependent languages that are not natural languages like English or Swahili; all turing complete programming languages like C, rexx, perl, java, etc fall into this category.

This is all from a course I took a couple of years ago, so if I've screwed up some specific, I'm sure there will be lotsa people here who can (and probably will) correct me.

If you're interested in the kinds of constructs that can process languages, I'd suggest first reading about 'finite state automata' before reading about 'push down automata', because a push down automaton is basically a finite state automaton with a memory in the form of what's called a 'stack' in computer science. I can rattle on for a significant time on those things, but perhaps it'd be better if you were to look them up for yourself, not least because I don't have all day to spill words into IWeThey today:)

Anyway, there's a knife and fork, dig in my friend!
--\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-------------------------------------------------------------------
     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)

If there are really aliens, I would think that L. Ron Hubbard would have to be one of them.
97 ms