📄 intro.txt
字号:
the ideas from all these people: They keep Vim alive!In this documentation there are several references to other versions of Vi: *Vi*Vi "the original". Without further remarks this is the version of Vi that appeared in Sun OS 4.x. ":version" returns "Version 3.7, 6/7/85". Sometimes other versions are referred to. Only runs under Unix. Source code only available with a license. More information on Vi can be found through: http://www.vim.org *Posix*Posix From the IEEE standard 1003.2, Part 2: Shell and utilities. Generally known as "Posix". This is a textual description of how Vi is supposed to work. The version used is a draft from beginning 1996, so all remarks are "expected to comply to" this. Anything can change though... *Nvi*Nvi The "New" Vi. The version of Vi that comes with BSD 4.4 and many free Unix versions. The version used is 1.79. ":version" returns "Version 1.79 (10/23/96)". Source code is freely available. *Elvis*Elvis Another Vi clone, made by Steve Kirkendall. The version used is 2.1, the last official release. Source code is freely available.==============================================================================4. Notation *notation*When syntax highlighting is used to read this, text that is not typedliterally is often highlighted with the Special group. These are items in [],{} and <>, and CTRL-X.[] Characters in square brackets are optional. *count* *[count]*[count] An optional number that may precede the command to multiply or iterate the command. If no number is given, a count of one is used, unless otherwise noted. Note that in this manual the [count] is not mentioned in the description of the command, but only in the explanation. This was done to make the commands easier to look up. If the 'showcmd' option is on, the (partially) entered count is shown at the bottom of the window. You can use <Del> to erase the last digit (|N<Del>|). *[quotex]*["x] An optional register designation where text can be stored. See |registers|. The x is a single character between 'a' and 'z' or 'A' and 'Z' or '"', and in some cases (with the put command) between '0' and '9', '%', '#', ':' or '.'. The uppercase and lower case letter designate the same register, but the lower case letter is used to overwrite the previous register contents, while the uppercase letter is used to append to the previous register contents. Without the ""x" or with """" the stored text is put into the unnamed register. *{}*{} Curly braces denote parts of the command which must appear, but which can take a number of different values. The differences between Vim and Vi are also given in curly braces (this will be clear from the context). *{char1-char2}*{char1-char2} A single character from the range char1 to char2. For example: {a-z} is a lowercase letter. Multiple ranges may be concatenated. For example, {a-zA-Z0-9} is any alphanumeric character. *{motion}*{motion} A command that moves the cursor. These are explained in |motion.txt|. Examples: w to start of next word 4j four lines down /The<CR> to next occurrence of "The" This is used after an |operator| command to move over the text that is to be operated upon. If the motion includes a count and the operator also had a count, the two counts are multiplied. For example: "2d3w" deletes six words. The motion can also be a mouse click. The mouse is currently only supported for MS-DOS, Win32, Linux console with GPM and xterm under Unix. The ":omap" command can be used to map characters while an operator is pending. *{Visual}*{Visual} A selected text area. It is started with the "v", "V", or CTRL-V command, then any cursor movement command can be used to change the end of the selected text. This is used before an |operator| command to highlight the text that is to be operated upon. See |Visual-mode|. *<character>*<character> A special character from the table below, optionally with modifiers, or a single ASCII character with modifiers. *'character'*'c' A single ASCII character. *CTRL-{char}*CTRL-{char} {char} typed as a control character; that is, typing {char} while holding the CTRL key down. The case of {char} does not matter; thus CTRL-A and CTRL-a are equivalent. But on some terminals, using the SHIFT key will produce another code, don't use it then. *'option'*'option' An option, or parameter, that can be set to a value, is enclosed in single quotes. See |options|. *quotecommandquote*"command" A reference to a command that you can type is enclosed in double quotes. *key-notation* *key-codes* *keycodes*These names for keys are used in the documentation. They can also be usedwith the ":map" command.notation meaning equivalent decimal value(s) ~-----------------------------------------------------------------------<Nul> zero CTRL-@ 0 (stored as 10) *<Nul>*<BS> backspace CTRL-H 8 *backspace*<Tab> tab CTRL-I 9 *tab* *Tab* *linefeed*<NL> linefeed CTRL-J 10 (used for <Nul>)<FF> formfeed CTRL-L 12 *formfeed*<CR> carriage return CTRL-M 13 *carriage-return*<Enter> same as <CR> *<Enter>*<Esc> escape CTRL-[ 27 *escape* *<Esc>*<Space> space 32 *space*<lt> less-then < 60 *<lt>*<Bslash> backslash \ 92 *backslash* *<Bslash>*<Bar> vertical bar | 124 *<Bar>*<Del> delete 127<CSI> command sequence intro ALT-Esc 155 *<CSI>*<xCSI> CSI when typed in the GUI *<xCSI>*<EOL> end-of-line (can be <CR>, <LF> or <CR><LF>, depends on system and 'fileformat') *<EOL>*<Up> cursor-up *cursor-up* *cursor_up*<Down> cursor-down *cursor-down* *cursor_down*<Left> cursor-left *cursor-left* *cursor_left*<Right> cursor-right *cursor-right* *cursor_right*<S-Up> shift-cursor-up<S-Down> shift-cursor-down<S-Left> shift-cursor-left<S-Right> shift-cursor-right<C-Left> control-cursor-left<C-Right> control-cursor-right<F1> - <F12> function keys 1 to 12 *function_key* *function-key*<S-F1> - <S-F12> shift-function keys 1 to 12 *<S-F1>*<Help> help key<Undo> undo key<Insert> insert key<Home> home *home*<End> end *end*<PageUp> page-up *page_up* *page-up*<PageDown> page-down *page_down* *page-down*<kHome> keypad home (upper left) *keypad-home*<kEnd> keypad end (lower left) *keypad-end*<kPageUp> keypad page-up (upper right) *keypad-page-up*<kPageDown> keypad page-down (lower right) *keypad-page-down*<kPlus> keypad + *keypad-plus*<kMinus> keypad - *keypad-minus*<kMultiply> keypad * *keypad-multiply*<kDivide> keypad / *keypad-divide*<kEnter> keypad Enter *keypad-enter*<S-...> shift-key *shift*<C-...> control-key *control* *ctrl*<M-...> alt-key or meta-key *meta* *alt*<t_xx> key with "xx" entry in termcap-----------------------------------------------------------------------Note: The shifted cursor keys, the help key, and the undo key are onlyavailable on a few terminals. On the Amiga, shifted function key 10 producesa code (CSI) that is also used by key sequences. It will be recognized onlyafter typing another key.Note: There are two codes for the delete key. 127 is the decimal ASCII valuefor the delete key, which is always recognized. Some delete keys send anothervalue, in which case this value is obtained from the termcap entry "kD". Bothvalues have the same effect. Also see |:fixdel|.Note: The keypad keys are used in the same way as the corresponding "normal"keys. For example, <kHome> has the same effect as <Home>. If a keypad keysends the same raw key code as it non-keypad equivalent, it will be recognizedas the non-keypad code. For example, when <kHome> sends the same code as<Home>, when pressing <kHome> Vim will think <Home> was pressed. Mapping<kHome> will not work then. *<>*Examples are often given in the <> notation. Sometimes this is just to makeclear what you need to type, but often it can be typed literally, e.g., withthe ":map" command. The rules are: 1. Any printable characters are typed directly, except backslash and '<' 2. A backslash is represented with "\\", double backslash, or "<Bslash>". 3. A real '<' is represented with "\<" or "<lt>". When there is no confusion possible, a '<' can be used directly. 4. "<key>" means the special key typed. This is the notation explained in the table above. A few examples: <Esc> Escape key <C-G> CTRL-G <Up> cursor up key <C-LeftMouse> Control- left mouse click <S-F11> Shifted function key 11 <M-a> Meta- a ('a' with bit 8 set) <M-A> Meta- A ('A' with bit 8 set) <t_kd> "kd" termcap entry (cursor down key)If you want to use the full <> notation in Vim, you have to make sure the '<'flag is excluded from 'cpoptions' (when 'compatible' is not set, it already isby default).> :set cpo-=<The <> notation uses <lt> to escape the special meaning of key names. Using abackslash also work, but only when 'cpoptions' does not include the 'B' flag.Examples for using a literal "<Home>" in a mapping:> :imap <C-H> \<Home>> :imap <C-H> <lt>Home>The first one only works when the 'B' flag is not in 'cpoptions'. The secondone always works.To get a literal "<lt>" in a mapping:> :map <C-L> <lt>lt>For mapping, abbreviation and menu commands you can then copy-paste theexamples and use them directly. Or type them literally, including the '<' and'>' characters. This does NOT work for other commands, like ":set" and":autocmd"!==============================================================================5. Modes, introduction *vim-modes-intro* *vim-modes*Vim has six BASIC modes: *Normal* *Normal-mode* *command-mode*Normal mode In Normal mode you can enter all the normal editor commands. If you start the editor you are in this mode (unless you have set the 'insertmode' option, see below). This is also known as command mode.Visual mode This is like Normal mode, but the movement commands extend a highlighted area. When a non-movement command is used, it is executed for the highlighted area. See |Visual-mode|. If the 'showmode' option is on "-- VISUAL --" is shown at the bottom of the window.Select mode This looks most like the MS-Windows selection mode. Typing a printable character deletes the selection and starts Insert mode. See |Select-mode|.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -