feat: initial commit
- basic config according to spec
This commit is contained in:
commit
9b0446c5f6
36 files changed
+1114
No files matched your search
@@ -0,0 +1,87 @@
|
||||
-- snacks.nvim: only picker, lazygit, terminal and image are used.
|
||||
-- fff handles files and grep in the full profile; if its native library was
|
||||
-- not built (or in slim), those maps fall back to snacks.picker.
|
||||
local full = vim.g.profile == "full"
|
||||
|
||||
local fff_built
|
||||
local function use_fff()
|
||||
if fff_built == nil then
|
||||
fff_built = false
|
||||
local plugin = full and require("lazy.core.config").plugins["fff.nvim"]
|
||||
if plugin then
|
||||
local ext = jit.os == "OSX" and "dylib" or "so"
|
||||
fff_built = vim.uv.fs_stat(plugin.dir .. "/target/release/libfff_nvim." .. ext) ~= nil
|
||||
end
|
||||
end
|
||||
return fff_built
|
||||
end
|
||||
|
||||
local function files()
|
||||
if use_fff() then
|
||||
require("fff").find_files()
|
||||
else
|
||||
Snacks.picker.files()
|
||||
end
|
||||
end
|
||||
|
||||
local function grep()
|
||||
if use_fff() then
|
||||
require("fff").live_grep()
|
||||
else
|
||||
Snacks.picker.grep()
|
||||
end
|
||||
end
|
||||
|
||||
local keys = {
|
||||
{ "<leader>ff", files, desc = "Find files" },
|
||||
{ "<leader>fg", grep, desc = "Live grep" },
|
||||
{ "<leader>fw", function() Snacks.picker.grep_word() end, desc = "Grep word under cursor", mode = { "n", "x" } },
|
||||
{ "<leader>fb", function() Snacks.picker.buffers() end, desc = "Buffers" },
|
||||
{ "<leader>fh", function() Snacks.picker.help() end, desc = "Help" },
|
||||
{ "<leader>fk", function() Snacks.picker.keymaps() end, desc = "Keymaps" },
|
||||
{ "<leader>fd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" },
|
||||
{ "<C-/>", function() Snacks.terminal.toggle(nil, { win = { position = "float" } }) end, desc = "Toggle terminal", mode = { "n", "t" } },
|
||||
{ "<C-_>", function() Snacks.terminal.toggle(nil, { win = { position = "float" } }) end, desc = "which_key_ignore", mode = { "n", "t" } },
|
||||
}
|
||||
if full then
|
||||
table.insert(keys, { "<leader>fs", function() Snacks.picker.lsp_workspace_symbols() end, desc = "Workspace symbols" })
|
||||
end
|
||||
if vim.fn.executable("lazygit") == 1 then
|
||||
table.insert(keys, { "<leader>gg", function() Snacks.lazygit() end, desc = "Lazygit" })
|
||||
end
|
||||
|
||||
local picker = {}
|
||||
if full then
|
||||
-- <a-a> sends selected files or grep hits to the running agent.
|
||||
picker = {
|
||||
actions = {
|
||||
sidekick_send = function(...)
|
||||
return require("sidekick.cli.picker.snacks").send(...)
|
||||
end,
|
||||
},
|
||||
win = { input = { keys = { ["<a-a>"] = { "sidekick_send", mode = { "n", "i" } } } } },
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
keys = keys,
|
||||
opts = {
|
||||
picker = picker,
|
||||
lazygit = {},
|
||||
terminal = {},
|
||||
image = { enabled = full },
|
||||
},
|
||||
},
|
||||
{
|
||||
"dmtrKovalenko/fff.nvim",
|
||||
cond = full,
|
||||
lazy = true,
|
||||
-- Only the Lua library; the workspace also has bins that fail to link.
|
||||
build = "cargo build --release -p fff-nvim --lib",
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user