Skip to content

Commit 7cb6157

Browse files
committed
docs: update README with newer diff view demonstration video
Change-Id: Ic526e5e56997fb81d748e68203756ad414c0e277 Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent f09d900 commit 7cb6157

File tree

11 files changed

+1663
-50
lines changed

11 files changed

+1663
-50
lines changed

Makefile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,13 @@ all: check format
66
# Check for syntax errors
77
check:
88
@echo "Checking Lua files for syntax errors..."
9-
@find lua -name "*.lua" -type f -exec lua -e "assert(loadfile('{}'))" \;
9+
nix develop .#ci -c find lua -name "*.lua" -type f -exec lua -e "assert(loadfile('{}'))" \;
1010
@echo "Running luacheck..."
11-
@luacheck lua/ tests/ --no-unused-args --no-max-line-length
11+
nix develop .#ci -c luacheck lua/ tests/ --no-unused-args --no-max-line-length
1212

1313
# Format all files
1414
format:
15-
@echo "Formatting files..."
16-
@if command -v nix >/dev/null 2>&1; then \
17-
nix fmt; \
18-
elif command -v stylua >/dev/null 2>&1; then \
19-
stylua lua/; \
20-
else \
21-
echo "Neither nix nor stylua found. Please install one of them."; \
22-
exit 1; \
23-
fi
15+
nix fmt
2416

2517
# Run tests
2618
test:

README.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> 🎯 **TL;DR:** When Anthropic released Claude Code with VS Code and JetBrains support, I reverse-engineered their extension and built this Neovim plugin. This plugin implements the same WebSocket-based MCP protocol, giving Neovim users the same AI-powered coding experience.
1010
11-
<https://github.com/user-attachments/assets/c625d855-5f32-4a1f-8757-1a3150e2786d>
11+
<https://github.com/user-attachments/assets/9c310fb5-5a23-482b-bedc-e21ae457a82d>
1212

1313
## What Makes This Special
1414

@@ -49,8 +49,15 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim):
4949
"coder/claudecode.nvim",
5050
config = true,
5151
keys = {
52+
{ "<leader>a", nil, desc = "AI/Claude Code" },
5253
{ "<leader>ac", "<cmd>ClaudeCode<cr>", desc = "Toggle Claude" },
5354
{ "<leader>as", "<cmd>ClaudeCodeSend<cr>", mode = "v", desc = "Send to Claude" },
55+
{
56+
"<leader>as",
57+
"<cmd>ClaudeCodeTreeAdd<cr>",
58+
desc = "Add file",
59+
ft = { "NvimTree", "neo-tree" },
60+
},
5461
},
5562
}
5663
```
@@ -60,13 +67,37 @@ That's it! For more configuration options, see [Advanced Setup](#advanced-setup)
6067
## Usage
6168

6269
1. **Launch Claude**: Run `:ClaudeCode` to open Claude in a split terminal
63-
2. **Send context**: Select text and run `:'<,'>ClaudeCodeSend` to send it to Claude
70+
2. **Send context**:
71+
- Select text in visual mode and use `<leader>as` to send it to Claude
72+
- In `nvim-tree` or `neo-tree`, press `<leader>as` on a file to add it to Claude's context
6473
3. **Let Claude work**: Claude can now:
6574
- See your current file and selections in real-time
6675
- Open files in your editor
6776
- Show diffs with proposed changes
6877
- Access diagnostics and workspace info
6978

79+
## Commands
80+
81+
- `:ClaudeCode` - Toggle the Claude Code terminal window
82+
- `:ClaudeCodeSend` - Send current visual selection to Claude, or add files from tree explorer
83+
- `:ClaudeCodeTreeAdd` - Add selected file(s) from tree explorer to Claude context (also available via ClaudeCodeSend)
84+
85+
### Tree Integration
86+
87+
The `<leader>as` keybinding has context-aware behavior:
88+
89+
- **In normal buffers (visual mode)**: Sends selected text to Claude
90+
- **In nvim-tree/neo-tree buffers**: Adds the file under cursor (or selected files) to Claude's context
91+
92+
This allows you to quickly add entire files to Claude's context for review, refactoring, or discussion.
93+
94+
#### Features
95+
96+
- **Single file**: Place cursor on any file and press `<leader>as`
97+
- **Multiple files**: Select multiple files (using tree plugin's selection features) and press `<leader>as`
98+
- **Smart detection**: Automatically detects whether you're in nvim-tree or neo-tree
99+
- **Error handling**: Clear feedback if no files are selected or if tree plugins aren't available
100+
70101
## How It Works
71102

72103
This plugin creates a WebSocket server that Claude Code CLI connects to, implementing the same protocol as the official VS Code extension. When you launch Claude, it automatically detects Neovim and gains full access to your editor.
@@ -132,8 +163,15 @@ See [DEVELOPMENT.md](./DEVELOPMENT.md) for build instructions and development gu
132163
},
133164
config = true,
134165
keys = {
166+
{ "<leader>a", nil, desc = "AI/Claude Code" },
135167
{ "<leader>ac", "<cmd>ClaudeCode<cr>", desc = "Toggle Claude" },
136168
{ "<leader>as", "<cmd>ClaudeCodeSend<cr>", mode = "v", desc = "Send to Claude" },
169+
{
170+
"<leader>as",
171+
"<cmd>ClaudeCodeTreeAdd<cr>",
172+
desc = "Add file",
173+
ft = { "NvimTree", "neo-tree" },
174+
},
137175
{ "<leader>ao", "<cmd>ClaudeCodeOpen<cr>", desc = "Open Claude" },
138176
{ "<leader>ax", "<cmd>ClaudeCodeClose<cr>", desc = "Close Claude" },
139177
},
@@ -150,7 +188,7 @@ See [DEVELOPMENT.md](./DEVELOPMENT.md) for build instructions and development gu
150188

151189
## License
152190

153-
MIT
191+
[MIT](LICENSE)
154192

155193
## Acknowledgements
156194

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
luajitPackages.luacov
4141
neovim
4242
treefmt.config.build.wrapper
43+
findutils
4344
];
4445

4546
# Development packages (additional tools for development)
@@ -49,7 +50,7 @@
4950
gnumake
5051
websocat
5152
jq
52-
claude-code
53+
# claude-code
5354
];
5455
in
5556
{

0 commit comments

Comments
 (0)