自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

vim 中文man頁面

系統(tǒng)
Vim 是一個同 Vi 向上兼容的文本編輯器, 可以用來編輯任何 ASCII 文本, 特別適合用來編輯程序。

名稱 (NAME)

vim - Vi IMproved, 一個程序員的文本編輯器

總覽 (SYNOPSIS)


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


ex
view
gvim gview
rvim rview rgvim rgview

描述 (DESCRIPTION)

Vim 是一個同 Vi 向上兼容的文本編輯器, 可以用來編輯任何 ASCII 文本, 特別適合用來編輯程序。

它對 Vi 作了許多增強(qiáng): 多層撤銷, 多窗口, 多緩沖區(qū)(buffer), 高亮度語法顯示, 命令行編輯, 文件名匹配, 在線幫助, 可視選定, 等等。 用 ":help vi_diff.txt" 看 Vim 和 Vi 的差別的摘要。

在運(yùn)行 Vim 的時候可以用 ":help" 命令獲得很多幫助。參考下面的在線幫助一節(jié)。

一般可用

       vim file
 

命令打開 Vim 來編輯一個文件。 概括的說, 可以用

       vim [options] [filelist]
 

命令來運(yùn)行 Vim 。 如果沒有文件名, 編輯器就會打開一個空的緩沖區(qū)。否則就會用下面四個中的一個來選擇要編輯的文件。

file ..
文件名列表。 ***個會作為當(dāng)前文件讀入緩沖區(qū), 光標(biāo)會停在緩沖區(qū)的***行。你可以用 ":next" 命令轉(zhuǎn)到其它的文件。 如果要編輯一個以 "-" 開頭的文件, 在文件列表前面加上 "--"。
-
從標(biāo)準(zhǔn)輸入讀取被編輯的文件。 從標(biāo)準(zhǔn)錯誤輸出(應(yīng)該是個終端)讀入命令。
-t {tag}
被編輯的文件和光標(biāo)的初始位置由標(biāo)記(tag)決定, 標(biāo)記有點像一種 goto 標(biāo)簽 (goto label)。在標(biāo)記文件中找到標(biāo)記, 相應(yīng)的文件成為當(dāng)前文件, 相應(yīng)的命令被執(zhí)行。 這種方式常用于 C 程序, 標(biāo)記就是函數(shù)名, 當(dāng)前文件就是包含那個函數(shù)的文件, 光標(biāo)停留在函數(shù)的開始處。見 ":help tag-commands"。
-q [errorfile]
運(yùn)行時進(jìn)入快速修復(fù)模式。讀取 [errorfile] 文件并顯示***個錯誤。 如果沒有 [errorfile] 文件,文件名由 'errorfile' 選項決定 (在 Amiga 為 "AztecC.Err", 在其他系統(tǒng)中為 "errors.vim")??梢杂?":cn" 命令條到其它錯誤處。見 ":help quickfix"。

Vim 會根據(jù)不同命令有不同的表現(xiàn), 盡管它們可能是用一個可執(zhí)行文件。

vim
正常模式, 所有都是默認(rèn)狀態(tài)。
ex
以 Ex 模式運(yùn)行。 用 ":vi" 命令進(jìn)入正常模式。 也可以加上 "-e" 選項進(jìn)入此模式。
view
以只讀模式運(yùn)行。 你被禁止寫文件。 也可以加上 "-R" 選項進(jìn)入此模式。
gvim gview
GUI 版本。開啟一個新的窗口。 也可以加上 "-g" 選項進(jìn)入此模式。
rvim rview rgvim rgview
同上面的相同, 只是加上了限制, 不能運(yùn)行 shell 程序, 也不能暫停 Vim 。 也可以加上 "-Z" 選項進(jìn)入此模式。

選項 (OPTIONS)

所有選項都可以以任何順序出現(xiàn), 可以在文件名前, 也可以在文件名后。沒有參數(shù)的選項可以出現(xiàn)在一個 "-" 后面。

+[num]
對于***個文件, 光標(biāo)會停在第 "num" 行。 如果沒有 "num" , 則光標(biāo)會停在***一行。
+/{pat}
對于***個文件, 光標(biāo)會停在 {pat} ***次出現(xiàn)的地方。 搜尋模式見 ":help search-pattern"。
+{command}
-c {command}
讀入***個文件后會執(zhí)行 {command} 命令。 {command} 應(yīng)為 Ex 命令。如果 {command} 中包含有空格, 必須用雙引號括?。ㄟ@個取決于所用的 shell)。例: Vim "+set si" main.c
注意: 你可以用最多 10 個 "+" 或者 "-c" 命令。
-b
二進(jìn)制模式。設(shè)置一些選項, 這樣就可以用來編輯二進(jìn)制和可執(zhí)行文件了。
-C
兼容。 設(shè)置 'compatible' 選項。 這樣就算存在 .vimrc 文件 Vim 也會基本上象 Vi 一樣了。
-d {device}
它開 {device} 用作終端, 只在 Amiga 下。例: "-d con:20/30/600/150".
-e
以 Ex 模式運(yùn)行 Vim , 就像運(yùn)行 "ex" 一樣。
-f
前臺運(yùn)行。 對于 GUI 版本, Vim 不會同運(yùn)行它的 shell 分離。在 Amiga 中, Vim 不會重新啟動來開啟一個新窗口。這個選項會用在當(dāng) Vim 被另外一個程序執(zhí)行, 并且這個程序想等編輯動作結(jié)束后再運(yùn)行的時候(如 mail)。 在 Amiga 上 ":sh" 和 ":!" 不會起作用。
-F
如果 Vim 編譯時加入了對從右到左書寫的文件 FKMAP 以及 Farsi 鍵盤映射的支持, Vim 會以 Farsi 模式運(yùn)行, 比如設(shè)置 'fkmap' 和 'rightleft' 選項。不然 Vim 會顯示一條錯誤信息并終止。
-g
如果 Vim 編譯時加入 GUI 支持, 會開啟 GUI, 不然 Vim 會顯示一條錯誤信息并終止。
-h
Vim 顯示命令行參數(shù)和選項的幫助, 然后終止。
-H
如果 Vim 編譯時加入了對從右到左書寫的文件 RIGHTLEFT 以及 Hebrew 鍵盤映射的支持, Vim 會以 Hebrew 模式運(yùn)行, 比如設(shè)置 'hkmap' 和 'rightleft' 選項。不然 Vim 會顯示一條錯誤信息并終止。
-i {viminfo}
準(zhǔn)許使用 viminfo 文件, 這個選項設(shè)置使用的文件名, 默認(rèn)的是 "~/.viminfo"。 用 "NONE" 文件名也可以跳過使用 .viminfo 文件。
-L
同 -r 一樣。
-l
Lisp 模式。打開 'lisp' 和 'showmatch' 選項。
-m
禁止修改文件。 重置 'write' 選項, 這用就不能寫文件了。
-N
非兼容模式。 重置 'compatible' 選項。 這樣 Vim 會表現(xiàn)得更好, 就算 .vimrc 文件不存在也會同 Vi 不兼容。
-n
禁止交換文件, 這樣在崩潰后就不能恢復(fù)文件了。 對于編輯在很慢的媒體中的文件很有好處(比如軟盤), 也可以用 ":set uc=0" 禁止交換, 用 ":set uc=200" 開啟交換。
-o[N]
打開 N 個窗口。如果沒有 N, 為每個文件開一個窗口。
-R
只讀模式。設(shè)置 'readonly' 選項。 你人染可以編輯緩沖區(qū), 但是不能重寫文件。 如果你要重寫文件,必須在 Ex 命令中用驚嘆號, 比如 ":w!"。
 -R 選項包含有 -n 選項(見下)。 見 ":help 'readonly'"。
-r
列出交換文件, 顯示關(guān)于恢復(fù)文件的信息。
-r {file}
恢復(fù)模式。交換文件是用來恢復(fù)在編輯過程中崩潰了的文件。 交換文件名是被編輯文件名后面加上 ".swp"。見 ":help recovery"。
-s
安靜模式。 只在用 "Ex" 啟動或者用了 "-e" 選項才有用。
-s {scriptin}
讀入腳本文件 {scriptin} 。 文件里的字符就像你直接輸入一樣的, 也可以用 ":source! {scriptin}" 命令實現(xiàn)這個功能。 如果在編輯器結(jié)束前就讀到了文件尾,就接著從鍵盤讀入。
-T {terminal}
告訴 Vim 你用的終端的名字, 只有當(dāng)不能自動確定不了時候才這樣。 它必須是 Vim (builtin) 能辨認(rèn)的終端或者是在 termcap 或者 terminfo 文件中定義了的。
-u {vimrc}
用 {vimrc} 文件里的命令來初始化, 跳過所有其它的初始化, 用這個來編輯特殊類型的文件。也可以用 "NONE" 來跳過所有初始化。 在 vim 中用 ":help initialization" 查看更多信息。
-U {gvimrc}
用 {gvimrc} 文件里的命令來初始化 GUI, 跳過所有其它的 GUI 初始化, 也可以用 "NONE" 來跳過所有 GUI 初始化。 在 vim 中用 ":help gui-init" 查看更多信息。
-V
冗長顯示。 顯示執(zhí)行初始化代碼和讀入的文件, 并且寫 viminfo 文件。
-v
以 Vi 模式運(yùn)行 Vim , 就像運(yùn)行 "vi" 一樣, 只有運(yùn)行 "ex" 時才有用。
-w {scriptout}
所有在 Vim 退出前你鍵入的字符都會被存入 {scriptout} 文件。 這用來創(chuàng)建一個腳本文件, 你可以用 "vim -s" 和 ":source!" 來使用。 如果 {scriptout} 存在, 會把字符追加到后面。
-W {scriptout}
同 -w 一樣, 但是是覆蓋原來的文件。
-x
寫文件時加密。 會提示你輸入密碼。
-Z
受限模式。 同運(yùn)行以 "r" 開始的程序同效。
--
表明選項結(jié)束。 在此之后的參數(shù)都會被認(rèn)為是文件名, 可以用這個來編輯一個以 '-' 開頭的文件。

在線幫助 (ON-LINE HELP)

Vim 中鍵入 ":help" 來獲得幫助。用 ":help subject" 來獲得關(guān)于一個特定主題的幫助。例如用 ":help ZZ" 來獲得關(guān)于 "ZZ" 的幫助。用 <Tab> 和 CTRL-D 來完成主題(":help cmdline-completion")??梢杂脴?biāo)記從一個地方跳到另一個地方(有點像超文本連接, 見 ":help")。所有的文檔都可以這樣來瀏覽, 比如 ":help syntax.txt"。

文件 (FILES)

/usr/share/vim/vim56/doc/*.txt
Vim 文檔文件。用 ":help doc-file-list" 獲得完整的列表。
/usr/share/vim/vim56/doc/tags
在文檔文件中查找信息用的標(biāo)簽文件。
/usr/share/vim/vim56/syntax/syntax.vim
系統(tǒng)語法初始化文件。
/usr/share/vim/vim56/syntax/*.vim
各種語言的語法文件。
/usr/share/vim/vimrc
系統(tǒng) Vim 初始化文件。
/usr/share/vim/gvimrc
系統(tǒng) gvim 初始化文件。
/usr/share/vim/vim56/optwin.vim
":options" 命令所用的腳本文件, 這是個查看和設(shè)置選項的很好的辦法。
/usr/share/vim/vim56/menu.vim
gvim 的系統(tǒng)菜單初始化文件。
/usr/share/vim/vim56/bugreport.vim
用來生成錯誤報告的腳本文件, 見 ":help bugs"。
/usr/share/vim/vim56/filetype.vim
根據(jù)文件名來判定文件類型的腳本文件, 見 ":help 'filetype'"。
/usr/share/vim/vim56/scripts.vim
根據(jù)文件內(nèi)容來判定文件類型的腳本文件, 見 ":help 'filetype'"。

***信息參見 VIM 主頁:
<URL:http://www.vim.org/>

參見 (SEE ALSO)

vimtutor(1)

#p#

NAME

vim - Vi IMproved, a programmers text editor

SYNOPSIS


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


ex
view
gvim gview evim eview
rvim rview rgvim rgview

DESCRIPTION

Vim is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain text. It is especially useful for editing programs.

There are a lot of enhancements above Vi: multi level undo, multi windows and buffers, syntax highlighting, command line editing, filename completion, on-line help, visual selection, etc.. See ":help vi_diff.txt" for a summary of the differences between Vim and Vi.

While running Vim a lot of help can be obtained from the on-line help system, with the ":help" command. See the ON-LINE HELP section below.

Most often Vim is started to edit a single file with the command

       vim file
 

More generally Vim is started with:

       vim [options] [filelist]
 

If the filelist is missing, the editor will start with an empty buffer. Otherwise exactly one out of the following four may be used to choose one or more files to be edited.

file ..
A list of filenames. The first one will be the current file and read into the buffer. The cursor will be positioned on the first line of the buffer. You can get to the other files with the ":next" command. To edit a file that starts with a dash, precede the filelist with "--".
-
The file to edit is read from stdin. Commands are read from stderr, which should be a tty.
-t {tag}
The file to edit and the initial cursor position depends on a "tag", a sort of goto label. {tag} is looked up in the tags file, the associated file becomes the current file and the associated command is executed. Mostly this is used for C programs, in which case {tag} could be a function name. The effect is that the file containing that function becomes the current file and the cursor is positioned on the start of the function. See ":help tag-commands".
-q [errorfile]
Start in quickFix mode. The file [errorfile] is read and the first error is displayed. If [errorfile] is omitted, the filename is obtained from the 'errorfile' option (defaults to "AztecC.Err" for the Amiga, "errors.err" on other systems). Further errors can be jumped to with the ":cn" command. See ":help quickfix".

Vim behaves differently, depending on the name of the command (the executable may still be the same file).

vim
The "normal" way, everything is default.
ex
Start in Ex mode. Go to Normal mode with the ":vi" command. Can also be done with the "-e" argument.
view
Start in read-only mode. You will be protected from writing the files. Can also be done with the "-R" argument.
gvim gview
The GUI version. Starts a new window. Can also be done with the "-g" argument.
evim eview
The GUI version in easy mode. Starts a new window. Can also be done with the "-y" argument.
rvim rview rgvim rgview
Like the above, but with restrictions. It will not be possible to start shell commands, or suspend Vim. Can also be done with the "-Z" argument.

OPTIONS

The options may be given in any order, before or after filenames. Options without an argument can be combined after a single dash.

+[num]
For the first file the cursor will be positioned on line "num". If "num" is missing, the cursor will be positioned on the last line.
+/{pat}
For the first file the cursor will be positioned on the first occurrence of {pat}. See ":help search-pattern" for the available search patterns.
+{command}
-c {command}
{command} will be executed after the first file has been read. {command} is interpreted as an Ex command. If the {command} contains spaces it must be enclosed in double quotes (this depends on the shell that is used). Example: Vim "+set si" main.c
Note: You can use up to 10 "+" or "-c" commands.
-S {file}
{file} will be sourced after the first file has been read. This is equivalent to -c "source {file}". {file} cannot start with '-'. If {file} is omitted "Session.vim" is used (only works when -S is the last argument).
--cmd {command}
Like using "-c", but the command is executed just before processing any vimrc file. You can use up to 10 of these commands, independently from "-c" commands.
-A
If Vim has been compiled with ARABIC support for editing right-to-left oriented files and Arabic keyboard mapping, this option starts Vim in Arabic mode, i.e. 'arabic' is set. Otherwise an error message is given and Vim aborts.
-b
Binary mode. A few options will be set that makes it possible to edit a binary or executable file.
-C
Compatible. Set the 'compatible' option. This will make Vim behave mostly like Vi, even though a .vimrc file exists.
-d
Start in diff mode. There should be two or three file name arguments. Vim will open all the files and show differences between them. Works like vimdiff(1).
-d {device}
Open {device} for use as a terminal. Only on the Amiga. Example: "-d con:20/30/600/150".
-D
Debugging. Go to debugging mode when executing the first command from a script.
-e
Start Vim in Ex mode, just like the executable was called "ex".
-E
Start Vim in improved Ex mode, just like the executable was called "exim".
-f
Foreground. For the GUI version, Vim will not fork and detach from the shell it was started in. On the Amiga, Vim is not restarted to open a new window. This option should be used when Vim is executed by a program that will wait for the edit session to finish (e.g. mail). On the Amiga the ":sh" and ":!" commands will not work.
--nofork
Foreground. For the GUI version, Vim will not fork and detach from the shell it was started in.
-F
If Vim has been compiled with FKMAP support for editing right-to-left oriented files and Farsi keyboard mapping, this option starts Vim in Farsi mode, i.e. 'fkmap' and 'rightleft' are set. Otherwise an error message is given and Vim aborts.
-g
If Vim has been compiled with GUI support, this option enables the GUI. If no GUI support was compiled in, an error message is given and Vim aborts.
-h
Give a bit of help about the command line arguments and options. After this Vim exits.
-H
If Vim has been compiled with RIGHTLEFT support for editing right-to-left oriented files and Hebrew keyboard mapping, this option starts Vim in Hebrew mode, i.e. 'hkmap' and 'rightleft' are set. Otherwise an error message is given and Vim aborts.
-i {viminfo}
When using the viminfo file is enabled, this option sets the filename to use, instead of the default "~/.viminfo". This can also be used to skip the use of the .viminfo file, by giving the name "NONE".
-L
Same as -r.
-l
Lisp mode. Sets the 'lisp' and 'showmatch' options on.
-m
Modifying files is disabled. Resets the 'write' option. You can still modify the buffer, but writing a file is not possible.
-M
Modifications not allowed. The 'modifiable' and 'write' options will be unset, so that changes are not allowed and files can not be written. Note that these options can be set to enable making modifications.
-N
No-compatible mode. Reset the 'compatible' option. This will make Vim behave a bit better, but less Vi compatible, even though a .vimrc file does not exist.
-n
No swap file will be used. Recovery after a crash will be impossible. Handy if you want to edit a file on a very slow medium (e.g. floppy). Can also be done with ":set uc=0". Can be undone with ":set uc=200".
-nb
Become an editor server for NetBeans. See the docs for details.
-o[N]
Open N windows stacked. When N is omitted, open one window for each file.
-O[N]
Open N windows side by side. When N is omitted, open one window for each file.
-R
Read-only mode. The 'readonly' option will be set. You can still edit the buffer, but will be prevented from accidently overwriting a file. If you do want to overwrite a file, add an exclamation mark to the Ex command, as in ":w!". The -R option also implies the -n option (see below). The 'readonly' option can be reset with ":set noro". See ":help 'readonly'".
-r
List swap files, with information about using them for recovery.
-r {file}
Recovery mode. The swap file is used to recover a crashed editing session. The swap file is a file with the same filename as the text file with ".swp" appended. See ":help recovery".
-s
Silent mode. Only when started as "Ex" or when the "-e" option was given before the "-s" option.
-s {scriptin}
The script file {scriptin} is read. The characters in the file are interpreted as if you had typed them. The same can be done with the command ":source! {scriptin}". If the end of the file is reached before the editor exits, further characters are read from the keyboard.
-T {terminal}
Tells Vim the name of the terminal you are using. Only required when the automatic way doesn't work. Should be a terminal known to Vim (builtin) or defined in the termcap or terminfo file.
-u {vimrc}
Use the commands in the file {vimrc} for initializations. All the other initializations are skipped. Use this to edit a special kind of files. It can also be used to skip all initializations by giving the name "NONE". See ":help initialization" within vim for more details.
-U {gvimrc}
Use the commands in the file {gvimrc} for GUI initializations. All the other GUI initializations are skipped. It can also be used to skip all GUI initializations by giving the name "NONE". See ":help gui-init" within vim for more details.
-V[N]
Verbose. Give messages about which files are sourced and for reading and writing a viminfo file. The optional number N is the value for 'verbose'. Default is 10.
-v
Start Vim in Vi mode, just like the executable was called "vi". This only has effect when the executable is called "ex".
-w {scriptout}
All the characters that you type are recorded in the file {scriptout}, until you exit Vim. This is useful if you want to create a script file to be used with "vim -s" or ":source!". If the {scriptout} file exists, characters are appended.
-W {scriptout}
Like -w, but an existing file is overwritten.
-x
Use encryption when writing files. Will prompt for a crypt key.
-X
Don't connect to the X server. Shortens startup time in a terminal, but the window title and clipboard will not be used.
-y
Start Vim in easy mode, just like the executable was called "evim" or "eview". Makes Vim behave like a click-and-type editor.
-Z
Restricted mode. Works like the executable starts with "r".
--
Denotes the end of the options. Arguments after this will be handled as a file name. This can be used to edit a filename that starts with a '-'.
--echo-wid
GTK GUI only: Echo the Window ID on stdout
--help
Give a help message and exit, just like "-h".
--literal
Take file name arguments literally, do not expand wildcards. Not needed on Unix, the shell expand wildcards.
--noplugin
Skip loading plugins. Implied by -u NONE.
--remote
Connect to a Vim server and make it edit the files given in the rest of the arguments. If no server is found a warning is given and the files are edited in the current Vim.
--remote-expr {expr}
Connect to a Vim server, evaluate {expr} in it and print the result on stdout.
--remote-send {keys}
Connect to a Vim server and send {keys} to it.
--remote-silent
As --remote, but without the warning when no server is found.
--remote-wait
As --remote, but Vim does not exit until the files have been edited.
--remote-wait-silent
As --remote-wait, but without the warning when no server is found.
--serverlist
List the names of all Vim servers that can be found.
--servername {name}
Use {name} as the server name. Used for the current Vim, unless used with a --remote argument, then it's the name of the server to connect to.
--socketid {id}
GTK GUI only: Use the GtkPlug mechanism to run gvim in another window.
--version
Print version information and exit.

ON-LINE HELP

Type ":help" in Vim to get started. Type ":help subject" to get help on a specific subject. For example: ":help ZZ" to get help for the "ZZ" command. Use <Tab> and CTRL-D to complete subjects (":help cmdline-completion"). Tags are present to jump from one place to another (sort of hypertext links, see ":help"). All documentation files can be viewed in this way, for example ":help syntax.txt".

FILES

/usr/share/vim/vim63/doc/*.txt
The Vim documentation files. Use ":help doc-file-list" to get the complete list.
/usr/share/vim/vim63/doc/tags
The tags file used for finding information in the documentation files.
/usr/share/vim/vim63/syntax/syntax.vim
System wide syntax initializations.
/usr/share/vim/vim63/syntax/*.vim
Syntax files for various languages.
/usr/share/vim/vimrc
System wide Vim initializations.
/usr/share/vim/gvimrc
System wide gvim initializations.
/usr/share/vim/vim63/optwin.vim
Script used for the ":options" command, a nice way to view and set options.
/usr/share/vim/vim63/menu.vim
System wide menu initializations for gvim.
/usr/share/vim/vim63/bugreport.vim
Script to generate a bug report. See ":help bugs".
/usr/share/vim/vim63/filetype.vim
Script to detect the type of a file by its name. See ":help 'filetype'".
/usr/share/vim/vim63/scripts.vim
Script to detect the type of a file by its contents. See ":help 'filetype'".
/usr/share/vim/vim63/*.ps
Files used for PostScript printing.

For recent info read the VIM home page:
<URL:http://www.vim.org/>

SEE ALSO

vimtutor(1)

責(zé)任編輯:韓亞珊 來源: CMPP.net
相關(guān)推薦

2011-08-15 16:06:08

vim中文man

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-15 15:02:31

usleep中文man

2011-09-23 13:59:40

find中文man

2011-08-12 09:17:57

deallocvt中文man

2011-08-25 17:24:54

puts中文man

2011-07-15 16:58:36

ac中文man

2011-08-11 18:32:21

cp中文man

2011-08-23 11:34:26

ipcs中文man

2011-08-25 10:16:02

lmhosts中文man

2011-08-24 15:29:06

grant中文man

2011-08-25 17:32:40

setbuffer中文man

2011-08-25 16:50:08

getc中文man

2011-08-25 16:52:54

getchar中文man

2011-08-25 17:03:51

pclose中文man

2011-08-25 16:22:29

fputc中文man

2011-08-25 16:28:50

fread中文man
點贊
收藏

51CTO技術(shù)棧公眾號