Skip to content

NeoVim

Neovim Quick Start Guide

(Modern fork of Vim with better defaults and Lua support)


1. Installation & Setup

# Linux (Debian/Ubuntu)
sudo apt install neovim

# MacOS
brew install neovim

# Windows (Winget)
winget install Neovim.Neovim

First Run:

nvim  # Launches Neovim
:checkhealth  # Checks system dependencies


2. Key Improvements Over Vim

Feature Vim Neovim
Default Config Minimal Sane defaults
Lua Support Limited First-class
Terminal Basic Built-in :terminal
Plugins Vimscript Lua/Vimscript
Async Limited Native async

3. Essential Workflow

(Same as Vim but with enhancements)

Ctrl+o    Jump back
Ctrl+i    Jump forward
gd        Go to definition
gf        Go to file

LSP (Language Server Protocol)

:lua vim.lsp.buf.definition()  # Jump to definition
K          Hover documentation
<leader>ca # Code actions

Fuzzy Finding (Telescope)

-- Install telescope.nvim first
:Telescope find_files  # Find files
:Telescope live_grep   # Search text

4. Configuration (init.lua)

Example ~/.config/nvim/init.lua:

-- Set options
vim.opt.number = true
vim.opt.tabstop = 4

-- Plugin manager (packer.nvim)
require('packer').startup(function()
  use 'wbthomason/packer.nvim'  -- Package manager
  use 'nvim-telescope/telescope.nvim'  -- Fuzzy finder
end)

-- Key mappings
vim.keymap.set('n', '<leader>ff', ':Telescope find_files<CR>')


5. Plugin Ecosystem

Plugin Purpose
packer.nvim Package manager
telescope.nvim Fuzzy finder
nvim-lspconfig LSP configurations
nvim-treesitter Better syntax highlighting

6. Modern Features

  1. Built-in Terminal

    :terminal  # Open terminal
    Ctrl+\ Ctrl+n  # Exit terminal mode
    

  2. Lua Configuration

    -- Example: Set theme
    vim.cmd('colorscheme gruvbox')
    

  3. Native LSP

    :LspInstall python  # Install Python LSP
    


7. Cheat Sheet

<leader> = usually spacebar

Space+ff   Find files (Telescope)
Space+lg   Live grep (Telescope)
gd         Go to definition (LSP)
K          Show documentation (LSP)
:Format    Format file (LSP)

8. Getting Help

:help nvim  # Neovim docs
:checkhealth  # System check
:lua print(vim.inspect(vim.lsp.buf))  # Debug LSP

🚀 Next Steps:
1. Install kickstart.nvim for pre-configured setup
2. Learn Lua for advanced configuration
3. Explore plugin ecosystem

Neovim combines Vim's efficiency with modern IDE features!