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 |
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 |
<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 |
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 |
LSP Servers #
Managed automatically via Mason. The following servers are configured to auto-install:
| Server | Language |
|---|---|
pyright | Python |
ts_ls | JavaScript / TypeScript |
gopls | Go |
rust_analyzer | Rust |
clangd | C / C++ |
html | HTML |
cssls | CSS |
lua_ls | Lua |
Managing LSP Servers #
Open the Mason UI:
| |
Install a new server:
| |
Update all installed packages:
| |
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:
| |
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:
1nvimInstall plugins:
1:Lazy syncInstall 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:
| |
LSP server not found #
Check if the server is installed via Mason:
| |
If missing, install it manually:
| |
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 |