*intro.txt* Nvim NVIM REFERENCE MANUAL Nvim *ref* *reference* Type |gO| to see the table of contents. ============================================================================== Introduction *intro* Vim is a text editor which includes most commands from the Unix program "Vi" and many new ones. An overview of this manual can be found in the file "help.txt", |help.txt|. It can be accessed from within Vim with the or key and with the |:help| command (just type ":help", without the bars or quotes). The 'helpfile' option can be set to the name of the help file, in case it 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* 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|, |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. If Nvim crashed, try to get a backtrace (see |dev-tools-backtrace|). ============================================================================== 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* 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 Vim please send a donation. The money you donated will be mainly used to help children in Uganda. See |uganda|. But at the same time donations increase the development team motivation to keep working on Vim! For the most recent information about sponsoring look on the Vim web site: https://www.vim.org/sponsor/ Nvim development is funded separately from Vim: https://neovim.io/#sponsor ============================================================================== 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 Nvim will reveal just how much of his work still remains in Nvim. 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 ============================================================================== 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 [], {} and <>, and CTRL-X. 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 to erase the last digit (|N|). *[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` 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|. ** - 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) ~ zero CTRL-@ 0 (stored as 10) ** backspace CTRL-H 8 *backspace* tab CTRL-I 9 *tab* *Tab* *linefeed* linefeed CTRL-J 10 (used for ) carriage return CTRL-M 13 *carriage-return* same as ** same as ** escape CTRL-[ 27 *escape* ** space 32 *space* less-than < 60 ** backslash \ 92 *backslash* ** vertical bar | 124 ** delete 127 command sequence intro ALT-Esc 155 ** end-of-line (can be , or , depends on system and 'fileformat') ** cancel wait-for-character ** no-op: do nothing (useful in mappings) ** cursor-up *cursor-up* *cursor_up* cursor-down *cursor-down* *cursor_down* cursor-left *cursor-left* *cursor_left* cursor-right *cursor-right* *cursor_right* shift-cursor-up shift-cursor-down shift-cursor-left shift-cursor-right control-cursor-left control-cursor-right - function keys 1 to 12 *function_key* *function-key* - shift-function keys 1 to 12 ** help key undo key find key