Jump to content

Nvim: Difference between revisions

From Archive
Added Technical navigation
Expanded with Claude Code workflow documentation
Line 1: Line 1:
= Neovim =
= Neovim =
''LazyVim configuration for writing in the dark''
''LazyVim + Claude Code workflow for non-Cursor open source coding''


[https://github.com/ejfox/dotfiles/tree/master/.config/nvim|nvim dotfiles]
[https://github.com/ejfox/dotfiles/tree/master/.config/nvim nvim dotfiles]


== Overview ==
== Philosophy ==
Current setup uses LazyVim as a base, stripped down to essentials. Like everything else, optimized for solitary work at 3am.
Code manually in nvim (left pane) with subtle AI assistance, while Claude Code handles big refactors in a separate tmux pane (right). Robot edits files → nvim auto-reloads → review changes instantly.


== Plugin Stack ==
<pre>
=== Core ===
┌─────────────────┬─────────────────┐
* '''LazyVim''' - Base configuration, most defaults disabled
│ nvim (manual)  │ Claude Code    │
* '''init.lua''' - <code>require("config.lazy")</code> and nothing else
│ - Ghost text AI │ - Big refactors │
│ - Hot reload    │ - File edits    │
│ - Diffview      │ - Commits      │
└─────────────────┴─────────────────┘
</pre>


=== Visual ===
'''Why not Cursor?'''
* '''ayu.lua''' / '''ayu-toggle.lua''' - Dark theme that doesn't burn retinas at night
* Nvim muscle memory preserved
* '''auto-dark-mode.lua''' - Follows system, though it's always dark anyway
* Complete control over AI integration points
* '''twilight.lua''' - Dims inactive code like thoughts you're not ready to process
* No vendor lock-in
* '''zen-mode.lua''' - Full screen focus mode for when the world needs to disappear
* tmux + ssh workflow stays intact
* Works on remote servers (VPS) seamlessly


=== Minimal Interfaces ===
== Core Stack ==
* '''minimal-statusline.lua''' - Just enough info to know the file saved
 
* '''minimal-telescope.lua''' - Fuzzy finding without the fuzzy thinking 
=== Base ===
* '''minimal-git.lua''' - Git integration stripped to essentials
* '''LazyVim''' - Sane defaults, most disabled
* '''oil.nvim''' - Filesystem as a buffer (<code>-</code> to toggle)
* '''telescope''' - Fuzzy finding everything
* '''diffview''' - Git diff visualization
 
=== AI Integration ===
* '''copilot.lua''' - Ghost text (not popup completions)
* '''Claude Code''' - CLI for big refactors (separate terminal)
 
== Inline AI (Ghost Text) ==
''File: <code>~/.config/nvim/lua/plugins/copilot-inline.lua</code>''
 
Ghost text suggestions that feel natural:
 
{| class="wikitable"
|-
! Key !! Action
|-
| <code>Tab</code> || Accept full suggestion
|-
| <code>]s</code> / <code>[s</code> || Cycle through suggestions
|-
| <code>C-Right</code> || Accept one word
|-
| <code>C-l</code> || Accept one line
|-
| <code>C-]</code> || Dismiss
|}
 
'''Why inline > popup:''' No fighting with LSP completions. Ghost text for AI, completion menu for LSP.
 
== Hot Reload System ==
''Files: <code>directory-watcher.lua</code>, <code>hotreload.lua</code>''
 
When Claude Code edits files:
# Filesystem watcher detects change
# Nvim auto-reloads visible buffers (only if unmodified)
# Statusline shows green ⟳ for 5 seconds
# Never loses unsaved work
 
== Diffview Integration ==
''File: <code>git-diff-hotreload.lua</code>''
 
{| class="wikitable"
|-
! Key !! Action
|-
| <code><leader>gd</code> || Open diffview (review changes)
|-
| <code>]c</code> / <code>[c</code> || Jump between changes
|-
| <code>Tab</code> || Cycle through files
|-
| <code><leader>gc</code> || Close diffview
|}
 
== Yank With Context ==
Share code with Claude Code including file path:
 
* <code><leader>yr</code> → Yank with relative path
* <code><leader>ya</code> → Yank with absolute path
 
Output: <code>src/components/Button.tsx:15-23</code> + code block
 
== Statusline Indicators ==
* '''Red ●''' - Unsaved changes
* '''Green ⟳''' - Just reloaded by Claude Code (5 sec flash)
* '''Gray "AI"''' - Copilot attached
* '''Blue Δ''' - Diffview open
 
== CLI Aliases ==
<pre>
v    # Just nvim
n    # nvim . (open with oil.nvim)
vs    # Fuzzy find files with bat preview
vg    # Grep contents, fuzzy find, open file
o    # Obsidian vault fuzzy finder
r    # Recent files across ALL ~/code projects
</pre>
 
== Visual Plugins ==
* '''ayu''' - Dark theme that doesn't burn retinas
* '''twilight''' - Dims inactive code
* '''zen-mode''' - Full screen focus
 
== See Also ==
* [[Dotfiles]]
* [[CLI]]
* [[VPS]]


[[Category:Technical]]
[[Category:Technical]]

Revision as of 04:37, 15 January 2026

Neovim

LazyVim + Claude Code workflow for non-Cursor open source coding

nvim dotfiles

Philosophy

Code manually in nvim (left pane) with subtle AI assistance, while Claude Code handles big refactors in a separate tmux pane (right). Robot edits files → nvim auto-reloads → review changes instantly.

┌─────────────────┬─────────────────┐
│ nvim (manual)   │ Claude Code     │
│ - Ghost text AI │ - Big refactors │
│ - Hot reload    │ - File edits    │
│ - Diffview      │ - Commits       │
└─────────────────┴─────────────────┘

Why not Cursor?

  • Nvim muscle memory preserved
  • Complete control over AI integration points
  • No vendor lock-in
  • tmux + ssh workflow stays intact
  • Works on remote servers (VPS) seamlessly

Core Stack

Base

  • LazyVim - Sane defaults, most disabled
  • oil.nvim - Filesystem as a buffer (- to toggle)
  • telescope - Fuzzy finding everything
  • diffview - Git diff visualization

AI Integration

  • copilot.lua - Ghost text (not popup completions)
  • Claude Code - CLI for big refactors (separate terminal)

Inline AI (Ghost Text)

File: ~/.config/nvim/lua/plugins/copilot-inline.lua

Ghost text suggestions that feel natural:

Key Action
Tab Accept full suggestion
]s / [s Cycle through suggestions
C-Right Accept one word
C-l Accept one line
C-] Dismiss

Why inline > popup: No fighting with LSP completions. Ghost text for AI, completion menu for LSP.

Hot Reload System

Files: directory-watcher.lua, hotreload.lua

When Claude Code edits files:

  1. Filesystem watcher detects change
  2. Nvim auto-reloads visible buffers (only if unmodified)
  3. Statusline shows green ⟳ for 5 seconds
  4. Never loses unsaved work

Diffview Integration

File: git-diff-hotreload.lua

Key Action
<leader>gd Open diffview (review changes)
]c / [c Jump between changes
Tab Cycle through files
<leader>gc Close diffview

Yank With Context

Share code with Claude Code including file path:

  • <leader>yr → Yank with relative path
  • <leader>ya → Yank with absolute path

Output: src/components/Button.tsx:15-23 + code block

Statusline Indicators

  • Red ● - Unsaved changes
  • Green ⟳ - Just reloaded by Claude Code (5 sec flash)
  • Gray "AI" - Copilot attached
  • Blue Δ - Diffview open

CLI Aliases

v     # Just nvim
n     # nvim . (open with oil.nvim)
vs    # Fuzzy find files with bat preview
vg    # Grep contents, fuzzy find, open file
o     # Obsidian vault fuzzy finder
r     # Recent files across ALL ~/code projects

Visual Plugins

  • ayu - Dark theme that doesn't burn retinas
  • twilight - Dims inactive code
  • zen-mode - Full screen focus

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