Search code examples
neovim

How do I exit nvim? (neovim)


When it first opened, it said:

~                type  :help nvim<Enter>       if you are new! 
~                type  :checkhealth<Enter>     to optimize Nvim
~                type  :q<Enter>               to exit         
~                type  :help<Enter>            for help

But when I type :q Enter it just appears in the body?

How do you stop nvim without running pkill nvim?


Solution

  • Vim / Neovim has different modes, the most common are :

    • Normal mode : you can't insert text, but you can use commands such as :q for quit
    • Insert mode : you can type/modify text => use i key to enter in Insert mode
    • Visual mode : mode to select text

    When you type :q if you see it typed into the document you're already in Insert mode => press Esc to return in Normal mode then quit Vim/Neovim with :q command.

    You can also use Ctrl+o :q to quit if you were already in insert mode.