.dotfiles

Neovim Configuration

Modern Neovim setup with < 300ms startup, AI integration, and ~54 plugins managed by lazy.nvim.

Features

Directory Structure

src/neovim/
β”œβ”€β”€ core/              # Core settings (7 files)
β”‚   β”œβ”€β”€ init.lua       # Module loader
β”‚   β”œβ”€β”€ options.lua    # Editor options (incl. spellfile from the private repo)
β”‚   β”œβ”€β”€ performance.lua # Speed optimizations
β”‚   β”œβ”€β”€ backup.lua     # Backup/swap/undo settings
β”‚   β”œβ”€β”€ folding.lua    # Code folding config
β”‚   β”œβ”€β”€ indentation.lua # Tab/space settings
β”‚   └── search.lua     # Search behavior
β”œβ”€β”€ keymaps/           # Key binding definitions (6 files)
β”‚   β”œβ”€β”€ core.lua       # Essential mappings
β”‚   β”œβ”€β”€ navigation.lua # Buffer, window, and file navigation
β”‚   β”œβ”€β”€ editing.lua    # Text editing enhancements
β”‚   β”œβ”€β”€ lsp.lua        # LSP and diagnostic mappings
β”‚   β”œβ”€β”€ plugins.lua    # Plugin-specific mappings
β”‚   └── debug.lua      # DAP debugging mappings
β”œβ”€β”€ plugins/           # Plugin configs (10 files)
β”‚   β”œβ”€β”€ ai.lua         # CodeCompanion setup
β”‚   β”œβ”€β”€ completion.lua # Blink.cmp config
β”‚   β”œβ”€β”€ init.lua       # Module notes
β”‚   β”œβ”€β”€ markdown-editing.lua # Markdown editing helpers (markdown.nvim)
β”‚   β”œβ”€β”€ markdown-render.lua  # In-buffer rendering (render-markdown.nvim)
β”‚   β”œβ”€β”€ markdown-preview.lua # Browser preview (markdown-preview.nvim)
β”‚   β”œβ”€β”€ minuet.lua     # Minuet AI inline completion
β”‚   β”œβ”€β”€ snacks.lua     # Quality-of-life utilities (explorer, lazygit, zen, scratch)
β”‚   β”œβ”€β”€ snippets.lua   # LuaSnip config
β”‚   └── vimtex.lua     # LaTeX support
β”œβ”€β”€ snippets/          # Language-specific snippets (10 files)
β”œβ”€β”€ init.lua           # Entry point with path detection
β”œβ”€β”€ autocmds.lua       # Autocommands, skeleton files, style-guide indentation
β”œβ”€β”€ commands.lua       # Custom commands
β”œβ”€β”€ error-handler.lua  # Error handling
β”œβ”€β”€ fixy.lua           # Production auto-formatter
β”œβ”€β”€ gitsigns.lua       # Git signs configuration
β”œβ”€β”€ keymaps.lua        # Keymap module loader (sets leader, loads keymaps/*)
β”œβ”€β”€ logging.lua        # Logging utilities (level via $NVIM_LOG_LEVEL)
β”œβ”€β”€ lsp.lua            # LSP configurations (20+ servers)
β”œβ”€β”€ plugins.lua        # Plugin specifications (~54 plugins)
β”œβ”€β”€ telescope.lua      # Telescope configuration
β”œβ”€β”€ ui.lua             # Theme and appearance
β”œβ”€β”€ utils.lua          # Utility functions
β”œβ”€β”€ work.lua           # Work detection utilities
└── work-init.lua      # Work-specific initialization

Config-loading gotcha: gitsigns.lua and telescope.lua share their names with plugin Lua modules, and the plugin’s runtimepath wins over the package.path entries init.lua adds. They are therefore loaded by explicit path (dofile) in plugins.lua, never via require()/load_config().

Quick Start

# Installation (plugins auto-install on first run)
ln -sf ~/.dotfiles/src/neovim ~/.config/nvim
nvim

# Health check
:checkhealth

# Plugin management
:Lazy              # Plugin manager UI
:Lazy profile      # Performance profiling
:Mason             # LSP installer

Key Bindings

Full reference: keymaps/KEYMAPS.md

Language Support

Web: TypeScript, JavaScript, HTML, CSS Systems: Rust, C/C++, Go, Zig Scripting: Python, Ruby, Bash, Lua Data: YAML, TOML, JSON, XML Docs: Markdown, LaTeX

Treesitter

The nvim-treesitter spec is pinned to the main branch (the repo’s default branch is the legacy master, which uses a removed API). On main there are no highlight/indent modules: parsers are installed with require("nvim-treesitter").install({...}) and highlighting is enabled per-buffer by a FileType autocmd calling vim.treesitter.start() (see the spec in plugins.lua). Parser builds require the tree-sitter CLI (brew install tree-sitter-cli) plus a C compiler. Markdown folds intentionally come from the runtime ftplugin (g.markdown_folding, see core/folding.lua), not treesitter.

AI Features

Performance

Auto-Formatting (fixy.lua)

Silent, robust formatting integrated with the repo-wide fixy formatter:

:Fixy          " Format current file
:FixyAuto      " Toggle auto-format
:FixyStatus    " Show status
:FixyDebug     " Toggle debug mode

Customization

Troubleshooting

Slow startup: :Lazy profile to identify slow plugins

LSP issues: :LspInfo and :Mason for server status

Completion not working: Check :lua =vim.lsp.get_clients()

Theme issues: Verify theme command and $MACOS_THEME

Treesitter issues: :checkhealth nvim-treesitter; :TSReset resets the current buffer; :TSLog shows installer logs

Debug logging: start with NVIM_LOG_LEVEL=DEBUG nvim; logs go to ~/.local/state/nvim/work-debug.log (see logging.lua)

Lessons Learned