centos7,6最全的vim注釋


man信息:英文

[root@hostname ~]# man vim
VIM(1) General Commands Manual VIM(1)

NAME
vim - Vi IMproved, a programmers text editor

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

ex gex
view
gvim gview vimx 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 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 打印版本信息並退出


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM