Neovim Installation Guide
Neovim Installation Guide
Neovim is a modern fork of Vim with better performance, built-in LSP support, and Lua configuration.
Installation
Ubuntu/Debian
sudo apt update
sudo apt install -y neovim
Fedora
sudo dnf install -y neovim
Arch Linux
sudo pacman -S neovim
From Official Release (Latest)
wget https://github.com/neovim/neovim/releases/download/v0.10.0/nvim-linux64.tar.gz
sudo tar -xzf nvim-linux64.tar.gz -C /opt
sudo ln -s /opt/nvim-linux64/bin/nvim /usr/local/bin/nvim
Via AppImage
wget https://github.com/neovim/neovim/releases/download/v0.10.0/nvim.appimage
chmod +x nvim.appimage
./nvim.appimage
Verification
nvim --version
Basic Configuration
Create ~/.config/nvim/init.lua:
-- Enable syntax highlighting
vim.cmd('syntax on')
-- Enable line numbers
vim.opt.number = true
vim.opt.relativenumber = true
-- Enable mouse support
vim.opt.mouse = 'a'
-- Enable incremental search
vim.opt.incsearch = true
-- Highlight search results
vim.opt.hlsearch = true
-- Case insensitive search
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- Enable indent guides
vim.opt.autoindent = true
vim.opt.smartindent = true
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
-- Enable clipboard
vim.opt.clipboard = 'unnamedplus'
-- Enable line wrapping
vim.opt.wrap = true
-- Enable visual line navigation
vim.keymap.set('n', 'j', 'gj')
vim.keymap.set('n', 'k', 'gk')
Basic Commands
| Command | Action |
|---|---|
nvim file |
Open file |
:w |
Save |
:q |
Quit |
:wq |
Save and quit |
Space |
Leader key (default) |
Ctrl+p |
Fuzzy finder (with plugin) |
:Lazy |
Package manager |
:Mason |
LSP installer |