# CLAUDE.md Obsidian: Projects/nvim This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Project Overview This is a modern Neovim configuration using lazy.nvim as the plugin manager. The goal is to replicate VSCode-like functionality with: - LSP support and autocompletion - Fuzzy file finding and navigation - Git integration (signs, blame, diffs) ## Directory Structure ``` nvim/ init.lua # Entry point, bootstraps lazy.nvim lua/ config/ lazy.lua # lazy.nvim setup and plugin loading options.lua # Vim options (from old init.vim settings) keymaps.lua # Key mappings (leader is comma) autocmds.lua # Autocommands plugins/ *.lua # Individual plugin specs (one file per plugin or category) ``` ## Key Conventions from Existing Config Preserve these from the old init.vim: - **Leader key**: `,` (comma) - **Split navigation**: `` to move between splits - **NERDTree equivalent**: `n` to toggle file tree (use nvim-tree or neo-tree) - **Goyo equivalent**: `f` for zen/focus mode (use zen-mode.nvim) - **Spell check**: `o` to toggle spell checking - **Replace all**: `S` in normal mode for `:%s//g` - **Clipboard**: Use system clipboard (`unnamedplus`) - **Line numbers**: Relative line numbers enabled - **Splits**: Open below and to the right ## Plugin Categories ### Core (must have) - lazy.nvim - plugin manager - nvim-lspconfig - LSP configuration - nvim-cmp + sources - autocompletion - telescope.nvim - fuzzy finder (replaces manual file navigation) - nvim-treesitter - syntax highlighting and parsing ### Git - gitsigns.nvim - git signs in gutter, inline blame - vim-fugitive or neogit - git operations ### UI/Navigation - nvim-tree.lua or neo-tree.nvim - file explorer (NERDTree replacement) - lualine.nvim - statusline (vim-airline replacement) - which-key.nvim - keybinding hints ### Editing - nvim-surround - surround operations (vim-surround replacement) - Comment.nvim - commenting (vim-commentary replacement) - nvim-autopairs - auto-close brackets ## Commands ```bash # Test the config by launching nvim with this config directory NVIM_APPNAME=nvim-dev nvim # Or symlink to test as default ln -sf ~/development/nvim ~/.config/nvim-dev ``` ## LSP Servers to Configure Based on typical development needs: - lua_ls (for Neovim config itself) - ts_ls (TypeScript/JavaScript) - gopls (Go) - rust_analyzer (Rust) - pyright (Python) Install servers via mason.nvim for easier management. ## Claude Code Integration The config includes `coder/claudecode.nvim` for Claude Code CLI integration: - `,ac` - Toggle Claude Code terminal - `,af` - Focus Claude Code - `,as` (visual mode) - Send selection to Claude Claude artifacts are hidden from nvim-tree (matching the josie-vsx VSCode extension): - `.claude` - `CLAUDE.md` - `.claude-plugin` ## Migration Notes The old config at `~/.config/nvim/init.vim` uses vim-plug. Key things to port: 1. Keymaps from init.vim lines 10-11, 48-92 2. Auto-trim whitespace on save (lines 113-118) 3. Vimwiki settings if still needed 4. Directory shortcuts from shortcuts.vim