Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: GVIM Editor

From: joel:neely:fedex at: 13-Mar-2002 6:48

Hi, again, Louis, Dr. Louis A. Turk wrote:
> I made the files you suggested, and did what you said, and it > worked. However, when I place the cursor in the middle of a > line where I actually want the text to be inserted, it still > does not work. Instead the text is inserted _above_ the line > ... >
Aha! Now I understand (sorry for not thinking of this earlier...) When you Put text (or Paste, if you prefer) into the buffer, the text will be Put into the new place at the same "level" that it it was Yanked. If you yanked one or more lines in the original case, then they will be put in as lines. However, you don't have to yank whole lines. If you have a little buffer containing this is a test what if I wanted to insert some text in the middle of a line like right here, for example? is that possible? then you can: - place the cursor at the beginning of the word "insert" on the second line, for example by 1G/ins followed by the enter key, - enter the command y3w to Yank the following three Words, - enter the command /here followed by the enter key, to move to the word here in the fourth line, - enter the command P to Put the currently-held text into the buffer just in front of the cursor -- at which point the buffer looks like this this is a test what if I wanted to insert some text in the middle of a line like right insert some texthere, for example? is that possible? with the cursor still on the "h" of "here" - type the lower-case letter "a", a space, and escape, to insert a space Ahead of the "h" in "here", and no line-breaking occurs, because you were dealing with words instead of lines. I was doing all of the above using a vim window open beside my email window while writing. Now, I just did a little experiment (but remember that I'm on vim 5.5 at home) where I undid the last changes above, came back to this email editing window (in Netscape), selected and copied the phrase "insert some text" from the sample above, went back to the vim window, placed the cursor on the "h" in the word "here", and typed "*P at which point vim stuck the three words "insert some text" into the line just as before. The moral is If you cut/copy lines, you'll paste lines, if you cut/copy words, you'll paste words. I hope that helps. -jn-
> I learn best from printed documentation. On-line documentation > is often confusing for a person trying to learn, and is > generally best used mainly for reference in my opinion. >
That is not an uncommon point of view. Forunately, the on-line documentation for vim is actually supplied as text files that get installed with the software, so you actually *can* print those files off and read them at your leisure. Some of the tutorials can be *quite* helpful. Also, O'Reilly has a good book on vi that includes discussion of vi clones such as vim and elvis, and there's a New Riders book by Steve Oualline that is specific to vim and provides a VERY detailed look at its features.
> It is because of you that I am trying vim. >
I'm frightened to think that I might be corrupting yet another generation of programmers!!! ;-) Seriously, thanks for the kind words; as always, my views are only my opinions, which you are free to use or ignore as you find appropriate. -jn- -- ; sub REBOL {}; sub head ($) {@_[0]} REBOL [] # despam: func [e] [replace replace/all e ":" "." "#" "@"] ; sub despam {my ($e) = @_; $e =~ tr/:#/.@/; return "\n$e"} print head reverse despam "moc:xedef#yleen:leoj" ;