Skip to content

feat: add nvim-tree and neotree integration #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
Closed

Conversation

blink-so[bot]
Copy link
Contributor

@blink-so blink-so bot commented Jun 6, 2025

This pull request adds integration with nvim-tree and neotree, allowing users to add files to the claude-code input buffer directly from the file explorer.

@blink-so blink-so bot force-pushed the tree-integration branch 3 times, most recently from 99aae42 to 0461cdc Compare June 6, 2025 16:55
@blink-so blink-so bot force-pushed the tree-integration branch from 0461cdc to ea969b6 Compare June 6, 2025 16:57
@blink-so blink-so bot force-pushed the tree-integration branch from 25bc2ef to f1d913d Compare June 6, 2025 17:00
blink-so bot and others added 12 commits June 6, 2025 17:11
Remove mode restriction from <leader>a key group to make it available
in all modes instead of just n, v, NvimTree, and neo-tree modes.
- Revert ClaudeCodeSend to handle visual selections as originally intended
- Remove ClaudeCodeTreeAddFile and ClaudeCodeSendSelection commands
- Remove integrations.lua file
- Restore original keybinding configuration in README

Co-authored-by: ThomasK33 <[email protected]>
- Add integrations.lua module to handle nvim-tree and neo-tree file selection
- Add ClaudeCodeTreeAdd command to send file at_mentions from tree explorers
- Support both single file selection and multi-file selection
- Update README with tree integration documentation and lazy.nvim keybinding setup
- Implement context-aware <leader>as keybinding behavior

Co-authored-by: ThomasK33 <[email protected]>
- Format files with nix fmt as per project requirements
- All checks pass: nix fmt ✓, make check ✓, make test ✓

Co-authored-by: ThomasK33 <[email protected]>
- Change success notification from INFO to DEBUG to avoid popup
- User requested less verbose notifications for successful file additions
- Error notifications remain at ERROR level for visibility

Co-authored-by: ThomasK33 <[email protected]>
- Add tree buffer detection to ClaudeCodeSend command
- Delegate to tree integration when in nvim-tree or neo-tree buffers
- Fixes issue where visual selection in tree sent line ranges instead of files
- Now properly sends each selected file as individual at_mentions
- Simplify keybinding configuration - single command handles both contexts
- Update documentation to reflect enhanced functionality

Resolves multi-file selection issue in neotree/nvim-tree

Co-authored-by: ThomasK33 <[email protected]>
- Replace all vim.notify calls with appropriate logger.* calls for consistency
- Remove redundant notifications where logger already handles the logging
- Maintain unified logging throughout the project
- Better adherence to project's logging standards

Co-authored-by: ThomasK33 <[email protected]>
- Add debug logging to show actual filetype and buffer name during visual selection
- Improve tree buffer detection to include buffer name pattern matching
- This will help identify why tree detection isn't working in neotree visual mode

Co-authored-by: ThomasK33 <[email protected]>
- Remove redundant vim.notify call from ClaudeCodeTreeAdd
- Enhance neo-tree multi-selection detection with multiple fallback methods
- Add comprehensive debug logging to identify which selection method works
- Try get_selection(), is_selected nodes, and state.selected_nodes approaches
- Better error handling and debugging for neo-tree integration

Co-authored-by: ThomasK33 <[email protected]>
…lection

- Rewrite neo-tree selection detection to handle visual mode properly
- Map line numbers to nodes to get files from visual selection range
- Try multiple approaches: visual mode detection, get_selection, state.selected_nodes
- Add comprehensive debug logging to understand selection behavior
- Fix luacheck warning about unused variable

This should properly detect when multiple files are selected in neo-tree
using visual mode and send each file as a separate at_mention.

Co-authored-by: ThomasK33 <[email protected]>
- Add detailed debug logging to understand neo-tree node structure
- Log all nodes, their positions, types, and paths
- Show line-to-node mapping details
- Debug visual selection line mapping process
- This will help identify why line-to-node mapping isn't working

Co-authored-by: ThomasK33 <[email protected]>
- Use neo-tree's internal visual selection method
- Get visual selection range with getpos(<") and getpos("
@ThomasK33
Copy link
Member

you served well buddy, but not this time 😢

@ThomasK33 ThomasK33 closed this Jun 7, 2025
@ThomasK33 ThomasK33 deleted the tree-integration branch June 7, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant