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.
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
| Flag | What it does |
|---|---|
-u <config> | Use specified file as init.vim/init.lua instead of the default |
-N | Disable 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 |
-o | Split windows horizontally for each file |
-O | Split windows vertically for each file |
-p | Open files in tabs |
-R | Open in read-only mode |
-d | Start in diff mode to compare files |
-M | Disable modifications (modifiable=false) |
--noplugin | Skip loading plugins |
-V[<level>] | Set verbosity level for debugging, e.g., -V9 |
Examples
Open myfile.txt for editing in Neovim
nvim myfile.txtOpen myfile.txt and jump directly to line 10
nvim +10 myfile.txtOpen myfile.txt with line numbers enabled via Ex command
nvim -c 'set number' myfile.txtOpen two files in horizontally split windows
nvim -o file1.txt file2.txtOpen three files in separate tabs
nvim -p file1.txt file2.txt file3.txtOpen system log file in read-only mode
nvim -R /var/log/syslogStart diff mode to compare two files side-by-side
nvim -d original.txt modified.txtUse custom Lua configuration file instead of default
nvim -u ~/.config/nvim/init.lua myfile.txt