$linuxjunkies
>

nvim(1)

Neovim is a highly extensible text editor built on Vim principles with modern features like async I/O, built-in LSP support, and Lua scripting.

UbuntuDebianFedoraArch

Synopsis

nvim [OPTION]... [FILE]...

Description

Neovim is a modern fork of Vim that maintains backward compatibility while adding powerful new capabilities. It features a built-in Language Server Protocol (LSP) client for intelligent code completion and diagnostics, asynchronous plugin execution, and a Lua-based configuration system as an alternative to Vimscript.

Like Vim, Neovim uses modal editing with normal mode for navigation and command execution, insert mode for typing text, and visual mode for selecting text. It supports advanced features like tree-sitter for syntax highlighting, floating windows for UI elements, and remote plugin architecture.

Common options

FlagWhat it does
-u <config>Use specified file as init.vim/init.lua instead of the default
-NDisable vi compatibility mode (default in Neovim)
-c <cmd>Execute Ex command after loading files, e.g., -c 'set number'
+<num>Go to line number, e.g., nvim +42 file.txt
-oSplit windows horizontally for each file
-OSplit windows vertically for each file
-pOpen files in tabs
-ROpen in read-only mode
-dStart in diff mode to compare files
-MDisable modifications (modifiable=false)
--nopluginSkip loading plugins
-V[<level>]Set verbosity level for debugging, e.g., -V9

Examples

Open myfile.txt for editing in Neovim

nvim myfile.txt

Open myfile.txt and jump directly to line 10

nvim +10 myfile.txt

Open myfile.txt with line numbers enabled via Ex command

nvim -c 'set number' myfile.txt

Open two files in horizontally split windows

nvim -o file1.txt file2.txt

Open three files in separate tabs

nvim -p file1.txt file2.txt file3.txt

Open system log file in read-only mode

nvim -R /var/log/syslog

Start diff mode to compare two files side-by-side

nvim -d original.txt modified.txt

Use custom Lua configuration file instead of default

nvim -u ~/.config/nvim/init.lua myfile.txt

Related commands