vim - Vi IMproved, a programmer's text editor

Overview (SYNOPSIS)


vim [options] [file ..]
vim [options] -
vim [options] -t tag
vim [options] -q [errorfile]


ex
view
gvim gview
rvim rview rgvim rgview

 

Description (DESCRIPTION)

Vim is upward compatible with Vi text editor, it can be used to edit any ASCII text, especially suitable for editing programs.

It made a number of enhancements Vi: multi-layer undo, multi-window, multi-buffer (buffer), high-brightness display syntax, command line editing, filename matching, on-line help, visual selection, etc. use ":. Help vi_diff.txt "look Vim summary of the differences and Vi.

In the run Vim can be used when ": help" command to get a lot of help refer to the following online Help one.

Generally available

       vim file

Command to open Vim to edit a file. In a nutshell, you can use

       vim [options] [filelist]

Command to run Vim. If no file name, the editor will open an empty buffer. Otherwise, it will use a four of the following to select the files to be edited.

file ..
.. The first list of file names will be read into the buffer as the current file, the cursor will stop at the first line of the buffer you can use ": next" command to go to other file if you want to edit a start with - "." . the files in the preceding list with "-".
-
Reads from the standard input file edited from the standard error output (terminals should be) read command.
-t {tag}
The initial position of the cursor and the edited file is determined by the tag (Tag), as one kind of flag bit goto label (goto label). Find the tag in a tag file, the corresponding file becomes the current file, the corresponding command is executed. This are commonly used in C programs, mark is the function name, the current file is the file that contains the function, the cursor at the beginning of the function see. ": help tag-commands".
-q [ErrorFile]
Into the Quick Fix mode operation. Read [errorfile] file and displays the first error. If there is no [errorfile] file, the file name from the 'errorfile' option determines (in the Amiga as "AztecC.Err", as in other systems "errors.vim") can be used. ": cn" command to jump to another error to see. ": help quickfix".

Vim will behave differently depending on the command, although they may be an executable file.

vim
Normal mode is the default state for all.
ex
Running in Ex mode with the ": vi" command to enter the normal mode can also add "-e" option to enter this mode.
view
Run in read-only mode. You are prohibited write files can also add "-R" option to enter this mode.
gvim gview
GUI version. Open a new window can also add "-g" option to enter this mode.
rvim rview rgvim rgview
With the same above, but add restrictions, you can not run the shell program, can not suspend Vim. Can also add "-Z" option to enter this mode.

 

Options (OPTIONS)

All options can appear in any order, before the file name can also be the option with no arguments can appear in a file name. "-" later.

+ [A]
For the first file the cursor will be in the first line "num". If there is no "num", the cursor will stop at the last line.
+/{pat}
For the first file the cursor will be in place {pat} first occurrence of the search pattern to see. ": Help search-pattern".
+{command}
-c {command}
After reading the first file execution command {command} {command} should Ex command if {command} contains spaces, must be enclosed in double quotes (this depends on the shell) Example:... Vim " + set si "main.c
Note: you can use up to 10" + "or" -c "command.
-b
Binary mode set some options, so that you can use to edit and binary executable files.
-C
Compatible Setting 'compatible' option. In this way, even if there is .vimrc file Vim will like Vi basically the same.
-d {device}
Open {device} is used as the terminal, only in Amiga. Example: "-d con: 20/30/600/150".
-e
Operation in Ex mode Vim, just run "ex" the same.
-f
Foreground. For the GUI version, Vim will not run with its shell separated. In the Amiga, Vim is not restarted to open a new window. This option will be used when Vim is executed another program, and this program want to wait time (such as mail) to edit the action after the end of the run. On the Amiga " : sh "and":! "will not work.
-F
If Vim Compiled with support for right-to-left written documents FKMAP and Farsi keyboard mapping, Vim will run in Farsi mode, such as setting 'fkmap' and 'rightleft' option. Otherwise Vim displays an error message and terminates.
-g
If Vim compiled with GUI support, the GUI will open, otherwise Vim displays an error message and terminates.
-h
Vim display the help command-line parameters and options, and then terminate.
-H
If Vim Compiled with support for right-to-left written documents RIGHTLEFT and Hebrew keyboard mapping, Vim will run in Hebrew mode, such as setting 'hkmap' and 'rightleft' option. Otherwise Vim displays an error message and terminates.
-i {viminfo}
Permit the use viminfo file, use this option to set the file name, the default is "~ / .viminfo". With "NONE" file name can be skipped using .viminfo file.
-L
Like -r.
-l
Lisp mode. Open the 'lisp' and 'showmatch' option.
-m
Do not modify the file. Settings 'write' option, so you can not write files.
-N
Non-compatibility mode. Setting 'compatible' option so Vim will perform better, even if .vimrc file does not exist, nay Vi incompatible.
-n
. Never swap file, so the file can not be restored after the collapse of a very good document for editing in a very slow medium (eg floppy disk), you can also use ": set uc = 0" prohibit the exchange, with ": set uc = 200 "open exchange.
-o [N]
Open N windows. If there is no N, open a window for each file.
-R
.. Read-only mode set 'readonly' option you can still edit the buffer, but can not rewrite the file if you want to rewrite the file, it must Ex command with an exclamation point, for example. ": W!" -R option implies. . -n option (see below) 'readonly' option can be used ": set noro" set see. ": help 'readonly'".
-r
List swap files, display information about restoring files.
-r {file}
. Recovery Mode swap file is used to restore collapsed in the editing process file name is the swap file is added to edit the file name behind ".swp" See.. ": Help recovery".
-s
Quiet mode only with "Ex" or start with the "-e" option is useful.
-s {scriptin}
Read the script file {scriptin} characters in the file just as if you had typed the same, you can also use ": source {scriptin}!" Command to achieve this while attending to the document before the end of the editor tail, it followed from. keyboard read.
-T {terminal}
Tell Vim the name of the terminal you are using, only when it can not be determined automatically so it must be Vim (the BUILTIN) can identify the terminal or defined in the termcap or terminfo file.
-u {vimrc}
{Vimrc} file with a command to initialize, skip all other initialized to edit with this special type of file can be used to skip all initialization "NONE" used in vim.. ": Help initialization" see more and more information.
-U {} gvimrc
{Gvimrc} file with a command to initialize the GUI, the GUI initialize skip all other, may be initializing skip all GUI "NONE" used in vim. ": Help gui-init" for more information.
-V
Lengthy. Display perform initialization code and read documents, and write viminfo file.
-v
Run in Vi mode Vim, just run "vi" the same, only to run "ex" is useful only.
-w {scriptout}
All Vim before exiting the characters you type will be stored {scriptout} This file is used to create a script file, you can use "vim -s" and.. ":! Source" to use if {scriptout} exist, the characters are appended to the back.
-W {scriptout}
Like -w, but is overwriting the original file.
-x
Encryption when writing files. Will prompt you to enter a password.
-WITH
Restricted Mode On the same program running at the beginning of the "r" the same effect.
--
Options show ends after this parameter will be regarded as filenames, you can use this to edit with a '-' beginning of the document.

Online Help (ON-LINE HELP)

In Vim , type in ": help" to get help with. ": Help subject" to get help on a specific topic for example. ": Help ZZ" to get help for the "ZZ" with <Tab> and CTRL-. D to help complete the theme. ( ": help cmdline-completion ") can be marked jump from one place to another (sort of like hypertext links, see ": help"). All such documents can browse, such as ": help syntax.txt".

File (FILES)

/usr/share/vim/vim56/doc/*.txt
Vim . Documents with ": help doc-file-list " for a complete list.
/usr/share/vim/vim56/doc/tags
Find a tag file information in the document file.
/usr/share/vim/vim56/syntax/syntax.vim
System initialization file grammar.
/usr/share/vim/vim56/syntax/*.vim
Various grammar file for the language.
/usr/share/vim/vimrc
System Vim initialization file.
/usr/share/vim/gvimrc
Gvim system initialization file.
/usr/share/vim/vim56/optwin.vim
": Options" command script file used, this is a view and set the options very good way.
/usr/share/vim/vim56/menu.vim
gvim menu system initialization file.
/usr/share/vim/vim56/bugreport.vim
Used to generate the error reporting script file, see ": help bugs".
/usr/share/vim/vim56/filetype.vim
According to the file name to determine the file type of script files, see ": help 'filetype'".
/usr/share/vim/vim56/scripts.vim
According to the contents of the file to determine the file type of script files, see ": help 'filetype'". 

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11102211.html