A minimal yet essential Neovim configuration built for modern development workflows. This setup prioritizes keyboard-centric navigation, LSP-native features, and a clean, distraction-free editing experience.
- Minimal but Essential: Only plugins that directly enhance productivity
- Modern Neovim 0.12: Leverages native LSP (
vim.lsp.config/vim.lsp.enable) instead of lspconfig wrappers - Keyboard-First: Tmux-style keybindings, no mouse dependency
- Transparent UI: All colorschemes use terminal background
- Performance: Lazy loading, disabled unnecessary built-ins, optimized for fast startup
~/.config/nvim/
├── init.lua # Entry point: sets leader keys, loads config
├── lua/
│ ├── config/
│ │ ├── lazy.lua # Plugin manager bootstrap
│ │ ├── options.lua # Editor settings (folding, UI, behavior)
│ │ ├── keymaps.lua # Global keybindings
│ │ └── autocmds.lua # Auto-commands (highlight yank, restore cursor, etc.)
│ └── plugins/
│ ├── lsp-lang.lua # LSP configuration (Java, Go, Rust, TS, Lua)
│ ├── treesitter.lua # Syntax highlighting
│ ├── completion.lua # Blink.cmp for autocompletion
│ ├── formatting.lua # Conform.nvim for code formatting
│ ├── snacks.lua # Picker, dashboard, git, terminal
│ ├── coding.lua # Comments, surround, gitsigns
│ ├── explorer.lua # Oil.nvim file explorer
│ ├── colorscheme.lua # 6 colorschemes with transparency
│ ├── lualine.lua # Statusline
│ └── ...
├── KEYBINDINGS.md # Comprehensive keybinding reference
└── README.md # This file
- Auto-bootstrap: Clones itself on first run
- Lazy loading: Plugins load on events (
BufReadPost,InsertEnter, etc.) - Performance optimizations: Disables unused built-ins (netrw, gzip, tutor, etc.)
- Spec-based: All plugins in
lua/plugins/*.luaare auto-imported
Modern Neovim 0.12 native LSP + nvim-dap debugging:
- Java, Go, Rust, TypeScript, Lua support
- Auto-install via Mason
- Format on save with Conform.nvim
- Debug with F-keys (F5/F9/F10/F11/F12)
- UI panels for variables, call stack, console
See LSP.md for complete setup and usage.
Configuration:
lazy=false,priority=1000to load before LSP (fixes first-file highlighting)- 21 languages pre-configured (Java, Go, Rust, TS, Lua, etc.)
auto_install=falseto avoid bloat (manual parser installation)- Textobjects for smart selections (
vaf,vif,vac,vic) - Incremental selection with
<C-space>
Why Treesitter First:
- Prevents race condition where first opened file has no syntax highlighting
- LSP loads at priority 900 (after treesitter)
Blink.cmp:
- Modern, fast completion engine
- Sources: LSP → Path → Buffer → Snippets
- Auto-brackets for functions/methods
- Signature help while typing
- Keybindings:
<CR>to accept,<C-y>alternative,<Tab>/<S-Tab>to navigate
Why Blink over nvim-cmp:
- Faster performance
- Better LSP integration
- Simpler configuration
Conform.nvim:
- Format on save with 500ms timeout
- LSP fallback if no formatter configured
- Per-language formatters:
- Lua: stylua
- Java: google-java-format
- JS/TS/React: prettier
- Go/Rust: LSP formatting
Integration:
gqoperator uses Conform (e.g.,gqapformats paragraph):Formatcommand for manual formatting<leader>fkeybinding (unified across LSP and Conform)
Oil.nvim:
- Edit directories like buffers (Vim-native workflow)
-opens parent directory<leader>--opens floating window<C-h>/<C-l>disabled to allow window navigation<C-r>to refresh
Why Oil over Neo-tree:
- Vim-like editing (delete files with
dd, rename withcw) - No tree UI complexity
- Minimal and fast
All-in-one QoL plugin:
- Picker: Fuzzy finder (files, grep, buffers, git, LSP symbols)
- Dashboard: Startup screen with quick actions
- Git: Lazygit integration, blame line
- Terminal: Toggle terminal with
<C-/> - Notifier: Notification system
- Zoxide: Project navigation (
<leader>fp)
Key Keybindings:
<leader>ff- Find files<leader>fg- Grep<leader>fb- Buffers<leader>fp- Projects (zoxide)<leader>gg- Lazygit<C-/>- Toggle terminal
6 Colorschemes (all with transparent=true):
- onedark (default)
- tokyonight
- catppuccin
- nightfox
- kanagawa
- rose-pine
Switch: <leader>sC opens colorscheme picker
- Comment.nvim:
gccto comment line,gcin visual mode - nvim-surround:
ys,cs,dsfor surroundings - gitsigns: Git hunks in sign column, stage/reset hunks
- todo-comments: Highlight TODO/FIXME/NOTE, jump with
]t/[t
Key Settings:
- Folding: LSP-based (
foldmethod=expr,foldexpr=vim.lsp.foldexpr()) - No swap files:
swapfile=false,backup=false,writebackup=false - Persistent undo:
undofile=true,undolevels=10000 - Line numbers: Relative + absolute
- Scroll offset:
scrolloff=4(keep 4 lines visible) - Global statusline: Single statusline for all windows
- Smooth scrolling: For wrapped lines
- Clipboard: Syncs with system (except over SSH)
Window Management (Tmux-style):
<leader>w|- Split vertical<leader>w-- Split horizontal<leader>wx- Close window<leader>wr- Resize mode (hjkl to resize, smart edge detection)<C-h/j/k/l>- Navigate windows
Buffer Navigation:
<S-h>/<S-l>- Previous/next buffer<leader>bb- Switch to alternate buffer<leader>bd- Delete buffer
Editing:
<A-j>/<A-k>- Move lines up/downJ/Kin visual mode - Move selection up/down</>in visual mode - Indent (stays in visual mode)- Visual paste (
p) - Doesn't yank deleted text
Quickfix/Location List:
[q/]q- Navigate quickfix<leader>xq- Close quickfix<leader>xl- Close location list
Other:
<Esc>- Clear search highlight<C-s>- Save file (works in insert/normal/visual)n/N- Next/prev search (centered and unfolded)
See KEYBINDINGS.md for complete reference.
- Highlight on yank: Brief highlight when yanking text
- Restore cursor position: Jump to last edit location on file open
- Auto-resize windows: Equal splits on terminal resize
- Close with
q: For help, qf, man, etc. - Wrap and spell: For text files (markdown, gitcommit)
- Auto-create directories: When saving to non-existent path
- JSON conceallevel fix: Disable concealing in JSON files
LSP & Debugging: Java, Go, Rust, TypeScript, Lua
Quick Start:
- LSP keybindings:
gd(definition),K(hover),gra(actions),grn(rename) - Debug keybindings:
F5(start),F9(breakpoint),F10/F11/F12(step) - Format:
<leader>f
See LSP.md for detailed configuration and troubleshooting.
:checkhealth " All plugins
:checkhealth nvim-treesitter " Treesitter
:checkhealth lsp " LSP:messages " All messages
:Lazy log " Plugin manager logs
:LspLog " LSP logs
:LspInfo " Attached LSP clients
:ConformInfo " Available formatters:Inspect " Show treesitter info under cursor
:InspectTree " Show syntax tree
:EditQuery " Edit treesitter queriesFirst file has no syntax highlighting:
- Fixed by setting treesitter
lazy=falsewithpriority=1000
Java imports not folding:
- Requires LSP to compute folds first
- Uses
vim.lsp.foldexprwrapper to detect when folds are ready - Only runs once per buffer via
vim.b[bufnr].imports_foldedflag
Multi-module Maven project errors:
- Ensure root detection finds parent pom (
.git→mvnw→gradlew) - Clear workspace cache:
rm -rf ~/.local/share/jdtls-workspace/ - Restart Neovim
LSP not attaching:
- Check
:LspInfofor client status - Verify Mason installed tools:
:Mason - Check root detection:
:lua print(vim.lsp.get_clients()[1].config.root_dir)
-
Backup existing config:
mv ~/.config/nvim ~/.config/nvim.bak
-
Clone this config (via chezmoi or directly):
# Via chezmoi chezmoi init git@github.com:craftyprash/mysetup.git chezmoi apply # Or directly git clone <repo> ~/.config/nvim
-
Install Neovim 0.12+:
# macOS brew install neovim # Arch Linux sudo pacman -S neovim
-
Install dependencies:
- Nerd Font: For icons (e.g., JetBrainsMono Nerd Font)
- ripgrep: For grep picker (
brew install ripgrep) - fd: For file picker (
brew install fd) - lazygit: For git UI (
brew install lazygit) - zoxide: For project navigation (
brew install zoxide)
-
Launch Neovim:
nvim
- Lazy.nvim auto-installs on first run
- Mason auto-installs LSP servers and formatters
- Treesitter parsers install manually:
:TSInstall <language>
-
Add LSP config in
lsp-lang.lua:vim.lsp.config("pyright", { settings = { python = { analysis = { typeCheckingMode = "basic" } } } }) vim.lsp.enable({ "pyright", ... })
-
Add formatter in
formatting.lua:formatters_by_ft = { python = { "black" }, }
-
Install tools via Mason:
ensure_installed = { "pyright", "black", ... }
Edit colorscheme.lua:
config = function()
require("onedark").setup({ transparent = true })
vim.cmd("colorscheme onedark") -- Change this line
endEdit keymaps.lua:
map("n", "<leader>ff", function() Snacks.picker.files() end, { desc = "Find Files" })- Startup time: ~50-80ms (measured with
nvim --startuptime) - Lazy loading: Most plugins load on events, not at startup
- Disabled built-ins: netrw, gzip, tutor, etc.
- Treesitter: No auto-install to avoid bloat
- LSP: Native Neovim 0.12 implementation (no lspconfig overhead)
- Neovim: Modern Vim-based editor
- Lazy.nvim: Fast plugin manager by @folke
- Snacks.nvim: QoL plugin collection by @folke
- Blink.cmp: Fast completion engine by @saghen
- nvim-jdtls: Java LSP integration by @mfussenegger
- Oil.nvim: File explorer by @stevearc
- Conform.nvim: Formatter by @stevearc
MIT