Neovim Configuration #
A single-file Neovim configuration using lazy.nvim for plugin management. This setup includes fuzzy finding, file tree navigation, syntax highlighting, LSP support, and autocompletion.
Plugins #
| Plugin | Purpose |
|---|---|
tokyonight.nvim |
Colorscheme (currently using habamax) |
neo-tree.nvim |
File tree explorer |
telescope.nvim |
Fuzzy finder for files, grep, buffers, keymaps, etc. |
harpoon |
Quick file navigation and bookmarking |
which-key.nvim |
Popup showing pending keybinds |
todo-comments.nvim |
Highlight TODOs and notes in comments |
nvim-highlight-colors |
Show color previews inline |
smear-cursor.nvim |
Smooth cursor animation |
nvim-autopairs |
Automatically close brackets and quotes |
nvim-treesitter |
Syntax highlighting and indentation (archived, see below) |
mason.nvim |
Package manager for LSP servers, linters, and formatters |
mason-lspconfig.nvim |
Bridge between Mason and nvim-lspconfig |
nvim-lspconfig |
Official LSP client configurations |
fidget.nvim |
LSP progress UI |
lazydev.nvim |
Enhanced Lua LSP for Neovim config development |
nvim-cmp |
Autocompletion engine |
cmp-nvim-lsp |
LSP completion source for nvim-cmp |
cmp-buffer |
Buffer text completion source |
cmp-path |
Path completion source |
cmp-cmdline |
Command-line completion (: and /) |
LuaSnip |
Snippet engine |
friendly-snippets |
VS Code-style snippet collection |
nvim-ufo |
LSP-powered code folding (with promise-async) |
vim-fugitive |
Git integration (status, diff, blame, log, etc.) |
quicker.nvim |
Editable quickfix (dd to delete, :w to sync) |
Keymaps #
General #
| Key | Action |
|---|---|
<Space> |
Leader key |
; |
Enter command mode (:) |
<leader>nt |
Toggle Neo-tree file explorer |
<leader>p |
Paste without overwriting register (visual mode) |
<leader>y |
Yank to system clipboard (visual mode) |
<leader>Y |
Yank entire file to system clipboard |
J / K |
Move selected text down/up (visual mode) |
Telescope (Search) #
| Key | Action |
|---|---|
<leader>sh |
Search Help |
<leader>sk |
Search Keymaps |
<leader>sf |
Search Files |
<leader>ss |
Search Select (Telescope built-ins) |
<leader>sw |
Search current Word |
<leader>sg |
Search by Grep (visual mode: searches selection, literal) |
<leader>sd |
Search Diagnostics |
<leader>sr |
Search Resume (previous search) |
<leader>s. |
Search Recent Files |
<leader><leader> |
Find existing buffers |
<leader>/ |
Fuzzily search in current buffer |
<leader>s/ |
Live Grep in Open Files |
<leader>sn |
Search Neovim config files |
Harpoon (File Marks) #
| Key | Action |
|---|---|
<leader>h |
Add current file to Harpoon |
<C-h> |
Toggle Harpoon quick menu |
<C-1> through <C-7> |
Jump to Harpoon file 1–7 |
<C-S-P> |
Previous Harpoon file |
<C-S-N> |
Next Harpoon file |
<C-e> |
Open Harpoon window in Telescope |
Git (Fugitive) #
These keymaps are available in any buffer. See :help fugitive for the full command list.
| Key | Action |
|---|---|
<leader>gs |
Git [S]tatus (opens :G interactive window) |
<leader>gd |
Git [D]iff (:Gdiffsplit) |
<leader>gb |
Git [B]lame (:G blame) |
<leader>gl |
Git [L]og (:G log) |
<leader>gw |
Git [W]rite (stage current file) |
Quickfix (quicker.nvim) #
In Telescope results: <C-q> sends all to quickfix, <M-q> (Alt+q) sends Tab-selected. In quickfix: dd deletes entry, > / < expands/collapses context, :w syncs.
| Key | Action |
|---|---|
<leader>q |
Toggle quickfix |
<leader>l |
Toggle loclist |
Folds (nvim-ufo) #
These keymaps work in any buffer. Folds are powered by the LSP when available, falling back to indentation.
| Key | Action |
|---|---|
zc |
Close fold |
zo |
Open fold |
zC |
Close all folds |
zO |
Open all folds |
Standard Vim fold commands (
za,zo,zc, etc.) also work. See:help folding.
LSP (Language Server Protocol) #
These keymaps are active when an LSP server is attached to the current buffer.
| Key | Action |
|---|---|
gd |
Go to Definition |
gr |
Find References |
gI |
Go to Implementation |
<leader>D |
Type Definition |
K |
Hover Documentation |
<leader>rn |
Rename Symbol |
<leader>ca |
Code Action |
<leader>f |
Format Buffer (manual) |
<leader>ds |
Document Symbols |
[d / ]d |
Jump to previous/next diagnostic |
Autocomplete (nvim-cmp) #
| Key | Action |
|---|---|
<C-n> |
Next completion item |
<C-p> |
Previous completion item |
<C-b> |
Scroll documentation up |
<C-f> |
Scroll documentation down |
<C-y> |
Confirm selection |
<C-Space> |
Trigger completion manually |
<Tab> |
Expand snippet or jump forward |
<S-Tab> |
Jump snippet backward |
How to Use: Folds #
Folds let you collapse and expand blocks of code. This config uses nvim-ufo with the LSP as the primary provider, so folds match your language server's understanding of the code structure.
Basic Commands #
| Command | Action |
|---|---|
za |
Toggle fold under cursor |
zo |
Open fold under cursor |
zc |
Close fold under cursor |
zR |
Open all folds (global) |
zM |
Close all folds (global) |
zr |
Open more folds (incremental) |
zm |
Close more folds (incremental) |
Quick Tips #
- Navigate inside a closed fold: Move the cursor over the fold indicator and press
zato open it. - Folds update automatically when you edit the file.
- No LSP? Folds will fall back to indentation-based folding.
Sign Column (Diagnostics) #
The column to the left of the line numbers is the sign column. It appeared after adding LSP support because language servers now report issues directly in the editor.
Symbols #
| Symbol | Meaning | Severity |
|---|---|---|
E |
Error | Code that will not compile or run |
W |
Warning | Suspicious or deprecated code |
I |
Information | e.g., unused variables |
H |
Hint | Style suggestions or quick fixes |
Diagnostic Keymaps #
| Key | Action |
|---|---|
<leader>e |
Show full diagnostic message in a floating window |
[d |
Jump to previous diagnostic |
]d |
Jump to next diagnostic |
LSP Servers #
Native servers are managed automatically via Mason. The following servers are configured to auto-install:
| Server | Language | Installed via |
|---|---|---|
gopls |
Go | Mason |
rust_analyzer |
Rust | Mason |
clangd |
C / C++ | Mason |
lua_ls |
Lua | Mason |
jedi_language_server |
Python | uv (pinned, see dev-env/dev_env.sh) |
tsc |
JavaScript / TypeScript | Native TypeScript 7 binary (tsc --lsp, pinned) |
biome |
HTML / CSS | Biome release binary (pinned) |
No language server in this setup uses Node.js or npm.
Managing LSP Servers #
Open the Mason UI:
:Mason
Install a new server:
:MasonInstall <server-name>
Update all installed packages:
:MasonUpdate
Treesitter Parsers #
These parsers are automatically installed on first launch:
pythongojavascripttypescriptrustchtmlcssluavimvimdocquerymarkdown
Additional parsers for new filetypes are installed automatically (auto_install = true).
Treesitter Status & Future Upgrade Path #
Note: The
nvim-treesitterplugin repository was archived by its owner on April 3, 2026 and is now read-only. It is pinned to themasterbranch in this config, which remains stable and functional.
Why keep it? #
- The
masterbranch is mature, stable, and continues to work with Neovim 0.12. - Lazy.nvim installs from archived repositories without issues.
- It provides convenient parser management (
:TSInstall,ensure_installed,auto_install) that Neovim does not natively handle.
Future upgrade paths #
When you're ready to move away from the archived plugin, you have two options:
Option 1: Go fully native (Neovim 0.12+)
Remove nvim-treesitter and use Neovim's built-in treesitter support:
- Highlighting:
vim.treesitter.start()is built-in. - Indentation:
vim.bo.indentexpr = "v:lua.vim.treesitter.query.get_indent()" - Trade-off: You lose automatic parser installation. You must install parsers manually via your OS package manager (e.g.,
tree-sitter-lua) or compile them withtree-sitter-cli.
Option 2: Switch to a community fork
If a well-maintained community fork emerges, update the plugin spec in init.lua:
{ 'username/nvim-treesitter-fork', branch = 'main', build = ':TSUpdate' }
Option 3: Keep using the archived plugin There is no immediate need to change anything. The plugin will continue to work as long as the parsers compile and Neovim's treesitter API remains compatible.
Settings #
| Option | Value | Description |
|---|---|---|
relativenumber |
true |
Relative line numbers |
number |
true |
Absolute line number on current line |
scrolloff |
12 |
Keep 12 lines visible above/below cursor |
tabstop / shiftwidth / softtabstop |
4 |
4-space indentation |
expandtab |
true |
Use spaces instead of tabs |
mouse |
a |
Enable mouse in all modes |
termguicolors |
true |
True color support |
clipboard |
unnamedplus |
Use system clipboard |
signcolumn |
yes |
Always show sign column |
cursorline |
true |
Highlight current line |
splitright / splitbelow |
true |
Split windows to right/bottom |
undofile |
true |
Persistent undo history |
ignorecase / smartcase |
true |
Case-insensitive search (unless uppercase used) |
inccommand |
split |
Live preview for :s substitutions |
updatetime |
250 |
Faster completion and diagnostics |
timeoutlen |
300 |
Faster which-key popup |
showmode |
false |
Hide mode indicator (shown in statusline) |
Filetype-specific Settings #
.tmpl files #
HTML comment syntax (<!-- -->) is used for comments in .tmpl template files.
Installation / Setup #
-
Ensure dependencies are installed:
- Neovim 0.12+ (check with
nvim --version) gitmake(fortelescope-fzf-native)- A C compiler (
gccorclang) for building Treesitter parsers - A Nerd Font for icons (optional but recommended)
- Neovim 0.12+ (check with
-
Open Neovim:
nvim -
Install plugins:
:Lazy sync -
Install LSP servers and Treesitter parsers:
- LSP servers are installed automatically by Mason on first launch.
- Treesitter parsers will compile on first startup (may take 10–30 seconds).
-
Restart Neovim after everything is installed.
Troubleshooting #
Treesitter parsers failing to build #
Make sure you have a C compiler installed:
# Ubuntu/Debian
sudo apt install build-essential
# macOS
xcode-select --install
# Arch
sudo pacman -S base-devel
LSP server not found #
Check if the server is installed via Mason:
:Mason
If missing, install it manually:
:MasonInstall <server-name>
Colors not showing correctly #
Ensure your terminal supports true color and you have a Nerd Font selected.
File Structure #
~/.config/nvim/
├── init.lua # Main configuration file (single file setup)
├── lazy-lock.json # Plugin version lockfile
└── archive/ # Previous config iterations
Useful Commands #
| Command | Description |
|---|---|
:Lazy |
Open lazy.nvim plugin manager UI |
:Lazy sync |
Install/update all plugins |
:Mason |
Open Mason LSP package manager |
:TSUpdate |
Update all Treesitter parsers |
:checkhealth |
Run Neovim health check |
:LspInfo |
Show active LSP clients for current buffer |
:LspRestart |
Restart LSP client for current buffer |
:Telescope |
Open Telescope picker |
:G |
Open Fugitive git status window |
:Gdiffsplit |
Diff current file against index |
:G blame |
Blame current file |
:G log |
Git log |
:G write |
Stage current file |
:G read |
Checkout current file |