Home Explore Blog CI



neovim

1st chunk of `runtime/doc/faq.txt`
fe595d32b1ed74474f8d6564dacfe9d64b44fc1fa93c20480000000100000fb1
*faq.txt*		 Nvim

                            NVIM REFERENCE MANUAL


Frequently asked Questions                                        *faq*

                                  Type |gO| to see the table of contents.

==============================================================================
General Questions                                                 *faq-general*


WHERE SHOULD I PUT MY CONFIG (VIMRC)? ~

See |config|; you can copy (or symlink) your existing vimrc. |nvim-from-vim|


HOW STABLE IS THE DEVELOPMENT (PRE-RELEASE) VERSION? ~

The unstable (pre-release)
https://github.com/neovim/neovim/releases/tag/nightly version of Nvim
("HEAD", i.e. the `master` branch) is used to aggressively stage new features
and changes. It's usually stable, but will occasionally break your workflow.
We depend on HEAD users to report "blind spots" that were not caught by
automated tests.

Use the stable (release) https://github.com/neovim/neovim/releases/latest
version for a more predictable experience.


CAN I USE LUA-BASED VIM PLUGINS (E.G. NEOCOMPLETE)? ~

No. Starting with Nvim 0.2 PR #4411
https://github.com/neovim/neovim/pull/4411 Lua is built-in, but the legacy
Vim `if_lua` interface is not supported.


HOW CAN I USE "TRUE COLOR" IN THE TERMINAL? ~

Truecolor (24bit colors) are enabled by default if a supporting terminal is
detected. If your terminal is not detected but you are sure it supports
truecolor, add this to your |init.vim|:
>vim
    set termguicolors
<

NVIM SHOWS WEIRD SYMBOLS (`�[2 q`) WHEN CHANGING MODES ~

This is a bug in your terminal emulator. It happens because Nvim sends
cursor-shape termcodes by default, if the terminal appears to be
xterm-compatible (`TERM=xterm-256color`).

To workaround the issue, you can:

- Use a different terminal emulator
- Disable 'guicursor' in your Nvim config: >vim

    :set guicursor=
    " Workaround some broken plugins which set guicursor indiscriminately.
    :autocmd OptionSet guicursor noautocmd set guicursor=
<
See also |$TERM| for recommended values of `$TERM`.


HOW TO CHANGE CURSOR SHAPE IN THE TERMINAL? ~

- For Nvim 0.1.7 or older: see the note about `NVIM_TUI_ENABLE_CURSOR_SHAPE` in `man nvim`.
- For Nvim 0.2 or newer: cursor styling is controlled by the 'guicursor' option.
    - To _disable_ cursor-styling, set 'guicursor' to empty: >vim

            :set guicursor=
            " Workaround some broken plugins which set guicursor indiscriminately.
            :autocmd OptionSet guicursor noautocmd set guicursor=
<
    - If you want a non-blinking cursor, use `blinkon0`. See 'guicursor'.
    - 'guicursor' is enabled by default, unless Nvim thinks your terminal doesn't
        support it. If you're sure that your terminal supports cursor-shaping, set
        'guicursor' in your |init.vim|, as described in 'guicursor'.
- The Vim terminal options |t_SI| and `t_EI` are ignored, like all other |t_xx| options.
- Old versions of libvte (gnome-terminal, roxterm, terminator, ...) do not
  support cursor style control codes. #2537
  https://github.com/neovim/neovim/issues/2537


HOW TO CHANGE CURSOR COLOR IN THE TERMINAL? ~

Cursor styling (shape, color, behavior) is controlled by 'guicursor', even in
the terminal. Cursor color (as opposed to shape) only works if
'termguicolors' is set.

'guicursor' gives an example, but here's a more complicated example
which sets different colors in insert-mode and normal-mode:
>vim
    :set termguicolors
    :hi Cursor guifg=green guibg=green
    :hi Cursor2 guifg=red guibg=red
    :set guicursor=n-v-c:block-Cursor/lCursor,i-ci-ve:ver25-Cursor2/lCursor2,r-cr:hor20,o:hor50
<

CURSOR STYLE ISN'T RESTORED AFTER EXITING OR SUSPENDING AND RESUMING NVIM ~

Terminals do not provide a way to query the cursor style. Use autocommands to
manage the cursor style:
>vim
    au VimEnter,VimResume * set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50
      \,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor
      \,sm:block-blinkwait175-blinkoff150-blinkon175

Title: Neovim Frequently Asked Questions (FAQ)
Summary
This section of the Neovim reference manual provides answers to frequently asked questions, including where to put your configuration file, the stability of development versions, compatibility with Lua-based Vim plugins, enabling true color in the terminal, resolving issues with weird symbols when changing modes, changing cursor shape and color in the terminal, and restoring cursor style after exiting or suspending Neovim.