setenv EXINIT 'set ai nu wm=3'
If you want to put more than one command in the setenv EXINIT thing, separate the commands with a vertical bar (|). For example, to map the 'g' command to the 'G' character in command mode, the command is :map g G, and combined with the above command, you get this:
setenv EXINIT 'set ai nu wm=3|map g G'
If you want to create the file called .exrc, you can put exactly the same things in the file as shown in the quotes after the EXINIT.
Recovering Your Work When Something Goes Wrong with Your Terminal
The VI editor edits a temporary copy of your file, and after the editing is complete, or when you tell it to save, it puts the contents of the temporary copy into the original file. If something goes wrong while you are editing your file, the VI editor will attempt to save whatever work you had in progress, and store it for later recovery. (Note: If VI dies while you were working on any file, it sends you an email message on how to recover it. The -r option stands for recovery. If you were editing the file vitalinfo, and you accidentally got logged out, then the -r option of the 'vi' editor should help. The command would look somewhat like this: vi -r vitalinfo After using the -r option once, though, you MUST save what you have recovered to the actual file... The -r option only works once per failed VI session.
Warning About Using VI on the Workstations
There are two things to be aware of when using the workstations: Editing the same file many times at once, and changing the size of the screen.
Because VI edits a copy of your original file and saves the contents of that copy into the original file, if you are logged on more than once and are editing the same file more than once using VI, if you save on one window and then you save on the other window, the changes made to the file on the first save would be overwritten. Make sure that you only run one copy of VI per file.
If you use a terminal program from a workstation, you can change the size of the screen by dragging the sides of the window. If the size is not working properly, the command to type is this:
eval `resize`If that doesn't work the command would be this:
eval `/usr/bin/X11/resize`If the size is wrong, the editor will not operate correctly. If you have any problems with the screen size, ask the monitors in the computer lab for help setting the sizes correctly.
Summary of VI commands
This list is a summary of VI commands, categorized by function. There may be other commands available, so check the on-line manual on VI. For easy reference, you can save this file as text and delete any commands you don't think you would use and print out the resulting shorter file.
Cutting and Pasting/Deleting text
- "
- Specify a buffer to be used any of the commands using buffers. Follow the " with a letter or a number, which corresponds to a buffer.
- D
- Delete to the end of the line from the current cursor position.
- P
- Paste the specified buffer before the current cursor position or line. If no buffer is specified (with the " command.) then 'P' uses the general buffer.
- X
- Delete the character before the cursor.
- Y
- Yank the current line into the specified buffer. If no buffer is specified, then the general buffer is used.
- d
- Delete until where. "dd" deletes the current line. A count deletes that many lines. Whatever is deleted is placed into the buffer specified with the " command. If no buffer is specified, then the general buffer is used.
- p
- Paste the specified buffer after the current cursor position or line. If no buffer is specified (with the " command.) then 'p' uses the general buffer.
- x
- Delete character under the cursor. A count tells how many characters to delete. The characters will be deleted after the cursor.
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




