← Back to articles

LazyVim Setup

Path: Computer Tech/Development/Editors/Neovim/LazyVim Setup.mdUpdated: 2/3/2026

LazyVim Setup

LazyVim transforms Neovim into a modern IDE with minimal configuration. This guide walks through installation, first launch, and essential customizations.

Pre-Installation Checklist

βœ… Neovim 0.9.0+ (LazyVim requires recent version) βœ… Git (for plugin management) βœ… A Nerd Font (for icons) βœ… ripgrep (for telescope grep) βœ… fd (for telescope file finding) βœ… Node.js (for LSP servers)

Install Dependencies

bash
# Install Neovim
brew install neovim

# Install tools
brew install git ripgrep fd node

# Install a Nerd Font (icons support)
brew tap homebrew/cask-fonts
brew install --cask font-jetbrains-mono-nerd-font
# or
brew install --cask font-fira-code-nerd-font

Configure your terminal to use the Nerd Font:

  • Ghostty: Preferences β†’ Font β†’ "JetBrainsMono Nerd Font"
  • iTerm2: Preferences β†’ Profiles β†’ Text β†’ Font β†’ "JetBrainsMono Nerd Font"

Installation

Backup Existing Config (if any)

bash
# Backup current Neovim config
mv ~/.config/nvim{,.bak}

# Backup current Neovim data
mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
mv ~/.cache/nvim{,.bak}

Install LazyVim

bash
# Clone the starter template
git clone https://github.com/LazyVim/starter ~/.config/nvim

# Remove .git folder so you can make it your own
rm -rf ~/.config/nvim/.git

First Launch

bash
nvim

What happens:

  1. LazyVim installs lazy.nvim (plugin manager)
  2. Downloads and installs all plugins
  3. Downloads treesitter parsers
  4. Compiles native modules
  5. Shows the dashboard

This takes 1-2 minutes on first launch. Be patient!

Understanding the Config Structure

LazyVim uses a clean directory structure:

~/.config/nvim/
β”œβ”€β”€ init.lua                 # Entry point (don't edit)
β”œβ”€β”€ lua/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ autocmds.lua    # Your autocmds
β”‚   β”‚   β”œβ”€β”€ keymaps.lua     # Your keybindings
β”‚   β”‚   β”œβ”€β”€ lazy.lua        # Plugin manager config
β”‚   β”‚   └── options.lua     # Your Neovim options
β”‚   └── plugins/
β”‚       β”œβ”€β”€ example.lua     # Example plugin config (delete this)
β”‚       └── *.lua           # Your plugin configs
└── stylua.toml             # Lua formatter config

Key principle: Don't edit init.lua. Put your customizations in:

  • lua/config/options.lua - Neovim settings
  • lua/config/keymaps.lua - Your keybindings
  • lua/plugins/ - Plugin configurations

First Customizations

Set Line Numbers and Basics

Edit ~/.config/nvim/lua/config/options.lua:

lua
-- Set line numbers
vim.opt.number = true           -- Show line numbers
vim.opt.relativenumber = true   -- Relative line numbers

-- Indentation (customize for your preference)
vim.opt.tabstop = 2             -- Tab displays as 2 spaces
vim.opt.shiftwidth = 2          -- Indent by 2 spaces
vim.opt.expandtab = true        -- Use spaces, not tabs

-- Search
vim.opt.ignorecase = true       -- Case insensitive search
vim.opt.smartcase = true        -- Unless uppercase used

-- Visual
vim.opt.wrap = false            -- Don't wrap lines
vim.opt.scrolloff = 8           -- Keep 8 lines visible around cursor
vim.opt.cursorline = true       -- Highlight current line

-- System clipboard integration
vim.opt.clipboard = "unnamedplus"  -- Use system clipboard

Add Custom Keybindings

Edit ~/.config/nvim/lua/config/keymaps.lua:

lua
-- Custom keybindings
local map = vim.keymap.set

-- Better window navigation
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window" })
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window" })
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window" })
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window" })

-- Better save
map("n", "<C-s>", ":w<CR>", { desc = "Save file" })

-- Clear search highlighting
map("n", "<Esc>", ":noh<CR>", { desc = "Clear search highlighting" })

-- Stay in indent mode
map("v", "<", "<gv", { desc = "Indent left and reselect" })
map("v", ">", ">gv", { desc = "Indent right and reselect" })

-- Move lines up/down
map("n", "<A-j>", ":m .+1<CR>==", { desc = "Move line down" })
map("n", "<A-k>", ":m .-2<CR>==", { desc = "Move line up" })
map("v", "<A-j>", ":m '>+1<CR>gv=gv", { desc = "Move selection down" })
map("v", "<A-k>", ":m '<-2<CR>gv=gv", { desc = "Move selection up" })

Installing Language Servers (LSP)

LazyVim uses Mason to manage LSP servers.

Open Mason

vim
:Mason

Interface:

  • i - Install server
  • u - Update server
  • X - Uninstall server
  • q - Quit

Recommended Servers

bash
# Inside :Mason, press 'i' on these:

# Web Development
typescript-language-server
tailwindcss-language-server
html-lsp
css-lsp
json-lsp

# Python
pyright

# Lua
lua-language-server

# Markdown
marksman

# Docker
dockerfile-language-server

# Shell
bash-language-server

Or install from command line:

bash
# Open Neovim and run:
:LspInstall typescript-language-server
:LspInstall pyright
:LspInstall lua-language-server

Essential Plugins to Add

Create ~/.config/nvim/lua/plugins/custom.lua:

lua
return {
  -- Better escape from insert mode
  {
    "max397574/better-escape.nvim",
    config = function()
      require("better_escape").setup({
        mapping = { "jk", "jj" },  -- jk or jj to exit insert mode
        timeout = 200,
      })
    end,
  },

  -- Auto-save
  {
    "pocco81/auto-save.nvim",
    config = function()
      require("auto-save").setup({
        enabled = true,
        trigger_events = { "InsertLeave", "TextChanged" },
      })
    end,
  },

  -- Better comments
  {
    "numToStr/Comment.nvim",
    config = function()
      require("Comment").setup()
    end,
  },

  -- Surround text objects
  {
    "kylechui/nvim-surround",
    config = function()
      require("nvim-surround").setup()
    end,
  },
}

Restart Neovim to install new plugins.

Essential Keybindings (Default LazyVim)

Leader Key

The <leader> key is Space by default.

File Navigation

KeyAction
<leader>ffFind files (Telescope)
<leader>frRecent files
<leader>fgFind by grep
<leader>fbFind buffers (open files)
<leader>eToggle file explorer

Window Management

KeyAction
<C-w>sSplit horizontal
<C-w>vSplit vertical
<C-w>cClose window
<C-w>=Equal size windows

LSP (Code Intelligence)

KeyAction
gdGo to definition
grGo to references
KHover documentation
<leader>caCode actions
<leader>rnRename symbol
]dNext diagnostic
[dPrevious diagnostic

Git Integration

KeyAction
<leader>ggOpen LazyGit
<leader>gbGit blame line
]hNext hunk
[hPrevious hunk

Terminal

KeyAction
<C-\>Toggle terminal
<C-/>New terminal

Color Scheme Configuration

LazyVim comes with several themes. Change in lua/config/options.lua:

lua
-- Set colorscheme
vim.cmd(<span class="wikilink-broken" title="Page not found: colorscheme tokyonight">colorscheme tokyonight</span>)

-- Or try these:
-- vim.cmd(<span class="wikilink-broken" title="Page not found: colorscheme catppuccin">colorscheme catppuccin</span>)
-- vim.cmd(<span class="wikilink-broken" title="Page not found: colorscheme gruvbox">colorscheme gruvbox</span>)
-- vim.cmd(<span class="wikilink-broken" title="Page not found: colorscheme nord">colorscheme nord</span>)

Install more themes in lua/plugins/colorscheme.lua:

lua
return {
  {
    "catppuccin/nvim",
    name = "catppuccin",
    priority = 1000,
    config = function()
      vim.cmd(<span class="wikilink-broken" title="Page not found: colorscheme catppuccin-mocha">colorscheme catppuccin-mocha</span>)
    end,
  },
}

Troubleshooting

Plugins Won't Install

vim
:Lazy sync    # Force sync plugins
:Lazy clean   # Remove unused plugins
:Lazy update  # Update all plugins

LSP Not Working

vim
:LspInfo      # Check LSP status
:Mason        # Install missing servers
:checkhealth  # Run health check

Slow Startup

vim
:Lazy profile  # See what's slow

Common causes:

  • Too many plugins loaded on startup
  • Use lazy = true for plugins you don't need immediately

Icons Not Showing

Problem: Boxes or weird characters instead of icons

Solution:

  1. Install a Nerd Font (see Pre-Installation)
  2. Configure terminal to use that font
  3. Restart terminal

Next Steps

Now that LazyVim is installed, learn the workflows:

File Management:

  • LazyVim Workflows/File Navigation in LazyVim - Finding files fast

Editing:

  • LazyVim Workflows/Code Editing Workflows - Efficient editing patterns

Git:

  • LazyVim Workflows/Git Integration in LazyVim - Using git in editor

LSP:

  • LazyVim Workflows/LSP and Code Intelligence - Autocomplete, jump to definition, etc.

Understanding:

Ecosystem:

Daily Workflow

bash
# Open project in LazyVim
cd ~/Code/myproject
nvim .

# Inside LazyVim:
Space + f + f       # Find file
Space + s + g       # Search in files
Space + e           # File explorer
gd                  # Go to definition
Space + c + a       # Code actions
Space + g + g       # Git UI

Remember: LazyVim is just Neovim with great defaults. Everything is customizable.