You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{ "<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
+
},
54
61
},
55
62
}
56
63
```
@@ -60,13 +67,37 @@ That's it! For more configuration options, see [Advanced Setup](#advanced-setup)
60
67
## Usage
61
68
62
69
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
64
73
3.**Let Claude work**: Claude can now:
65
74
- See your current file and selections in real-time
66
75
- Open files in your editor
67
76
- Show diffs with proposed changes
68
77
- Access diagnostics and workspace info
69
78
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
+
70
101
## How It Works
71
102
72
103
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
0 commit comments