|
|
Since there wasn't a place to ask specific questions about vi and (hopefully) have them answered, I hereby dedicate this item to those of us who are new to vi or still learning as they go. In fact, come to think of it, I've got a few questions:
24 responses total.
Is there a spell checker on this system? If so, how can I use it? Is it accessible from within vi?
What would account for the ESC key working on some systems as a swithc between command and insert modes in vi, and totally failing to work on other systems (so that I have to use ctrl-c)? (I don't recall changing anything about the terminal or the comm program that would cause this.)
Carl, for basic information on the spell checker, try man spell from a shell prompt (or !man spell from Picospan). Its default behavior is, I believe, to check words read from the standard input or named files, check them against its list, and regurgitate the ones it doesn't like. I think I know how to use it from vi in a kludgy way, but I'm sure there's a real way, & I trust someone who really knows will jump in.
Carl: not to start an editor war, but have you tried using Jove? It's much easier to use, at least IMHO... And it can be fairly easily configured to run almost as if it were an editor actually running on your Laser! do a 'cp /u/power/.joverc /u/carl/.joverc' and fire up Jove to give it a try....
re #2: with my program, I have to use open-apple-ESC to send an ESC to the host. Just using ESC takes me to the menu of the term software. Is your term doing something like that?
re #3 Thanks! I'll give it a try.
re #5: Hmm. Jove does sound interesting--just when vi is beginning to make sense. Russ, do you think you could give a short description of it, including how to get help? (It could have it's own item, since this is about vi ;-)
Okay, one for the vi gurus: is there a way to get in "overstrike" mode? That's when what I type replaces what's already there. I know that "r" allows one character to be typed over--I'm just hoping there's a way to do that without pushing "r" before each character...
Well, you can sort of do this. The command "ncw" will allow you to change n number of words. The string can be longer or shorter than the words you replace. When you hit the ESC key, the text will be adjusted accordingly.
Re #2: Hmm, puzzling. One possibility is that on some systems you have a .exrc file (vi initialization file) that maps ESC to some other function. If it's not your comm program that's doing it, I can't think of any other explanation. On every vi I've ever use, ESC takes one from insert mode to command mode. Re #8, #9: Actually, there is an explicit overstrike-mode command: "R" (upper case) will do it.
I like the "cw" commnd, though. That way you can control exactly how much you want to replace.
I like cw when in many cases, & use it much more often than R. But it can be a pain when there are more than a few words or when there are punctuation marks (which tend to get counted as 1 word each).
To get help with Jove, type 'teachjove' at a command prompt (before copying my .joverc to your directory, that will change the key bindings around, so, for example, your arrow keys work like arrows. This is very nice, but can get in the way when the tutorial doesn't know about it and tells you to press something :) )....
One more question. What is the Yank command? I've got a list of to yank a character, a line, a paragraph; but don't know what that means.
It puts a copy of the specified text into a buffer; then you can move the cursor somewhere else & use the put commands to put it there. By default yank and deleting use the same buffer, so you want to move & do your put right away, before you overwrite your buffer without noticing it. (I.e., don't stop & change something else you happen to notice.) And each time you issue a yank or delete command you're clearing the buffer; if you delete a word with dw , you get the word in the buffer, but if you delete it one character at a time (with xxxxx if it's a 5-letter word) the buffer will contain the last-deleted single character. So form the habit of determining how much you want to delete (or yank) and doing it in one swell foop. As far as put goes, I believe P puts the buffer's contents before the cursor, p puts them after the cursor; if you've yanked or deleted a whole line the a line will be inserted before or after your entire current line, not in the middle where your cursor happens to be. (Or however many lines you've yanked or deleted in one operation.) If you've done something like 5dw & deleted 5 words, p will get you those 5 words immediately after your cursor position. (Somebody let me know if I'm wrong, OK?) There's a way to use more buffers, but I never can remember it when I need it, so I never use it enough to remember it. <sigh> I'm sure someone else will tell me now, though, right?
I would if I could remember it, but I never use it enough to remember it. :) (But I can look it up, so you may see something later...) Re #12: If you type cW instead of cw, vi will treat each block of non-blank characters as a word, & thus lump a word together with adjoining punctuation.
Thanks! There are *lots* of times that would help.
Thanks for the info! Next question...(gee, I'm full of them. ;-) Are there different versions or pathnames to vi? I just noticed that when I changed my shell from bbs to sh, I lost my erase character. Everything else works the same, except for my favorite key to unbotch a mistake. Oh, and while I'm at it, is there a way to "automatically" add linefeeds to a long text file, so that a don't get a "line too long" error when trying to edit the file?
I answered my own question about the erase key. When I discovered it didn't work outside of vi, it occured to me that I might need an "stty erase ^?" in the .profile. That's all it needed.
Re #18, last paragraph: Not sure if this would work, but you could
try running the file through the formatter program 'fmt':
fmt < oldfile > newfile
where 'oldfile' is the file containing the long lines. (Should work
unless fmt itself has a limitation on how long the input lines can be.)
This response has been erased.
This response has been erased.
no error here, terminal is too dumb to make errors .........
r 21
Response not possible - You must register and login before posting.
|
|
- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss