Nvim Readme

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 #

PluginPurpose
tokyonight.nvimColorscheme (currently using habamax)
neo-tree.nvimFile tree explorer
telescope.nvimFuzzy finder for files, grep, buffers, keymaps, etc.
harpoonQuick file navigation and bookmarking
which-key.nvimPopup showing pending keybinds
todo-comments.nvimHighlight TODOs and notes in comments
nvim-highlight-colorsShow color previews inline
smear-cursor.nvimSmooth cursor animation
nvim-autopairsAutomatically close brackets and quotes
nvim-treesitterSyntax highlighting and indentation (archived, see below)
mason.nvimPackage manager for LSP servers, linters, and formatters
mason-lspconfig.nvimBridge between Mason and nvim-lspconfig
nvim-lspconfigOfficial LSP client configurations
fidget.nvimLSP progress UI
lazydev.nvimEnhanced Lua LSP for Neovim config development
nvim-cmpAutocompletion engine
cmp-nvim-lspLSP completion source for nvim-cmp
cmp-bufferBuffer text completion source
cmp-pathPath completion source
cmp-cmdlineCommand-line completion (: and /)
LuaSnipSnippet engine
friendly-snippetsVS Code-style snippet collection

Keymaps #

General #

KeyAction
<Space>Leader key
;Enter command mode (:)
<leader>ntToggle Neo-tree file explorer
<leader>pPaste without overwriting register (visual mode)
<leader>yYank to system clipboard (visual mode)
<leader>YYank entire file to system clipboard
J / KMove selected text down/up (visual mode)
KeyAction
<leader>shSearch Help
<leader>skSearch Keymaps
<leader>sfSearch Files
<leader>ssSearch Select (Telescope built-ins)
<leader>swSearch current Word
<leader>sgSearch by Grep
<leader>sdSearch Diagnostics
<leader>srSearch 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>snSearch Neovim config files

Harpoon (File Marks) #

KeyAction
<leader>hAdd 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.

KeyAction
gdGo to Definition
grFind References
gIGo to Implementation
<leader>DType Definition
KHover Documentation
<leader>rnRename Symbol
<leader>caCode Action
<leader>fFormat Buffer (manual)
<leader>dsDocument Symbols
[d / ]dJump to previous/next diagnostic

Autocomplete (nvim-cmp) #

KeyAction
<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:

ServerLanguage
pyrightPython
ts_lsJavaScript / TypeScript
goplsGo
rust_analyzerRust
clangdC / C++
htmlHTML
csslsCSS
lua_lsLua

Managing LSP Servers #

Open the Mason UI:

1
:Mason

Install a new server:

1
:MasonInstall <server-name>

Update all installed packages:

1
:MasonUpdate

Treesitter Parsers #

These parsers are automatically installed on first launch:

  • python
  • go
  • javascript
  • typescript
  • rust
  • c
  • html
  • css
  • lua
  • vim
  • vimdoc
  • query
  • markdown

Additional parsers for new filetypes are installed automatically (auto_install = true).


Treesitter Status & Future Upgrade Path #

Note: The nvim-treesitter plugin repository was archived by its owner on April 3, 2026 and is now read-only. It is pinned to the master branch in this config, which remains stable and functional.

Why keep it? #

  • The master branch 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 with tree-sitter-cli.

Option 2: Switch to a community fork If a well-maintained community fork emerges, update the plugin spec in init.lua:

1
{ '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 #

OptionValueDescription
relativenumbertrueRelative line numbers
numbertrueAbsolute line number on current line
scrolloff12Keep 12 lines visible above/below cursor
tabstop / shiftwidth / softtabstop44-space indentation
expandtabtrueUse spaces instead of tabs
mouseaEnable mouse in all modes
termguicolorstrueTrue color support
clipboardunnamedplusUse system clipboard
signcolumnyesAlways show sign column
cursorlinetrueHighlight current line
splitright / splitbelowtrueSplit windows to right/bottom
undofiletruePersistent undo history
ignorecase / smartcasetrueCase-insensitive search (unless uppercase used)
inccommandsplitLive preview for :s substitutions
updatetime250Faster completion and diagnostics
timeoutlen300Faster which-key popup
showmodefalseHide mode indicator (shown in statusline)

Filetype-specific Settings #

.tmpl files #

HTML comment syntax (<!-- -->) is used for comments in .tmpl template files.


Installation / Setup #

  1. Ensure dependencies are installed:

    • Neovim 0.12+ (check with nvim --version)
    • git
    • make (for telescope-fzf-native)
    • A C compiler (gcc or clang) for building Treesitter parsers
    • A Nerd Font for icons (optional but recommended)
  2. Open Neovim:

    1
    
    nvim
    
  3. Install plugins:

    1
    
    :Lazy sync
    
  4. 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).
  5. Restart Neovim after everything is installed.


Troubleshooting #

Treesitter parsers failing to build #

Make sure you have a C compiler installed:

1
2
3
4
5
6
7
8
# 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:

1
:Mason

If missing, install it manually:

1
: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 #

CommandDescription
:LazyOpen lazy.nvim plugin manager UI
:Lazy syncInstall/update all plugins
:MasonOpen Mason LSP package manager
:TSUpdateUpdate all Treesitter parsers
:checkhealthRun Neovim health check
:LspInfoShow active LSP clients for current buffer
:LspRestartRestart LSP client for current buffer
:TelescopeOpen Telescope picker