Vim

xiaoxiao2021-03-06  83

Content-Type: Text / HTML

VIMSECTION: User Commands (1)

Updated: 1998 December 28

Index

Return to main contents

Name Vim - Improved VI, programmer's text editor

Outline

vim [options] [file ..]

Vim [Options] -

Vim [options] -t tag

vim [options] -q [errorfile]

EX View GVIM GVIEW RVIM RVIEW RGVIM RGVIEW

description

VIM is a text editor that is compatible with VI. Used to edit any ASCII text. It is especially useful for editing the source program.

Compared with VI, VIM has made considerable extensions: multi-level UNDO, multiple windows, and buffers, syntax highlights, command line editing, file name automatic, online help, visualization, etc. See "Help vi_diff" between the distinction between VIM and VI

When running Vim, use the ": Help" command to get a lot of help through the online help system. See the ON-Line Help section below.

Most of the time, available

Vim file

Command, start VIM to edit a single file. More common way to start VIM is to use this command:

Vim [options] [filelist]

If a file list is missing, an empty buffer is opened when the editor starts running. Otherwise, one of the following four parameters may be used to select one or more files.

File ..

File name list. The first as a current file is read into the buffer. The cursor will stay on the first line of the buffer. Use the ": next" command to switch to the rest of the file. In front of the file list, add "-" to quickly and edit a file.

-

The file that needs to be edited comes from standard input (stdin). The command is read from STDERR, where stderr should be used as a terminal (TTY).

-t {tag}

This tag (TAG) (a series of GOTO tags) determines the files to edit and the initial cursor position. Find {tag} in the tag file, associated files as the current file, and perform related commands. In most cases, it is used for C procedures, and {tag} may be a function name. The advantage is that the file containing the function will become the current file, and the cursor will stay in the place where the function begins. See ": Help tag_commands".

-q [errorfile]

Start with QuickFix mode. Read file [ErrorFile] and display the first error. If [ErrorFile] is ignored, the file name will be obtained from the 'ERRORFILE' option (the default value in Amiga is "Aztecc.err", which is "ErrorS.Vim" in other systems. Use ": CN" to jump to display the rest of the error. See "Help Quick-fix".

Vim may have different execution methods based on different command parameters (may be the same file performed).

Vim

"Normal" mode, all options take defaults.

EX

Start in EX mode. Use the ": vi" command to enter the normal mode. Can also be performed using the "-e" parameter.

View

Start with the "read-only" mode. The file is written. The "-r" parameter can also be used.

GVIM GVIEW

The pattern user interface starts a new window. The "-g" parameter can also be used. RVIM RVIEW RGVIM RGVIEW

Also, but there is a restriction. Cannot turn on the command interpreter or hang

Vim. "-Z" parameters can also be used.

Options Options can be arbitrarily, before or after the file name. Options without parameters can be combined after a single "dash".

[NUM]

The cursor is positioned on the designated line of the first file (NUM). If the line number (NUM) is empty, the cursor is positioned to the last line.

/ {PAT}

The cursor is positioned in the first {PAT} of the first file. For more effective lookup mode, please refer to ": Help Search_pattern".

{Command}

-c {command}

Command ({Command}) will be executed after the first file read. This command is explained as an "ex command". If the command ({Command}) contains space, the required double quotes include (based on the interpreter used). For example: vim " set si" main.c

Note: Up to ten " " or "-c" commands can be used.

-b

Binary mode. A less use option to set the editing binary or executable.

-C

Compatible mode, set the 'compatible mode' option. Even in the case where there is ".vimrc" file,

Vim is very like VI.

-d {device}

Open the device as a terminal. For Amiga. For example: "-d con: 20/30/600/150".

-e

Use the EX mode to open

Vim, as if you do call "EX".

-f

Frontier mode. For graphical user interface,

When Vim is turned on, it is not separated from the command interpreter, and Amiga,

Vim does not reope with a new window. when

Vim is used by a program to wait for the editing process (such as mail program), which needs to be used. The command will be invalid for the Amiga, ": SH" and ":!" Commands.

-F

in case

Vim is compiled with FKMAP (using the left to left the left, Persian keyboard map) support mode, which makes

Vim started in Persian mode, that is, "fkmap" and "Rightleft" options. Otherwise error message will appear,

VIM will also be interrupted.

-g

in case

Vim uses the GUI support mode to compile the GUI to take effect. If you do not compile with the GUI support mode, an error message will occur.

VIM will also be interrupted.

-H

The Vim exits gives some command line parameters and options.

-H

in case

VIM is compiled with RightLeft (using the left to left the left, Hebrew keyboard map) support mode, which makes

Vim starts with Hebrew mode, that is, "HKMap" and "RightLight" options. Otherwise error message will appear,

VIM will also be interrupted.

-i {viminfo}

This option uses this file name to replace the default "~ / .viminfo" file in the user using the VIMINFO file. You can also use "NONE" to skip the use of ".viminfo" file.

-L

The same as -r.

-L

Lisp mode. Set the 'Lisp' and 'ShowMatch' options to open.

-M

Prohibit the modification of the file. Reset the 'WRITE' option so that the modified file is impossible. NN

Non-compatible mode. Reset the 'compatible' option. This setting will make

The performance of VIM has been improved, but at the same time sacrifies the compatibility with VI, it is true when the .vimrc file does not exist.

NN

Do not use the exchange file. So when you accidentally, the file cannot be recovered. If you edit a file on a slow medium (such as: floppy disk), please feel free to manually. This parameter can also be set by entering ": SET UC = 0" in the command status. Cancel this function Enter ": SET UC = 200" in command line.

-o [n]

Open N windows. If n is ignored, open a window for each file.

-R

Ready mode. The 'Readonly' option will be set. You can still edit the buffer, but you can prevent you from overwriting the file unintentionally. If you need to overwrite the file, add an exclamation mark for the EX command, such as ": w!". The -r option also implies the -n option (see below). You can reset the 'Readonly' option with ": set Noro". See "Help 'Readonly'".

-r

Enumerate the exchange files, and information on the use of them for recovery.

-r {file}

Recovery mode. The switching file is used to recover the destroyed editing process. The file name of the other file is added after the file name of the original file, plus ".swp" suffix name. See "Help Recovery".

-S

Silent mode. You can only start in the command state, or add "-e" parameters before the "-s" parameter.

-s {scriptin}

This parameter reads into script file {scription}. The characters in the file are explained like you knock in. You can also use ": Source! {Scription}" in the command state to set this mode. If the editor has read the bottom of the script file before you quit, the editor will read the character from the keyboard.

-T {terminal}

tell

Vim you want to use. It is only used if it is not working in automatic mode. The terminal used must be

Vim knows the built-in terminal, or the terminal defined in the Termcap or Terminfo file.

-u {vimrc}

This parameter is initialized using the commands in the file specified by {VIMRC}. Other initialization will be ignored. Use this option to edit a special type of file. You can also set {vimrc} to "None" to skip all initialization. For more details, see "Help Initialization" in VIM.

-U {gvimrc}

This parameter uses commands in file {gvimrc} for GUI initialization. Other GUI initialization will be skipped. You can also set {GVIMRC} to "None" to ignore all GUI initialization. For more details, see "Help GUI_INIT" in VIM.

-V

redundancy. Given the file message regarding which is used as a source file and used to read a VimInfo file.

-V

Start with VI mode

Vim, just like the file name of the executable file is "VI". This only affects when the executable is called "EX".

-w {scriptout}

All characters you entered are recorded in file {scriptout} until you quit

Vim. If you want to create a script file to use and "Vim -s" or ": Source!", It is active. Additional characters are added if the {scriptout} file exists.

-W {scriptout}

Similar to -w, but overrides the existing file.

-x

The document read and written by encrypted filtration. Not implemented.

-Z

Limit mode. Like the executable work as starting with "R".

- means the end of the option. The variable after this will be processed as a file name. This will be able to edit a file name that starts with a "-".

Online help

Enter ": HELP" in VIM to start. Enter ": Help Subject" to get help on specific topics. For example: Enter "Help ZZ" to get help with the "ZZ" command. Use and Ctrl-D to complete the topic ("Help Cmdline_completion"). Use tags to represent jump from one position to another (superlink type, see ": help"). All document files can be viewed in this way, such as "Help syntax.txt".

file

/usr/share/vim/vim54/doc/*.txt

VIM document file. Use "Help Doc-file-List" to get a full list.

/ usr / share / vim / vim54 / doc / tags

The tag file is used to find information in the document file.

/usr/share/vim/vim54/syntax/syntax.vim

The system has a wide range of syntax initialization.

/usr/share/vim/vim54/syntax/*.vim

Syntax files for different languages.

/ usr / share / vim / vimrc

System range

Vim initialization operation.

/ usr / share / vim / gvimrc

System range GVIM initialization operation.

/usr/share/vim/vim54/optwin.vim

Scripts for the ": Options" command, a good way to view and set up options.

/usr/share/vim/vim54/Menu.vim

The menu initialization operation of the system-wide GVIM.

/usr/share/vim/vim54/bugreport.vim

The script used to generate an error report. See "Help Bugs".

/usr/share/vim/vim54/filetype.vim

Monitor the script of the file type through the file name. See ": Help 'filetype'".

/usr/share/vim/vim54/scripts.vim

Monitor file type scripts by file content. See ": Help 'filetype'".

For the latest news, please read the VIM Home:

See

Vimtutor (1)

Author

Most of Vim is written in Bram Moolenaar, which has received a lot of help from others. See "Help Credits".

Vim was originally developed for Stevie, which was perfect for Tim Thompson, Tony Andrews and G.r. (FRED) Walter. Although any original code is almost reserved.

Error is very likely. For a list of known issues, see "Help Todo".

Note that many people are considered to be wrong, actually too loyal to the function of reproducing VI. And if you are wrong, think "Because VI is not the same", you should pay more attention to see the vi_diff.txt file (or type ": help vi_diff" in the VIM). Look at the 'Compativle' and the 'cpoptions' option.

Translator China Linux Forum Rendering Group: Fly2fire, Hecaifa, Leon, Midzhou, sail, MJC, Week. Coordination, finishing: team leader Zeo. Author: Wang Li

转载请注明原文地址:https://www.9cbs.com/read-121527.html

New Post(0)