man信息:英文程序员
[root@hostname ~]# man vim
VIM(1) General Commands Manual VIM(1)shell
NAME
vim - Vi IMproved, a programmers text editorvim
SYNOPSIS
vim [options] [file ..]
vim [options] -
vim [options] -t tag
vim [options] -q [errorfile]windows
ex gex
view
gvim gview vimx evim eview
rvim rview rgvim rgviewsession
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.ui
Most often Vim is started to edit a single file with the commandthis
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 cur‐
rent 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.
gex Starts a new gvim window in Ex mode. Can also be done with the "-e" argument to gvim
vimx Starts gvim in "Vi" mode similar to "vim", but with additional features like xterm clipboard support
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 "Ses‐
sion.vim" is used (only works when -S is the last argument).
--c
man信息:谷歌翻译后
名称
vim - Vi IMproved,程序员文本编辑器
概要
vim [options] [file ..]
vim [选项] -
vim [options] -t标签
vim [options] -q [errorfile]
ex gex
视图
gvim gview vimx evim eview
rvim rview rgvim rgview
描述
Vim是一个向上兼容Vi的文本编辑器。它能够用来编辑各类纯文本。它对编辑程序特别有用。
Vi之上有不少加强功能:多级撤消,多窗口和缓冲区,语法高亮,命令行编辑,文件名完成,在线帮助,视觉
选择等。有关Vim和Vi之间差别的摘要,请参阅“:help vi_diff.txt”。
在运行Vim时,可使用“:help”命令从在线帮助系统得到不少帮助。请参阅下面的在线帮助部分。
大多数状况下,Vim开始使用该命令编辑单个文件
vim文件
更通常地说,Vim开始于:
vim [options] [filelist]
若是缺乏文件列表,编辑器将以空缓冲区开始。不然,可使用如下四个中的一个来选择一个或多个要编辑的文件。
file ..文件名列表。第一个将是当前文件并读入缓冲区。光标将位于缓冲区的第一行。你能够获得
使用“:next”命令到其余文件。要编辑以短划线开头的文件,请在文件列表前加上“ - ”。
- 从stdin读取要编辑的文件。命令是从stderr读取的,应该是一个TTY。
-t {tag}要编辑的文件和初始光标位置取决于“标签”,一种转到标签。在tag文件中查找{tag},相关文件变为cur-
租用文件和相关命令被执行。主要用于C程序,在这种状况下{tag}能够是函数名。效果是文件
包含该函数成为当前文件,光标位于函数的开头。请参阅“:help tag-commands”。
-q [errorfile]
从quickFix模式开始。读取文件[errorfile]并显示第一个错误。若是省略[errorfile],则从'errorfile'获取文件名
选项(默认为Amiga的“AztecC.Err”,其余系统的“errors.err”)。使用“:cn”命令能够跳转到更多错误。请参阅“:help quickfix”。
Vim的行为有所不一样,具体取决于命令的名称(可执行文件可能仍然是同一个文件)。
vim“正常”的方式,一切都是默认的。
ex在Ex模式下启动。使用“:vi”命令进入正常模式。也可使用“-e”参数完成。
view以只读模式启动。您将受到保护,不会编写文件。也可使用“-R”参数完成。
gvim gview
GUI版本。开始一个新窗口。
gex在Ex模式下启动新的gvim窗口。也可使用gvim的“-e”参数来完成
vimx以相似于“vim”的“Vi”模式启动gvim,但具备xterm剪贴板支持等附加功能
evim eview
简易模式下的GUI版本。开始一个新窗口。也可使用“-y”参数完成。
rvim rview rgvim rgview
像上面同样,但有限制。没法启动shell命令或暂停Vim。也可使用“-Z”参数完成。
OPTIONS
能够在文件名以前或以后以任何顺序给出选项。没有参数的选项能够在单个破折号后组合。
+ [num]对于第一个文件,光标将位于“num”行。若是缺乏“num”,则光标将位于最后一行。
+ / {pat}对于第一个文件,光标将定位在第一次出现的{pat}上。有关可用的搜索模式,请参阅“:help search-pattern”。
+ {命令}
-c {command}
读取第一个文件后将执行{command}。 {command}被解释为Ex命令。若是{command}包含空格,则必须将其括起来
双引号(这取决于使用的shell)。示例:Vim“+ set si”main.c
注意:您最多可使用10“+”或“-c”命令。
读取第一个文件后,将获取-S {file} {file}。这至关于-c“source {file}”。 {file}不能以' - '开头。若是省略{file}“Ses-
使用sion.vim(仅当-S是最后一个参数时才有效)。
参数信息概述:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 30 2018 19:56:57)
用法: vim [参数] [文件 ..] 编辑指定的文件
或: vim [参数] - 从标准输入(stdin)读取文本
或: vim [参数] -t tag 编辑 tag 定义处的文件
或: vim [参数] -q [errorfile] 编辑第一个出错处的文件
参数:
-- 在这之后只有文件名
-v Vi 模式 (同 "vi")
-e C Ex 模式 (同 "ex")
-E Improved Ex mode
-s 安静(批处理)模式 (只能与 "ex" 一块儿使用)
-d Diff 模式 (同 "vimdiff")
-y 容易模式 (同 "evim",无模式)
-R 只读模式 (同 "view")
-Z 限制模式 (同 "rvim")
-m 不可修改(写入文件)
-M 文本不可修改
-b 二进制模式
-l Lisp 模式
-C 兼容传统的 Vi: 'compatible'
-N 不彻底兼容传统的 Vi: 'nocompatible'
-V[N][fname] Be verbose [level N] [log messages to fname]
-D 调试模式
-n 不使用交换文件,只使用内存
-r 列出交换文件并退出
-r (跟文件名) 恢复崩溃的会话
-L 同 -r
-A 以 Arabic 模式启动
-H 以 Hebrew 模式启动
-F 以 Farsi 模式启动
-T <terminal> 设定终端类型为 <terminal>
-u <vimrc> 使用 <vimrc> 替代任何 .vimrc
--noplugin 不加载 plugin 脚本
-P[N] 打开 N 个标签页 (默认值: 每一个文件一个)
-o[N] 打开 N 个窗口 (默认值: 每一个文件一个)
-O[N] 同 -o 但垂直分割
+ 启动后跳到文件末尾
+<lnum> 启动后跳到第 <lnum> 行
--cmd <command> 加载任何 vimrc 文件前执行 <command>
-c <command> 加载第一个文件后执行 <command>
-S <session> 加载第一个文件后执行文件 <session>
-s <scriptin> 从文件 <scriptin> 读入正常模式的命令
-w <scriptout> 将全部输入的命令追加到文件 <scriptout>
-W <scriptout> 将全部输入的命令写入到文件 <scriptout>
-x 编辑加密的文件
--startuptime <file> Write startup timing messages to <file>
-i <viminfo> 使用 <viminfo> 取代 .viminfo
-h 或 --help 打印帮助(本信息)并退出
--version 打印版本信息并退出