Jump to content

Neovim

From Archive
Revision as of 00:29, 8 December 2025 by Claude (talk | contribs) (FIX: Restore actual Neovim content)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Neovim

Minimalist LazyVim configuration optimized for AI-enhanced workflows.

Overview

Base: LazyVim 4 + Neovim 0.11+

Philosophy: Functional minimalism. No chrome, no distractions. Theme-agnostic design that works in light or dark mode.

Location: ~/.config/nvim/

Core Design

Visual Philosophy

  • No visible mode indicator (trained muscle memory)
  • Minimal statusline: path/to/file.ts 142L AI
  • Geometric symbols for state (◆ modified, ◇ readonly)
  • Auto light/dark via system preference

Statusline

Location: lua/plugins/minimal-statusline.lua

Shows only essential info:

  • Context path (2 parent dirs + filename)
  • Line count
  • Diagnostics (error/warn/hint counts)
  • LSP icons (󰛦 TypeScript, 󰡄 Vue, etc)
  • Hot reload indicator (⟳)
  • Copilot status (AI)

AI Integration

Three-Layer AI System

  1. Copilot — Inline ghost text for line-level suggestions
    • Tab to accept, Alt-] to cycle
    • No popup menus, old school ghost text
  2. Avante — Claude Sonnet 4 chat in sidebar
    • <leader>aa — Ask about code
    • <leader>ae — Edit/refactor selection
  3. Claude Code — Full agent in tmux pane
    • Hot reload integration
    • Diffview for reviewing changes

Claude Code Workflow

Location: lua/plugins/claude-code-workflow.lua

Hot Reload:

  • Filesystem watcher using native fs_event API
  • Auto-reloads when Claude Code saves files
  • Won't reload if you have unsaved changes

Diffview Integration:

  • <leader>gd — Open git diff view
  • ]c / [c — Jump between changes
  • Auto-refreshes when Claude commits

Copy with Path:

  • <leader>yr — Yank selection with relative path
  • <leader>ya — Yank with absolute path
  • Outputs: src/file.ts:42-55 with fenced code

Essential Plugins

Navigation

Oil.nvim — Filesystem as a buffer

-        Open parent directory
<CR>     Open file/directory
g.       Toggle hidden files

Harpoon — Quick access to 4 marked files

<leader>ha    Add file to harpoon
<leader>hh    Toggle harpoon menu
<leader>h1-4  Jump to file 1-4

Flash.nvim — Enhanced motions

f/F    Jump to character
s      Multi-char search with labels

vim-tmux-navigator — Seamless pane/window navigation

Ctrl-h/j/k/l    Move between nvim splits AND tmux panes

Editing

nvim-surround — Surround text objects

ysiw"    Wrap word in quotes
cs"'     Change " to '
ds"      Delete surrounding quotes

Dial.nvim — Smart increment/decrement

<C-a> on true  → false
<C-a> on 1     → 2
<C-a> on date  → next date

Focus

Zen-mode — Distraction-free writing

:ZenMode    120 char width, 95% backdrop

Twilight — Dim inactive code blocks

Git

Gitsigns — Minimal change indicators in sign column

│    Added line
┆    Untracked
_    Deleted

Git-conflict — Visual merge conflict handling

co    Choose ours
ct    Choose theirs
cb    Choose both
[x/]x Jump between conflicts

Diffview — Side-by-side diffs

HTTP

Kulala.nvim — HTTP client in buffer

<CR>      Execute request under cursor
[r / ]r   Jump between requests
<leader>rc Copy as cURL

Debugging

nvim-dap — Debug adapter protocol

<leader>db    Toggle breakpoint
<leader>dc    Start/continue
<leader>di    Step into
<leader>do    Step over

Theme System

Vulpes Reddish

Location: colors/vulpes_reddish_dark.lua, colors/vulpes_reddish_light.lua

Custom warm theme with:

  • Dark: Warm reds on #121212 background
  • Light: Deep reds on #ebebeb background
  • Full treesitter + LSP + UI support
  • Matches Ghostty, tmux, lazygit, yazi

Auto Dark Mode

Location: lua/plugins/auto-dark-mode.lua

Monitors system preference every 1 second. Seamless switching.

Training Mode

Hardtime

Location: lua/plugins/hardtime.lua

Khabib-style vim motion coaching:

  • Blocks hjkl spam after 1 press
  • Arrow keys completely disabled
  • Custom hints for better motions
"Brother, use '}' for paragraph, ']f' for function,
']d' for diagnostic, '/' for search. This is Dagestani way."

Dashboard

Location: lua/plugins/snacks.lua

Minimal startup screen with fox emoji and quick actions:

  • Find File, New File, Recent Files
  • Find Text, Config, Restore Session

Keybinding Philosophy

Leader Groups

  • <leader>f* — Telescope find commands
  • <leader>h* — Harpoon quick files
  • <leader>a* — Avante AI commands
  • <leader>g* — Git commands
  • <leader>y* — Yank with context

Motion Philosophy

  • Prefer semantic motions (]f next function, ]d next diagnostic)
  • Use / search for distant jumps
  • Flash labels for mid-range jumps
  • hjkl only for fine adjustment

Performance

  • 45+ plugins, all lazy-loaded
  • Startup: < 100ms
  • Idle memory: ~50MB
  • Treesitter parsing: on-demand

File Structure

~/.config/nvim/
├── init.lua                 # Entry point
├── lazy-lock.json           # Plugin versions
├── colors/                  # Vulpes themes
├── lua/
│   ├── config/             # LazyVim config
│   ├── plugins/            # Plugin specs
│   │   ├── minimal-statusline.lua
│   │   ├── claude-code-workflow.lua
│   │   ├── copilot-inline.lua
│   │   ├── oil.lua
│   │   ├── harpoon.lua
│   │   ├── avante.lua
│   │   └── ...
│   └── custom/             # Custom modules
│       ├── hotreload.lua
│       └── directory-watcher.lua
└── PLUGINS.md              # Full plugin docs

Installation

# Backup existing config
mv ~/.config/nvim ~/.config/nvim.backup

# Clone
git clone https://github.com/ejfox/nvim ~/.config/nvim

# Launch (plugins install automatically)
nvim

See Also



Technical
Core Technical · CLI · Dotfiles · Nvim · SSH · VPS
Tools Sketchybar · ArchiveBox · ThinkPad Linux
Systems Automation · Personal APIs · Quantified Self
Reference Runbooks · New Computer Runbook · Syntax guide