Modern Neovim configuration with LSP, Tree-sitter, and Zig development support.
This is a complete rewrite of my original Vim configuration using Lua and modern Neovim features.
- Plugin Manager: lazy.nvim - Fast and modern plugin manager
- Language Server Protocol (LSP): Full IDE-like features with nvim-lspconfig
- Syntax Highlighting: Tree-sitter for advanced syntax highlighting
- Autocompletion: nvim-cmp with LSP, buffer, path, and snippet sources
- Fuzzy Finding: Telescope for file/text search
- File Explorer: nvim-tree with web devicons
- Zig: Full ZLS (Zig Language Server) integration with build/test/run keymaps
- Rust: rust-analyzer with cargo integration (auto-installed via Mason)
- Go: gopls with go module support (auto-installed via Mason)
- Lua: Neodev for Neovim Lua API support
- Auto-install Tree-sitter parsers for any language
- Language servers automatically managed by Mason
- Git Integration: gitsigns for inline git changes
- Status Line: lualine with Tokyo Night theme
- Comments: Comment.nvim for smart commenting
- Multi-cursor: vim-visual-multi for VSCode-style multi-cursor editing
- Color Scheme: Tokyo Night
- Wayland clipboard integration (wl-copy/wl-paste)
- Custom paste bindings for Chrome OS clipboard
- Optimized for Crostini/Linux container environments
# Neovim 0.9+ required
nvim --version
# Install required tools
# For Ubuntu/Debian (Crostini):
sudo apt install ripgrep fd-find wl-clipboard build-essential
# Language servers are auto-installed via Mason on first run!
# But if you want the compilers/toolchains:
# For Rust development (optional):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# For Go development (optional):
# Download from: https://go.dev/dl/
# For Zig development (optional):
# Download from: https://ziglang.org/download/Use the bootstrap script for automatic setup:
# One-line install:
curl -sSL https://raw.githubusercontent.com/prasincs/vim-config/master/bootstrap.sh | bash
# Or clone and run:
git clone https://github.com/prasincs/vim-config.git ~/vim-config
~/vim-config/bootstrap.shThe bootstrap script will:
- Install Neovim if not present
- Set up the configuration
- Install all plugins via lazy.nvim
- Install language servers (rust-analyzer, gopls, zls) via Mason
- Optionally install language toolchains (Rust, Go, Zig)
-
Clone this repository:
git clone https://github.com/prasincs/vim-config.git ~/vim-config -
Create symbolic links:
# Backup existing config if you have one mv ~/.config/nvim ~/.config/nvim.backup # Create symlink to config directory ln -s ~/vim-config ~/.config/nvim
-
Launch Neovim:
nvim
Lazy.nvim will automatically install all plugins on first launch. Mason will automatically install configured language servers.
If using a GUI like neovim-qt, the ginit.vim file configures:
- JetBrains Mono Nerd Font (size 12)
- Line spacing for better readability
Install a Nerd Font for proper icon display.
- Leader:
<Space>
<leader>e- Toggle file explorer (nvim-tree)<leader>pv- Open netrw (built-in file explorer)<leader>ff- Find files (Telescope)<leader>fg- Live grep (search in files)<leader>fb- Browse open buffers<leader>fh- Search help tags
gd- Go to definitiongD- Go to declarationgi- Go to implementationgr- List referencesK- Hover documentation<C-k>- Signature help<leader>rn- Rename symbol<leader>ca- Code actions<leader>f- Format buffer<leader>D- Type definition
[d- Previous diagnostic]d- Next diagnostic<leader>dl- Diagnostic list<leader>q- Open diagnostic quickfix list
<leader>m- Build project (useszig build,cargo build, orgo build)<leader>r- Build and run (language-aware)<leader>t- Run tests (language-aware)<leader>M- Build with custom args<leader>rr- Run in terminal (persistent output)<leader>rt- Test in terminal (persistent output)
<leader>zf- Quick run current Zig file<leader>rf- Quick compile & run current Rust file<leader>gf- Quick run current Go file
<leader>co- Open quickfix list<leader>cc- Close quickfix list[q- Previous quickfix item]q- Next quickfix item<leader>ce- Copy all errors to clipboard
J/K(visual) - Move selected lines up/down<C-d>/<C-u>- Half-page down/up (centered)n/N- Next/previous search (centered)<leader>y- Yank to system clipboard<leader>p(visual) - Paste without overwriting register<leader>d- Delete to black hole registergcc- Toggle line comment (Comment.nvim)gc(visual) - Toggle comment on selection
<C-S-v>- Paste from Chrome OS clipboard (all modes)<leader>fn- Fix null bytes to newlines
~/.config/nvim/
├── init.lua # Main configuration file
├── ginit.vim # GUI-specific settings
└── lazy-lock.json # Plugin version lockfile (auto-generated)
All configuration is in a single init.lua file for simplicity. For larger configs, consider splitting into:
lua/plugins/- Plugin specificationslua/config/- Settings and keymapsafter/ftplugin/- Filetype-specific settings
This config replaces the old Pathogen-based Vim setup with:
| Old (Vim) | New (Neovim) |
|---|---|
| Pathogen | lazy.nvim |
| Syntastic | nvim LSP + diagnostics |
| Ctrl-P | Telescope |
| NERDTree | nvim-tree |
| Powerline | lualine |
| Manual syntax | Tree-sitter |
| NERDCommenter | Comment.nvim |
| Fugitive | gitsigns (+ git via terminal) |
Create ~/.config/nvim/lua/local.lua for machine-specific settings and require it at the end of init.lua.
Edit the require("lazy").setup({...}) section in init.lua and add plugin specs. See lazy.nvim documentation.
Use Mason's UI (:Mason) or add to ensure_installed in the mason-lspconfig setup.
This configuration is designed to be instantly portable to any new machine:
- Self-contained: All dependencies managed by Mason
- Auto-installation: Language servers install on first run
- Bootstrap script: One command to set up everything
- No system dependencies: Language servers run from
~/.local/share/nvim/mason/
To move to a new machine, just run:
curl -sSL https://raw.githubusercontent.com/prasincs/vim-config/master/bootstrap.sh | bashVerify your setup anytime by running:
~/vim-config/check-health.shOr from the repo:
./check-health.shThis will check:
- ✅ Neovim installation
- ✅ All plugins (lazy.nvim, Mason, etc.)
- ✅ Language servers (rust-analyzer, gopls, zls)
- ✅ Language toolchains (Rust, Go, Zig)
- ✅ Treesitter parsers
- ✅ Clipboard support
Ensure wl-clipboard is installed:
sudo apt install wl-clipboard
wl-paste --version- Check if language server is installed:
:Mason - Check LSP status:
:LspInfo - Check logs:
:lua vim.cmd('e'..vim.lsp.get_log_path())
- Update lazy.nvim:
:Lazy sync - Check for errors:
:Lazy log - Clean and reinstall:
:Lazy cleanthen:Lazy install
Feel free to use this configuration for your own setup. No warranty provided.
- 2010-2020: Original Vim config with Pathogen and Vimscript
- 2025: Complete rewrite for Neovim with Lua, LSP, and modern tooling