-
Notifications
You must be signed in to change notification settings - Fork 63
feat: support send-to-claude for snacks.explorer
#68
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
Open
andresthor
wants to merge
7
commits into
coder:main
Choose a base branch
from
andresthor:feat/support-send-for-snacks-explorer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
00aa785
feat(integrations): add snacks.explorer file explorer support (file-s…
andresthor fdce068
feat(integrations): add visual mode multi-file selection for snacks.e…
andresthor addff9e
docs: add snacks.explorer to supported file explorers
andresthor 0e1c8b7
test(integrations): expand on testing for snacks.explorer
andresthor 6fd3196
fix: resolve test failures for snacks.explorer integration
andresthor 9abf142
Merge branch 'main' into feat/support-send-for-snacks-explorer
ThomasK33 b1b97c3
feat: add snacks-explorer fixture configuration
ThomasK33 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require("config.lazy") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, | ||
"mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" }, | ||
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, | ||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
-- Bootstrap lazy.nvim | ||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | ||
if not (vim.uv or vim.loop).fs_stat(lazypath) then | ||
local lazyrepo = "https://github.com/folke/lazy.nvim.git" | ||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) | ||
if vim.v.shell_error ~= 0 then | ||
vim.api.nvim_echo({ | ||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" }, | ||
{ out, "WarningMsg" }, | ||
{ "\nPress any key to exit..." }, | ||
}, true, {}) | ||
vim.fn.getchar() | ||
os.exit(1) | ||
end | ||
end | ||
vim.opt.rtp:prepend(lazypath) | ||
|
||
-- Make sure to setup `mapleader` and `maplocalleader` before | ||
-- loading lazy.nvim so that mappings are correct. | ||
-- This is also a good place to setup other settings (vim.opt) | ||
vim.g.mapleader = " " | ||
vim.g.maplocalleader = "\\" | ||
|
||
-- Setup lazy.nvim | ||
require("lazy").setup({ | ||
spec = { | ||
-- import your plugins | ||
{ import = "plugins" }, | ||
}, | ||
-- Configure any other settings here. See the documentation for more details. | ||
-- colorscheme that will be used when installing plugins. | ||
install = { colorscheme = { "habamax" } }, | ||
-- automatically check for plugin updates | ||
checker = { enabled = true }, | ||
}) | ||
|
||
-- Add keybind for Lazy plugin manager | ||
vim.keymap.set("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy Plugin Manager" }) | ||
|
||
-- Terminal keybindings | ||
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode (double esc)" }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../dev-config.lua |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
return { | ||
-- Essential plugins for basic functionality | ||
{ | ||
"folke/which-key.nvim", | ||
event = "VeryLazy", | ||
opts = {}, | ||
keys = { | ||
{ | ||
"<leader>?", | ||
function() | ||
require("which-key").show({ global = false }) | ||
end, | ||
desc = "Buffer Local Keymaps (which-key)", | ||
}, | ||
}, | ||
}, | ||
|
||
-- Icon support for file explorers | ||
{ | ||
"echasnovski/mini.icons", | ||
opts = {}, | ||
lazy = true, | ||
specs = { | ||
{ "nvim-tree/nvim-web-devicons", enabled = false, optional = true }, | ||
}, | ||
init = function() | ||
package.preload["nvim-web-devicons"] = function() | ||
require("mini.icons").mock_nvim_web_devicons() | ||
return package.loaded["nvim-web-devicons"] | ||
end | ||
end, | ||
}, | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
return { | ||
"folke/snacks.nvim", | ||
priority = 1000, | ||
lazy = false, | ||
opts = { | ||
-- Enable the explorer module | ||
explorer = { | ||
enabled = true, | ||
replace_netrw = true, -- Replace netrw with snacks explorer | ||
}, | ||
-- Enable other useful modules for testing | ||
bigfile = { enabled = true }, | ||
notifier = { enabled = true }, | ||
quickfile = { enabled = true }, | ||
statuscolumn = { enabled = true }, | ||
words = { enabled = true }, | ||
}, | ||
keys = { | ||
-- Main explorer keybindings | ||
{ | ||
"<leader>e", | ||
function() | ||
require("snacks").explorer() | ||
end, | ||
desc = "Explorer", | ||
}, | ||
{ | ||
"<leader>E", | ||
function() | ||
require("snacks").explorer.open() | ||
end, | ||
desc = "Explorer (open)", | ||
}, | ||
{ | ||
"<leader>fe", | ||
function() | ||
require("snacks").explorer.reveal() | ||
end, | ||
desc = "Explorer (reveal current file)", | ||
}, | ||
|
||
-- Alternative keybindings for testing | ||
{ | ||
"-", | ||
function() | ||
require("snacks").explorer() | ||
end, | ||
desc = "Open parent directory", | ||
}, | ||
{ | ||
"<C-n>", | ||
function() | ||
require("snacks").explorer() | ||
end, | ||
desc = "File Explorer", | ||
}, | ||
|
||
-- Snacks utility keybindings for testing | ||
{ | ||
"<leader>un", | ||
function() | ||
require("snacks").notifier.dismiss() | ||
end, | ||
desc = "Dismiss All Notifications", | ||
}, | ||
{ | ||
"<leader>bd", | ||
function() | ||
require("snacks").bufdelete() | ||
end, | ||
desc = "Delete Buffer", | ||
}, | ||
{ | ||
"<leader>gg", | ||
function() | ||
require("snacks").lazygit() | ||
end, | ||
desc = "Lazygit", | ||
}, | ||
{ | ||
"<leader>gb", | ||
function() | ||
require("snacks").git.blame_line() | ||
end, | ||
desc = "Git Blame Line", | ||
}, | ||
{ | ||
"<leader>gB", | ||
function() | ||
require("snacks").gitbrowse() | ||
end, | ||
desc = "Git Browse", | ||
}, | ||
{ | ||
"<leader>gf", | ||
function() | ||
require("snacks").lazygit.log_file() | ||
end, | ||
desc = "Lazygit Current File History", | ||
}, | ||
{ | ||
"<leader>gl", | ||
function() | ||
require("snacks").lazygit.log() | ||
end, | ||
desc = "Lazygit Log (cwd)", | ||
}, | ||
{ | ||
"<leader>cR", | ||
function() | ||
require("snacks").rename.rename_file() | ||
end, | ||
desc = "Rename File", | ||
}, | ||
{ | ||
"<c-/>", | ||
function() | ||
require("snacks").terminal() | ||
end, | ||
desc = "Toggle Terminal", | ||
}, | ||
{ | ||
"<c-_>", | ||
function() | ||
require("snacks").terminal() | ||
end, | ||
desc = "which_key_ignore", | ||
}, | ||
}, | ||
init = function() | ||
vim.api.nvim_create_autocmd("User", { | ||
pattern = "VeryLazy", | ||
callback = function() | ||
-- Setup some globals for easier testing | ||
_G.Snacks = require("snacks") | ||
_G.lazygit = _G.Snacks.lazygit | ||
_G.explorer = _G.Snacks.explorer | ||
end, | ||
}) | ||
end, | ||
config = function(_, opts) | ||
require("snacks").setup(opts) | ||
|
||
-- Additional explorer-specific keybindings that activate after setup | ||
vim.api.nvim_create_autocmd("FileType", { | ||
pattern = "snacks_picker_list", -- This is the filetype for snacks explorer | ||
callback = function(event) | ||
local buf = event.buf | ||
-- Custom keybindings specifically for snacks explorer buffers | ||
vim.keymap.set("n", "<C-v>", function() | ||
-- Toggle visual mode for multi-selection (this is what the PR adds support for) | ||
vim.cmd("normal! V") | ||
end, { buffer = buf, desc = "Toggle visual selection" }) | ||
|
||
vim.keymap.set("n", "v", function() | ||
vim.cmd("normal! v") | ||
end, { buffer = buf, desc = "Visual mode" }) | ||
|
||
vim.keymap.set("n", "V", function() | ||
vim.cmd("normal! V") | ||
end, { buffer = buf, desc = "Visual line mode" }) | ||
|
||
-- Additional testing keybindings | ||
vim.keymap.set("n", "?", function() | ||
require("which-key").show({ buffer = buf }) | ||
end, { buffer = buf, desc = "Show keybindings" }) | ||
end, | ||
}) | ||
|
||
-- Set up some helpful defaults for testing | ||
vim.opt.number = true | ||
vim.opt.relativenumber = true | ||
vim.opt.signcolumn = "yes" | ||
vim.opt.wrap = false | ||
|
||
-- Print helpful message when starting | ||
vim.defer_fn(function() | ||
print("🍿 Snacks Explorer fixture loaded!") | ||
print("Press <leader>e to open explorer, <leader>? for help") | ||
print("Use visual modes (v/V/<C-v>) in explorer for multi-file selection") | ||
end, 500) | ||
end, | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, but this comment doesn't add any context here.