diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2025-02-05 23:09:29 +0000 |
| commit | d5f194ce780c95821a855aca3c19426576d28ae0 (patch) | |
| tree | d45f461b19f9118ad2bb1f440a7a08973ad18832 /runtime/doc/intro.txt | |
| parent | c5d770d311841ea5230426cc4c868e8db27300a8 (diff) | |
| parent | 44740e561fc93afe3ebecfd3618bda2d2abeafb0 (diff) | |
| download | rneovim-rahm.tar.gz rneovim-rahm.tar.bz2 rneovim-rahm.zip | |
Diffstat (limited to 'runtime/doc/intro.txt')
| -rw-r--r-- | runtime/doc/intro.txt | 971 |
1 files changed, 445 insertions, 526 deletions
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index d099c29bdb..0c654b8b30 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -1,15 +1,15 @@ *intro.txt* Nvim - NVIM REFERENCE MANUAL + NVIM REFERENCE MANUAL -Nvim *ref* *reference* +Nvim *ref* *reference* Type |gO| to see the table of contents. ============================================================================== -Introduction *intro* +Introduction *intro* Vim is a text editor which includes most commands from the Unix program "Vi" and many new ones. @@ -21,52 +21,75 @@ It can be accessed from within Vim with the <Help> or <F1> key and with the is not located in the default place. You can jump to subjects like with tags: Use CTRL-] to jump to a subject under the cursor, use CTRL-T to jump back. - *pronounce* + *pronounce* Vim is pronounced as one word, like Jim. So Nvim is "En-Vim", two syllables. This manual is a reference for all Nvim editor and API features. It is not an -introduction; instead for beginners, there is a hands-on |tutor| and a user -manual |usr_toc.txt|. - - *book* -There are many books on Vi and Vim. We recommend: - - "Practical Vim" by Drew Neil - "Modern Vim" by Drew Neil - https://vimcasts.org/publications/ - -"Practical Vim" is acclaimed for its focus on quickly learning common editing -tasks with Vim. "Modern Vim" explores new features in Nvim and Vim 8. - - "Vim - Vi Improved" by Steve Oualline - -This was the first book dedicated to Vim. Parts of it were included in the -user manual. |frombook| ISBN: 0735710015 -For more information try one of these: - https://iccf-holland.org/click5.html - https://www.vim.org/iccf/click5.html - -============================================================================== -Nvim on the interwebs *internet* - - *www* *distribution* *download* - - Nvim home page: https://neovim.io/ - Downloads: https://github.com/neovim/neovim/releases - Vim FAQ: https://vimhelp.org/vim_faq.txt.html - - - *bugs* *bug-report* -Report bugs and request features here: -https://github.com/neovim/neovim/issues - +introduction; instead for beginners, there is a hands-on |tutor|, |lua-guide|, +and |user-manual|. + +------------------------------------------------------------------------------ +Resources *resources* + + *internet* *www* *distribution* +Nvim home page: + + https://neovim.io/ + + *book* +There are many resources to learn Vi, Vim, and Nvim. We recommend: + +- "Practical Vim" by Drew Neil. Acclaimed for its focus on quickly learning + common editing tasks with Vim. +- "Modern Vim" by Drew Neil. Explores new features in Nvim and Vim 8. +- https://vimcasts.org/publications/ +- "Vim - Vi Improved" by Steve Oualline. This was the first book dedicated to + Vim. Parts of it were included in the Vim user manual. |frombook| ISBN: + 0735710015 +- For more information try one of these: + - https://iccf-holland.org/click5.html + - https://www.vim.org/iccf/click5.html +- Vim FAQ: https://vimhelp.org/vim_faq.txt.html + + *bugs* *bug-report* *feature-request* +Report bugs and request features here: https://github.com/neovim/neovim/issues Be brief, yet complete. Always give a reproducible example and try to find -out which settings or other things trigger the bug. +out which settings or other things trigger the bug. If Nvim crashed, try to +get a backtrace (see |dev-tools-backtrace|). -If Nvim crashes, try to get a backtrace. See |debug.txt|. +============================================================================== +Installing Nvim *install* + + *download* *upgrade* *ubuntu* +To install or upgrade Nvim, you can... +- Download a pre-built archive: + https://github.com/neovim/neovim/releases +- Use your system package manager: + https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package +- Build from source: + https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-source + +------------------------------------------------------------------------------ +Un-installing Nvim *uninstall* + +To uninstall Nvim: +- If you downloaded a pre-built archive or built Nvim from source (e.g. + `make install`), just delete its files, typically located in: > + /usr/local/bin/nvim + /usr/local/share/nvim +< + - To find where Nvim is installed, run these commands: > + :echo v:progpath + :echo $VIMRUNTIME +< +- If you installed via package manager, read your package manager's + documentation. Common examples: + - APT (Debian, Ubuntu, …): `apt-get remove neovim` + - Homebrew (macOS): `brew uninstall neovim` + - Scoop (Windows): `scoop uninstall neovim` ============================================================================== -Sponsor Vim/Nvim development *sponsor* *register* +Sponsor Vim/Nvim development *sponsor* *register* Fixing bugs and adding new features takes a lot of time and effort. To show your appreciation for the work and motivate developers to continue working on @@ -78,121 +101,15 @@ motivation to keep working on Vim! For the most recent information about sponsoring look on the Vim web site: - https://www.vim.org/sponsor/ + https://www.vim.org/sponsor/ Nvim development is funded separately from Vim: - https://neovim.io/#sponsor - -============================================================================== -Credits *credits* - -Most of Vim was written by Bram Moolenaar <Bram@vim.org> |Bram-Moolenaar|. - -Parts of the documentation come from several Vi manuals, written by: - W.N. Joy - Alan P.W. Hewett - Mark Horton - -The Vim editor is based on Stevie and includes (ideas from) other software, -worked on by the people mentioned here. Other people helped by sending me -patches, suggestions and giving feedback about what is good and bad in Vim. - -Vim would never have become what it is now, without the help of these people! - - Ron Aaron Win32 GUI changes - Mohsin Ahmed encryption - Zoltan Arpadffy work on VMS port - Tony Andrews Stevie - Gert van Antwerpen changes for DJGPP on MS-DOS - Berkeley DB(3) ideas for swap file implementation - Keith Bostic Nvi - Walter Briscoe Makefile updates, various patches - Ralf Brown SPAWNO library for MS-DOS - Robert Colon many useful remarks - Marcin Dalecki GTK+ GUI port, toolbar icons, gettext() - Kayhan Demirel sent me news in Uganda - Chris & John Downey xvi (ideas for multi-windows version) - Henk Elbers first VMS port - Daniel Elstner GTK+ 2 port - Eric Fischer Mac port, 'cindent', and other improvements - Benji Fisher Answering lots of user questions - Bill Foster Athena GUI port (later removed) - Google Let Bram work on Vim one day a week - Loic Grenie xvim (ideas for multi windows version) - Sven Guckes Vim promoter and previous WWW page maintainer - Darren Hiebert Exuberant ctags - Jason Hildebrand GTK+ 2 port - Bruce Hunsaker improvements for VMS port - Andy Kahn Cscope support, GTK+ GUI port - Oezguer Kesim Maintainer of Vim Mailing Lists - Axel Kielhorn work on the Macintosh port - Steve Kirkendall Elvis - Roger Knobbe original port to Windows NT - Sergey Laskavy Vim's help from Moscow - Felix von Leitner Previous maintainer of Vim Mailing Lists - David Leonard Port of Python extensions to Unix - Avner Lottem Edit in right-to-left windows - Flemming Madsen X11 client-server, various features and patches - Tony Mechelynck answers many user questions - Paul Moore Python interface extensions, many patches - Katsuhito Nagano Work on multibyte versions - Sung-Hyun Nam Work on multibyte versions - Vince Negri Win32 GUI and generic console enhancements - Steve Oualline Author of the first Vim book |frombook| - Dominique Pelle Valgrind reports and many fixes - A.Politz Many bug reports and some fixes - George V. Reilly Win32 port, Win32 GUI start-off - Stephen Riehm bug collector - Stefan Roemer various patches and help to users - Ralf Schandl IBM OS/390 port - Olaf Seibert DICE and BeBox version, regexp improvements - Mortaza Shiran Farsi patches - Peter da Silva termlib - Paul Slootman OS/2 port - Henry Spencer regular expressions - Dany St-Amant Macintosh port - Tim Thompson Stevie - G. R. (Fred) Walter Stevie - Sven Verdoolaege Perl interface - Robert Webb Command-line completion, GUI versions, and - lots of patches - Ingo Wilken Tcl interface - Mike Williams PostScript printing - Juergen Weigert Lattice version, AUX improvements, Unix and - MS-DOS ports, autoconf - Stefan 'Sec' Zehl Maintainer of vim.org - Yasuhiro Matsumoto many MS-Windows improvements - Ken Takata fixes and features - Kazunobu Kuriyama GTK 3 - Christian Brabandt many fixes, features, user support, etc. - Yegappan Lakshmanan many quickfix features - -I wish to thank all the people that sent me bug reports and suggestions. The -list is too long to mention them all here. Vim would not be the same without -the ideas from all these people: They keep Vim alive! -*love* *peace* *friendship* *gross-national-happiness* - - -Documentation may refer to other versions of Vi: - *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". Source code only available with a license. - *Nvi* -Nvi The "New" Vi. The version of Vi that comes with BSD 4.4 and FreeBSD. - Very good compatibility with the original Vi, with a few extensions. - 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. Very compact but isn't - as flexible as Vim. Source code is freely available. - -Vim Nvim is based on Vim. https://www.vim.org/ + https://neovim.io/#sponsor ============================================================================== -Bram Moolenaar *Bram* *Moolenaar* *Bram-Moolenaar* *brammool* +Bram Moolenaar *Bram* *Moolenaar* *Bram-Moolenaar* *brammool* Nvim is a fork of the Vim ("Vi IMproved") text editor, which was originally developed by Bram Moolenaar. Searching his name within the source code of @@ -201,11 +118,11 @@ On August 3, 2023, he passed away at the age of 62. If Vim or Nvim have been of use to you in your life, please read |Uganda| and consider honoring his memory however you may see fit. -Obituary Articles: https://github.com/vim/vim/discussions/12742 -Say Farewell: https://github.com/vim/vim/discussions/12737 +- Obituary Articles: https://github.com/vim/vim/discussions/12742 +- Say Farewell: https://github.com/vim/vim/discussions/12737 ============================================================================== -Notation *notation* +Notation *notation* When syntax highlighting is used to read this, text that is not typed literally is often highlighted with the Special group. These are items in [], @@ -215,177 +132,177 @@ Note that Vim uses all possible characters in commands. Sometimes the [], {} and <> are part of what you type, the context should make this clear. -[] 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 others. The - uppercase and lowercase letter designate the same register, - but the lowercase 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}* *movement* -{motion} A command that moves the cursor. These are explained in - |motion.txt|. Examples: - w to start of next word - b to begin of current 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 has a - count, the two counts are multiplied. For example: "2d3w" - deletes six words. - - The motion can be backwards, e.g. "db" to delete to the - start of the word. - - The motion can also be a mouse click. The mouse is not - supported in every terminal though. - - The ":omap" command can be used to map characters while an - operator is pending. - - Ex commands can be used to move the cursor. This can be - used to call a function that does some complicated motion. - The motion is always charwise exclusive, no matter - what ":" command is used. This means it's impossible to - include the last character of a line without the line break - (unless 'virtualedit' is set). - If the Ex command changes the text before where the operator - starts or jumps to another buffer the result is - unpredictable. It is possible to change the text further - down. Jumping to another buffer is possible if the current - buffer is not unloaded. - - *{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} is - ignored; thus CTRL-A and CTRL-a are equivalent. But in - some terminals and environments, using the SHIFT key will - produce a distinct code (e.g. CTRL-SHIFT-a); in these - environments using the SHIFT key will not trigger commands - such as CTRL-A. - - *'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. -`command` New style command, this distinguishes it from other quoted - text and strings. - - *key-notation* *key-codes* *keycodes* +- [] 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 others. The + uppercase and lowercase letter designate the same register, + but the lowercase 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}* *movement* +- {motion} A command that moves the cursor. These are explained in + |motion.txt|. + - Examples: + - `w` to start of next word + - `b` to begin of current 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 has + a count, the two counts are multiplied. For example: + "2d3w" deletes six words. + - The motion can be backwards, e.g. "db" to delete to the + start of the word. + - The motion can also be a mouse click. The mouse is not + supported in every terminal though. + - The ":omap" command can be used to map characters while an + operator is pending. + - Ex commands can be used to move the cursor. This can be + used to call a function that does some complicated motion. + The motion is always charwise exclusive, no matter what + ":" command is used. This means it's impossible to + include the last character of a line without the line + break (unless 'virtualedit' is set). If the Ex command + changes the text before where the operator starts or jumps + to another buffer the result is unpredictable. It is + possible to change the text further down. Jumping to + another buffer is possible if the current buffer is not + unloaded. + + *{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} is + ignored; thus CTRL-A and CTRL-a are equivalent. But in + some terminals and environments, using the SHIFT key will + produce a distinct code (e.g. CTRL-SHIFT-a); in these + environments using the SHIFT key will not trigger commands + such as CTRL-A. + + *'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. +- `command` New style command, this distinguishes it from other quoted + text and strings. + + *key-notation* *key-codes* *keycodes* These names for keys are used in the documentation. They can also be used with 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>) -<CR> carriage return CTRL-M 13 *carriage-return* -<Return> same as <CR> *<Return>* -<Enter> same as <CR> *<Enter>* -<Esc> escape CTRL-[ 27 *escape* *<Esc>* -<Space> space 32 *space* -<lt> less-than < 60 *<lt>* -<Bslash> backslash \ 92 *backslash* *<Bslash>* -<Bar> vertical bar | 124 *<Bar>* -<Del> delete 127 -<CSI> command sequence intro ALT-Esc 155 *<CSI>* - -<EOL> end-of-line (can be <CR>, <NL> or <CR><NL>, - depends on system and 'fileformat') *<EOL>* -<Ignore> cancel wait-for-character *<Ignore>* -<NOP> no-op: do nothing (useful in mappings) *<Nop>* - -<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* -<kUp> keypad cursor-up *keypad-cursor-up* -<kDown> keypad cursor-down *keypad-cursor-down* -<kLeft> keypad cursor-left *keypad-cursor-left* -<kRight> keypad cursor-right *keypad-cursor-right* -<kHome> keypad home (upper left) *keypad-home* -<kEnd> keypad end (lower left) *keypad-end* -<kOrigin> keypad origin (middle) *keypad-origin* -<kPageUp> keypad page-up (upper right) *keypad-page-up* -<kPageDown> keypad page-down (lower right) *keypad-page-down* -<kDel> keypad delete *keypad-delete* -<kPlus> keypad + *keypad-plus* -<kMinus> keypad - *keypad-minus* -<kMultiply> keypad * *keypad-multiply* -<kDivide> keypad / *keypad-divide* -<kPoint> keypad . *keypad-point* -<kComma> keypad , *keypad-comma* -<kEqual> keypad = *keypad-equal* -<kEnter> keypad Enter *keypad-enter* -<k0> - <k9> keypad 0 to 9 *keypad-0* *keypad-9* -<S-…> shift-key *shift* *<S-* -<C-…> control-key *control* *ctrl* *<C-* -<M-…> alt-key or meta-key *META* *ALT* *<M-* -<A-…> same as <M-…> *<A-* -<T-…> meta-key when it's not alt *<T-* -<D-…> command-key or "super" key *<D-* ------------------------------------------------------------------------ ~ +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>) +<CR> carriage return CTRL-M 13 *carriage-return* +<Return> same as <CR> *<Return>* +<Enter> same as <CR> *<Enter>* +<Esc> escape CTRL-[ 27 *escape* *<Esc>* +<Space> space 32 *space* +<lt> less-than < 60 *<lt>* +<Bslash> backslash \ 92 *backslash* *<Bslash>* +<Bar> vertical bar | 124 *<Bar>* +<Del> delete 127 +<CSI> command sequence intro ALT-Esc 155 *<CSI>* + +<EOL> end-of-line (can be <CR>, <NL> or <CR><NL>, + depends on system and 'fileformat') *<EOL>* +<Ignore> cancel wait-for-character *<Ignore>* +<NOP> no-op: do nothing (useful in mappings) *<Nop>* + +<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* +<kUp> keypad cursor-up *keypad-cursor-up* +<kDown> keypad cursor-down *keypad-cursor-down* +<kLeft> keypad cursor-left *keypad-cursor-left* +<kRight> keypad cursor-right *keypad-cursor-right* +<kHome> keypad home (upper left) *keypad-home* +<kEnd> keypad end (lower left) *keypad-end* +<kOrigin> keypad origin (middle) *keypad-origin* +<kPageUp> keypad page-up (upper right) *keypad-page-up* +<kPageDown> keypad page-down (lower right) *keypad-page-down* +<kDel> keypad delete *keypad-delete* +<kPlus> keypad + *keypad-plus* +<kMinus> keypad - *keypad-minus* +<kMultiply> keypad * *keypad-multiply* +<kDivide> keypad / *keypad-divide* +<kPoint> keypad . *keypad-point* +<kComma> keypad , *keypad-comma* +<kEqual> keypad = *keypad-equal* +<kEnter> keypad Enter *keypad-enter* +<k0> - <k9> keypad 0 to 9 *keypad-0* *keypad-9* +<S-…> shift-key *shift* *<S-* +<C-…> control-key *control* *ctrl* *<C-* +<M-…> alt-key or meta-key *META* *ALT* *<M-* +<A-…> same as <M-…> *<A-* +<T-…> meta-key when it's not alt *<T-* +<D-…> command-key or "super" key *<D-* + Note: @@ -400,125 +317,125 @@ Note: - It is possible to notate combined modifiers (e.g. <M-C-T> for CTRL-ALT-T), but your terminal must encode the input for that to work. |tui-input| - *<>* + *<>* Examples are often given in the <> notation. Sometimes this is just to make clear what you need to type, but often it can be typed literally, e.g., with the ":map" command. The rules are: - 1. Printable characters are typed directly, except backslash and "<" - 2. Backslash is represented with "\\", double backslash, or "<Bslash>". - 3. Literal "<" is represented with "\<" or "<lt>". When there is no - confusion possible, "<" can be used directly. - 4. "<key>" means the special key typed (see the table above). 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) +1. Printable characters are typed directly, except backslash and "<" +2. Backslash is represented with "\\", double backslash, or "<Bslash>". +3. Literal "<" is represented with "\<" or "<lt>". When there is no + confusion possible, "<" can be used directly. +4. "<key>" means the special key typed (see the table above). 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) The <> notation uses <lt> to escape the special meaning of key names. Using a backslash also works, but only when 'cpoptions' does not include the 'B' flag. Examples for mapping CTRL-H to the six characters "<Home>": >vim - :imap <C-H> \<Home> - :imap <C-H> <lt>Home> + :imap <C-H> \<Home> + :imap <C-H> <lt>Home> The first one only works when the 'B' flag is not in 'cpoptions'. The second one always works. To get a literal "<lt>" in a mapping: >vim - :map <C-L> <lt>lt> + :map <C-L> <lt>lt> The notation can be used in a double quoted strings, using "\<" at the start, e.g. "\<C-Space>". This results in a special key code. To convert this back to readable text use `keytrans()`. ============================================================================== -Modes, introduction *vim-modes-intro* *vim-modes* +Modes, introduction *vim-modes-intro* *vim-modes* Vim has seven 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. 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|. - If the 'showmode' option is on "-- SELECT --" is shown - at the bottom of the window. - -Insert mode In Insert mode the text you type is inserted into the - buffer. See |Insert-mode|. - If the 'showmode' option is on "-- INSERT --" is shown - at the bottom of the window. - -Command-line mode In Command-line mode (also called Cmdline mode) you -Cmdline mode can enter one line of text at the bottom of the - window. This is for the Ex commands, ":", the pattern - search commands, "?" and "/", and the filter command, - "!". |Cmdline-mode| - -Ex mode Like Command-line mode, but after entering a command - you remain in Ex mode. Very limited editing of the - command line. |Ex-mode| - - *Terminal-mode* -Terminal mode In Terminal mode all input (except CTRL-\) is sent to - the process running in the current |terminal| buffer. - If CTRL-\ is pressed, the next key is sent unless it - is CTRL-N (|CTRL-\_CTRL-N|) or CTRL-O (|t_CTRL-\_CTRL-O|). - If the 'showmode' option is on "-- TERMINAL --" is shown - at the bottom of the window. + *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. 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|. + If the 'showmode' option is on "-- SELECT --" is shown + at the bottom of the window. + +- Insert mode: In Insert mode the text you type is inserted into the + buffer. See |Insert-mode|. + If the 'showmode' option is on "-- INSERT --" is shown + at the bottom of the window. + +- Cmdline mode: In Command-line mode (also called Cmdline mode) you + can enter one line of text at the bottom of the + window. This is for the Ex commands, ":", the pattern + search commands, "?" and "/", and the filter command, + "!". |Cmdline-mode| + +- Ex mode: Like Command-line mode, but after entering a command + you remain in Ex mode. Very limited editing of the + command line. |Ex-mode| + + *Terminal-mode* +- Terminal mode: In Terminal mode all input (except CTRL-\) is sent to + the process running in the current |terminal| buffer. + If CTRL-\ is pressed, the next key is sent unless it + is CTRL-N (|CTRL-\_CTRL-N|) or CTRL-O (|t_CTRL-\_CTRL-O|). + If the 'showmode' option is on "-- TERMINAL --" is shown + at the bottom of the window. There are six ADDITIONAL modes. These are variants of the BASIC modes: - *Operator-pending* *Operator-pending-mode* -Operator-pending mode This is like Normal mode, but after an operator - command has started, and Vim is waiting for a {motion} - to specify the text that the operator will work on. - -Replace mode Replace mode is a special case of Insert mode. You - can do the same things as in Insert mode, but for - each character you enter, one character of the existing - text is deleted. See |Replace-mode|. - If the 'showmode' option is on "-- REPLACE --" is - shown at the bottom of the window. - -Virtual Replace mode Virtual Replace mode is similar to Replace mode, but - instead of file characters you are replacing screen - real estate. See |Virtual-Replace-mode|. - If the 'showmode' option is on "-- VREPLACE --" is - shown at the bottom of the window. - -Insert Normal mode Entered when CTRL-O is typed in Insert mode (see - |i_CTRL-O|). This is like Normal mode, but after - executing one command Vim returns to Insert mode. - If the 'showmode' option is on "-- (insert) --" is - shown at the bottom of the window. - -Insert Visual mode Entered when starting a Visual selection from Insert - mode, e.g., by using CTRL-O and then "v", "V" or - CTRL-V. When the Visual selection ends, Vim returns - to Insert mode. - If the 'showmode' option is on "-- (insert) VISUAL --" - is shown at the bottom of the window. - -Insert Select mode Entered when starting Select mode from Insert mode. - E.g., by dragging the mouse or <S-Right>. - When the Select mode ends, Vim returns to Insert mode. - If the 'showmode' option is on "-- (insert) SELECT --" - is shown at the bottom of the window. + *Operator-pending* *Operator-pending-mode* +- Operator-pending mode: This is like Normal mode, but after an operator + command has started, and Vim is waiting for a {motion} + to specify the text that the operator will work on. + +- Replace mode: Replace mode is a special case of Insert mode. You + can do the same things as in Insert mode, but for + each character you enter, one character of the existing + text is deleted. See |Replace-mode|. + If the 'showmode' option is on "-- REPLACE --" is + shown at the bottom of the window. + +- Virtual Replace mode: Virtual Replace mode is similar to Replace mode, but + instead of file characters you are replacing screen + |