Nvim: Difference between revisions
Appearance
Added Technical navigation |
Expanded with Claude Code workflow documentation |
||
| Line 1: | Line 1: | ||
= Neovim = | = Neovim = | ||
''LazyVim | ''LazyVim + Claude Code workflow for non-Cursor open source coding'' | ||
[https://github.com/ejfox/dotfiles/tree/master/.config/nvim | [https://github.com/ejfox/dotfiles/tree/master/.config/nvim 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. | |||
<pre> | |||
┌─────────────────┬─────────────────┐ | |||
│ nvim (manual) │ Claude Code │ | |||
│ - Ghost text AI │ - Big refactors │ | |||
│ - Hot reload │ - File edits │ | |||
│ - Diffview │ - Commits │ | |||
└─────────────────┴─────────────────┘ | |||
</pre> | |||
'''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 (<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
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:
- 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: 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 |