Skip to content

Commit addff9e

Browse files
committed
docs: add snacks.explorer to supported file explorers
1 parent fdce068 commit addff9e

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

β€ŽARCHITECTURE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,33 @@ vim.api.nvim_create_autocmd("VimLeavePre", {
184184
})
185185
```
186186

187+
### 7. File Explorer Integrations (`integrations.lua`)
188+
189+
Unified interface for popular file explorers:
190+
191+
```lua
192+
-- Supports nvim-tree, neo-tree, oil.nvim, and snacks.explorer
193+
function M.get_selected_files_from_tree()
194+
local current_ft = vim.bo.filetype
195+
196+
if current_ft == "NvimTree" then
197+
return M._get_nvim_tree_selection()
198+
elseif current_ft == "neo-tree" then
199+
return M._get_neotree_selection()
200+
elseif current_ft == "oil" then
201+
return M._get_oil_selection()
202+
elseif current_ft == "snacks_picker_list" then
203+
return M._get_snacks_explorer_selection()
204+
end
205+
end
206+
```
207+
208+
Key features across all integrations:
209+
- **Visual mode support**: Select multiple files using vim visual mode
210+
- **Security protection**: Filters out root-level files (`/etc/passwd`, `/usr/bin/vim`)
211+
- **Directory handling**: Adds trailing slashes to directories for consistency
212+
- **Fallback behavior**: Selected items β†’ current item β†’ error
213+
187214
## Module Structure
188215

189216
```
@@ -197,6 +224,8 @@ lua/claudecode/
197224
β”‚ β”œβ”€β”€ client.lua # Connection management
198225
β”‚ └── utils.lua # Pure Lua SHA-1, base64
199226
β”œβ”€β”€ tools/init.lua # MCP tool registry
227+
β”œβ”€β”€ integrations.lua # File explorer integrations
228+
β”œβ”€β”€ visual_commands.lua # Visual mode handling
200229
β”œβ”€β”€ diff.lua # Native diff support
201230
β”œβ”€β”€ selection.lua # Selection tracking
202231
β”œβ”€β”€ terminal.lua # Terminal management

β€ŽREADME.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ When Anthropic released Claude Code, they only supported VS Code and JetBrains.
4444
"<leader>as",
4545
"<cmd>ClaudeCodeTreeAdd<cr>",
4646
desc = "Add file",
47-
ft = { "NvimTree", "neo-tree", "oil" },
47+
ft = { "NvimTree", "neo-tree", "oil", "snacks_picker_list" },
4848
},
4949
-- Diff management
5050
{ "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", desc = "Accept diff" },
@@ -80,7 +80,7 @@ That's it! The plugin will auto-configure everything else.
8080
1. **Launch Claude**: Run `:ClaudeCode` to open Claude in a split terminal
8181
2. **Send context**:
8282
- Select text in visual mode and use `<leader>as` to send it to Claude
83-
- In `nvim-tree`/`neo-tree`/`oil.nvim`, press `<leader>as` on a file to add it to Claude's context
83+
- In `nvim-tree`/`neo-tree`/`oil.nvim`/`snacks.explorer`, press `<leader>as` on a file to add it to Claude's context
8484
3. **Let Claude work**: Claude can now:
8585
- See your current file and selections in real-time
8686
- Open files in your editor

0 commit comments

Comments
Β (0)