Jump to content

Neovim: Difference between revisions

From Archive
Create comprehensive Neovim page - LazyVim minimalist setup with AI integration
 
FIX: Restore actual Neovim content
 
Line 1: Line 1:
/tmp/neovim.wiki
= 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:''' <code>~/.config/nvim/</code>
 
== Core Design ==
 
=== Visual Philosophy ===
* No visible mode indicator (trained muscle memory)
* Minimal statusline: <code>path/to/file.ts 142L AI</code>
* Geometric symbols for state (◆ modified, ◇ readonly)
* Auto light/dark via system preference
 
=== Statusline ===
'''Location:''' <code>lua/plugins/minimal-statusline.lua</code>
 
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 ===
 
# '''Copilot''' — Inline ghost text for line-level suggestions
#* Tab to accept, Alt-] to cycle
#* No popup menus, old school ghost text
# '''Avante''' — Claude Sonnet 4 chat in sidebar
#* <code><leader>aa</code> — Ask about code
#* <code><leader>ae</code> — Edit/refactor selection
# '''Claude Code''' — Full agent in tmux pane
#* Hot reload integration
#* Diffview for reviewing changes
 
=== Claude Code Workflow ===
'''Location:''' <code>lua/plugins/claude-code-workflow.lua</code>
 
'''Hot Reload:'''
* Filesystem watcher using native <code>fs_event</code> API
* Auto-reloads when Claude Code saves files
* Won't reload if you have unsaved changes
 
'''Diffview Integration:'''
* <code><leader>gd</code> — Open git diff view
* <code>]c</code> / <code>[c</code> — Jump between changes
* Auto-refreshes when Claude commits
 
'''Copy with Path:'''
* <code><leader>yr</code> — Yank selection with relative path
* <code><leader>ya</code> — Yank with absolute path
* Outputs: <code>src/file.ts:42-55</code> with fenced code
 
== Essential Plugins ==
 
=== Navigation ===
 
'''Oil.nvim''' — Filesystem as a buffer
<pre>
-        Open parent directory
<CR>    Open file/directory
g.      Toggle hidden files
</pre>
 
'''Harpoon''' — Quick access to 4 marked files
<pre>
<leader>ha    Add file to harpoon
<leader>hh    Toggle harpoon menu
<leader>h1-4  Jump to file 1-4
</pre>
 
'''Flash.nvim''' — Enhanced motions
<pre>
f/F    Jump to character
s      Multi-char search with labels
</pre>
 
'''vim-tmux-navigator''' — Seamless pane/window navigation
<pre>
Ctrl-h/j/k/l    Move between nvim splits AND tmux panes
</pre>
 
=== Editing ===
 
'''nvim-surround''' — Surround text objects
<pre>
ysiw"    Wrap word in quotes
cs"'    Change " to '
ds"      Delete surrounding quotes
</pre>
 
'''Dial.nvim''' — Smart increment/decrement
<pre>
<C-a> on true  → false
<C-a> on 1    → 2
<C-a> on date  → next date
</pre>
 
=== Focus ===
 
'''Zen-mode''' — Distraction-free writing
<pre>
:ZenMode    120 char width, 95% backdrop
</pre>
 
'''Twilight''' — Dim inactive code blocks
 
=== Git ===
 
'''Gitsigns''' — Minimal change indicators in sign column
<pre>
│    Added line
┆    Untracked
_    Deleted
</pre>
 
'''Git-conflict''' — Visual merge conflict handling
<pre>
co    Choose ours
ct    Choose theirs
cb    Choose both
[x/]x Jump between conflicts
</pre>
 
'''Diffview''' — Side-by-side diffs
 
=== HTTP ===
 
'''Kulala.nvim''' — HTTP client in buffer
<pre>
<CR>      Execute request under cursor
[r / ]r  Jump between requests
<leader>rc Copy as cURL
</pre>
 
=== Debugging ===
 
'''nvim-dap''' — Debug adapter protocol
<pre>
<leader>db    Toggle breakpoint
<leader>dc    Start/continue
<leader>di    Step into
<leader>do    Step over
</pre>
 
== Theme System ==
 
=== Vulpes Reddish ===
'''Location:''' <code>colors/vulpes_reddish_dark.lua</code>, <code>colors/vulpes_reddish_light.lua</code>
 
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:''' <code>lua/plugins/auto-dark-mode.lua</code>
 
Monitors system preference every 1 second. Seamless switching.
 
== Training Mode ==
 
=== Hardtime ===
'''Location:''' <code>lua/plugins/hardtime.lua</code>
 
Khabib-style vim motion coaching:
* Blocks hjkl spam after 1 press
* Arrow keys completely disabled
* Custom hints for better motions
 
<pre>
"Brother, use '}' for paragraph, ']f' for function,
']d' for diagnostic, '/' for search. This is Dagestani way."
</pre>
 
== Dashboard ==
 
'''Location:''' <code>lua/plugins/snacks.lua</code>
 
Minimal startup screen with fox emoji and quick actions:
* Find File, New File, Recent Files
* Find Text, Config, Restore Session
 
== Keybinding Philosophy ==
 
=== Leader Groups ===
* <code><leader>f*</code> — Telescope find commands
* <code><leader>h*</code> — Harpoon quick files
* <code><leader>a*</code> — Avante AI commands
* <code><leader>g*</code> — Git commands
* <code><leader>y*</code> — Yank with context
 
=== Motion Philosophy ===
* Prefer semantic motions (<code>]f</code> next function, <code>]d</code> next diagnostic)
* Use <code>/</code> 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 ==
 
<pre>
~/.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
</pre>
 
== Installation ==
 
<pre>
# Backup existing config
mv ~/.config/nvim ~/.config/nvim.backup
 
# Clone
git clone https://github.com/ejfox/nvim ~/.config/nvim
 
# Launch (plugins install automatically)
nvim
</pre>
 
== See Also ==
 
* [[Dotfiles]] — Full configuration overview
* [[Vulpes Shader System]] — Ghostty visual effects
* [[Tmux]] — Terminal multiplexer config
* [[Lazygit]] — Git TUI
 
----
[[Category:Technical Systems]]
[[Category:Development]]
 
{{Navbox Technical}}

Latest revision as of 00:29, 8 December 2025

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