80 lines
3.3 KiB
Markdown
80 lines
3.3 KiB
Markdown
# CLAUDE.md
|
|
|
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
|
|
## Overview
|
|
|
|
Personal Neovim configuration using [lazy.nvim](https://github.com/folke/lazy.nvim) as the plugin manager. All Lua code lives under the `holger` namespace in `lua/holger/`.
|
|
|
|
## Architecture
|
|
|
|
**Entry point:** `init.lua` loads three modules:
|
|
- `holger.core` — Neovim options and keymaps (`lua/holger/core/`)
|
|
- `holger.lazy` — bootstraps lazy.nvim and loads all plugins
|
|
- `holger.lsp` — LSP keymaps and diagnostic signs
|
|
|
|
**Plugin loading:** `lua/holger/lazy.lua` calls `require("lazy").setup()` with two import paths:
|
|
- `holger.plugins` — all files in `lua/holger/plugins/` (each returns a lazy.nvim spec table)
|
|
- `holger.plugins.lsp` — files in `lua/holger/plugins/lsp/`
|
|
|
|
**Adding a plugin:** Create a new file in `lua/holger/plugins/` that returns a lazy.nvim spec table. It will be auto-imported.
|
|
|
|
## Key Configuration
|
|
|
|
- **Leader key:** `<Space>`
|
|
- **Colorscheme:** catppuccin
|
|
- **Indentation:** 2 spaces, expandtab
|
|
|
|
## LSP Stack
|
|
|
|
- `mason.nvim` — installs LSP servers and tools
|
|
- `mason-lspconfig.nvim` — bridges Mason with nvim-lspconfig; auto-installs: `html`, `cssls`, `lua_ls`, `pyright`, `jsonls`, `yamlls`, `marksman`, `taplo`, `texlab`, `hyprls`
|
|
- `mason-tool-installer.nvim` — installs formatters/linters: `prettier`, `stylua`, `isort`, `black`, `pylint`, `shfmt`
|
|
- `blink.cmp` (`lua/holger/plugins/blink-cmp.lua`) — sets up LSP capabilities via `vim.lsp.config("*", ...)` (native Neovim LSP API)
|
|
- `lazydev.nvim` — Lua LSP annotations for Neovim API (`vim.*`)
|
|
|
|
## Completion
|
|
|
|
- **blink.cmp** — completion engine with built-in LSP, buffer, path, and snippet sources
|
|
- Replaces: nvim-cmp, cmp-nvim-lsp, LuaSnip, lspkind, nvim-autopairs
|
|
- Snippets loaded from `friendly-snippets`
|
|
- Auto-brackets enabled (replaces nvim-autopairs)
|
|
|
|
## Formatting & Linting
|
|
|
|
- **conform.nvim** — formats on save; `<leader>mp` to format manually
|
|
- CSS/HTML/JSON/YAML/Markdown/GraphQL → prettier
|
|
- Lua → stylua
|
|
- Python → isort + black
|
|
- Shell (sh/bash) → shfmt
|
|
- **nvim-lint** — lints on BufEnter/BufWritePost/InsertLeave; `<leader>l` to trigger manually
|
|
- Python → pylint
|
|
|
|
## Key Keymaps
|
|
|
|
| Key | Action |
|
|
|-----|--------|
|
|
| `jk` (insert) | Exit insert mode |
|
|
| `<leader>ee` | Toggle nvim-tree file explorer |
|
|
| `<leader>ef` | Toggle explorer on current file |
|
|
| `<leader>ff` | Telescope find files |
|
|
| `<leader>fs` | Telescope live grep |
|
|
| `<leader>fr` | Telescope recent files |
|
|
| `<leader>fc` | Grep string under cursor |
|
|
| `<leader>mp` | Format file (conform) |
|
|
| `<leader>l` | Trigger linting |
|
|
| `<leader>sv/sh` | Split window vertical/horizontal |
|
|
| `<leader>nh` | Clear search highlights |
|
|
|
|
## Notable Plugins
|
|
|
|
- **telescope.nvim** — fuzzy finder with fzf-native extension
|
|
- **nvim-treesitter** — syntax highlighting and incremental selection (`<C-space>`)
|
|
- **blink.cmp** — completion engine with LSP/buffer/path/snippet sources
|
|
- **flash.nvim** — enhanced motion with jump labels (currently disabled via `enabled = false`)
|
|
- **auto-session** — automatic session save/restore
|
|
- **which-key** — displays keybinding hints
|
|
- **fugitive** — Git integration
|
|
- **trouble.nvim** — diagnostics list
|
|
- **lazydev.nvim** — Lua LSP support for Neovim config development
|