refactor(plugins): Update keybindings and remove Claude Code references
This commit is contained in:
1 parent
2683601999
commit
0e59d020a6
3 files changed
+93
-117
No files matched your search
+16
-11
@@ -155,7 +155,14 @@ return {
|
|||||||
},
|
},
|
||||||
["L"] = { "<Cmd>BufferLineCycleNext<CR>", desc = "Next buffer" },
|
["L"] = { "<Cmd>BufferLineCycleNext<CR>", desc = "Next buffer" },
|
||||||
["H"] = { "<Cmd>BufferLineCyclePrev<CR>", desc = "Previous buffer" },
|
["H"] = { "<Cmd>BufferLineCyclePrev<CR>", desc = "Previous buffer" },
|
||||||
["<C-e>"] = { "<Cmd>Neotree toggle reveal<CR>", desc = "Open Explorer (reveal current file)" },
|
["<C-e>"] = {
|
||||||
|
function() require("snacks").picker.git_files { transform = file_filter } end,
|
||||||
|
desc = "Find git files",
|
||||||
|
},
|
||||||
|
["<Leader>e"] = {
|
||||||
|
function() require("snacks").picker.files { transform = file_filter } end,
|
||||||
|
desc = "Find files (cwd)",
|
||||||
|
},
|
||||||
["<leader><leader>"] = {
|
["<leader><leader>"] = {
|
||||||
function() require("snacks").picker.smart() end,
|
function() require("snacks").picker.smart() end,
|
||||||
desc = "Find files",
|
desc = "Find files",
|
||||||
@@ -248,8 +255,6 @@ return {
|
|||||||
end,
|
end,
|
||||||
desc = "Find AI files",
|
desc = "Find AI files",
|
||||||
},
|
},
|
||||||
["<C-f>p"] = { desc = "Find Package files" },
|
|
||||||
["<C-f>m"] = { desc = "Find Module files" },
|
|
||||||
["<C-f>g"] = { desc = "Find by Group" },
|
["<C-f>g"] = { desc = "Find by Group" },
|
||||||
["<C-f>gw"] = {
|
["<C-f>gw"] = {
|
||||||
function()
|
function()
|
||||||
@@ -294,8 +299,6 @@ return {
|
|||||||
desc = "Paste from system clipboard",
|
desc = "Paste from system clipboard",
|
||||||
},
|
},
|
||||||
["<C-j><C-j>"] = { function() terminals.scratch_toggle() end, desc = "Open Scratch Terminal" },
|
["<C-j><C-j>"] = { function() terminals.scratch_toggle() end, desc = "Open Scratch Terminal" },
|
||||||
["<C-a>f"] = { "<Cmd>ClaudeCodeFocus<CR>", desc = "Toggle Claude Code" },
|
|
||||||
["<C-m>"] = { "<Cmd>OverseerRun<CR>", desc = "Run Overseer task" },
|
|
||||||
["<C-a>d"] = {
|
["<C-a>d"] = {
|
||||||
function() with_trouble("diagnostics") end,
|
function() with_trouble("diagnostics") end,
|
||||||
desc = "Search diagnostics (<C-t> sends to Trouble)",
|
desc = "Search diagnostics (<C-t> sends to Trouble)",
|
||||||
@@ -313,8 +316,6 @@ return {
|
|||||||
desc = "Search LSP workspace symbols (<C-t> sends to Trouble)",
|
desc = "Search LSP workspace symbols (<C-t> sends to Trouble)",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<leader>L"] = { "<Cmd>Leet<CR>", desc = "Open LeetCode" },
|
|
||||||
|
|
||||||
["<leader>u"] = { desc = "UI Toggles" },
|
["<leader>u"] = { desc = "UI Toggles" },
|
||||||
["<leader>ud"] = {
|
["<leader>ud"] = {
|
||||||
function() require("snacks").toggle.diagnostics():toggle() end,
|
function() require("snacks").toggle.diagnostics():toggle() end,
|
||||||
@@ -404,10 +405,12 @@ return {
|
|||||||
["<C-x>"] = { "<Cmd>wa<CR><Cmd>bd<CR><Esc>", desc = "Save, close buffer, and return to normal mode" },
|
["<C-x>"] = { "<Cmd>wa<CR><Cmd>bd<CR><Esc>", desc = "Save, close buffer, and return to normal mode" },
|
||||||
},
|
},
|
||||||
v = {
|
v = {
|
||||||
["<C-e>"] = { "<Cmd>Neotree toggle reveal<CR>", desc = "Open Explorer (reveal current file)" },
|
["<C-e>"] = {
|
||||||
|
function() require("snacks").picker.git_files { transform = file_filter } end,
|
||||||
|
desc = "Find git files",
|
||||||
|
},
|
||||||
["<C-c>"] = { "<Cmd>w<CR><Cmd>bd<CR>", desc = "Save and close buffer" },
|
["<C-c>"] = { "<Cmd>w<CR><Cmd>bd<CR>", desc = "Save and close buffer" },
|
||||||
["<C-x>"] = { "<Cmd>w<CR><Cmd>bd<CR>", desc = "Save and close buffer" },
|
["<C-x>"] = { "<Cmd>w<CR><Cmd>bd<CR>", desc = "Save and close buffer" },
|
||||||
["<C-a><C-a>"] = { "<Cmd>ClaudeCodeSend<CR>", desc = "Send selection to Claude Code" },
|
|
||||||
["D"] = {
|
["D"] = {
|
||||||
function()
|
function()
|
||||||
vim.cmd 'normal! "vy'
|
vim.cmd 'normal! "vy'
|
||||||
@@ -438,8 +441,10 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
t = {
|
t = {
|
||||||
["<C-a><C-a>"] = { "<Cmd>ClaudeCodeFocus<CR>", desc = "Toggle Claude Code" },
|
["<C-e>"] = {
|
||||||
["<C-e>"] = { "<Cmd>Neotree toggle reveal<CR>", desc = "Open Explorer (reveal current file)" },
|
function() require("snacks").picker.git_files { transform = file_filter } end,
|
||||||
|
desc = "Find git files",
|
||||||
|
},
|
||||||
["<C-p>"] = { function() vim.cmd 'normal! "+p' end, desc = "Paste from system clipboard" },
|
["<C-p>"] = { function() vim.cmd 'normal! "+p' end, desc = "Paste from system clipboard" },
|
||||||
["<C-b>f"] = {
|
["<C-b>f"] = {
|
||||||
function() require("snacks").picker.buffers() end,
|
function() require("snacks").picker.buffers() end,
|
||||||
|
|||||||
@@ -57,8 +57,6 @@ return {
|
|||||||
["<c-x>"] = "clear_filter",
|
["<c-x>"] = "clear_filter",
|
||||||
["<CR>"] = "open_and_close_neotree",
|
["<CR>"] = "open_and_close_neotree",
|
||||||
["<S-CR>"] = "open",
|
["<S-CR>"] = "open",
|
||||||
-- Claude Code: add file under cursor to context
|
|
||||||
["<C-a>"] = function() vim.cmd "ClaudeCodeTreeAdd" end,
|
|
||||||
-- Preview image under cursor via kitty's icat kitten
|
-- Preview image under cursor via kitty's icat kitten
|
||||||
["<leader>p"] = "image_kitty",
|
["<leader>p"] = "image_kitty",
|
||||||
-- Git keybindings from astrocore
|
-- Git keybindings from astrocore
|
||||||
|
|||||||
+77
-104
@@ -1,119 +1,92 @@
|
|||||||
|
--- User plugins: cursor animation and snacks.nvim (picker + dashboard) customization
|
||||||
|
|
||||||
-- You can also add or configure plugins by creating files in this `plugins/` folder
|
-- Confirm action for file-opening pickers:
|
||||||
-- PLEASE REMOVE THE EXAMPLES YOU HAVE NO INTEREST IN BEFORE ENABLING THIS FILE
|
-- open in a vertical split by default, reuse the window when the buffer is
|
||||||
-- Here are some examples:
|
-- already visible in this tab, plain edit when the main window holds an
|
||||||
|
-- empty scratch buffer. Explicit edit-cmd keybinds (<c-s> split, <c-v>
|
||||||
|
-- vsplit, <c-t> tab) carry `action.cmd` and are passed through untouched.
|
||||||
|
local function vsplit_confirm(picker, item, action)
|
||||||
|
local actions = require "snacks.picker.actions"
|
||||||
|
if action.cmd then return actions.jump(picker, item, action) end
|
||||||
|
local path = item and item.file and require("snacks.picker.util").path(item)
|
||||||
|
if not (item and (item.buf or path)) then return actions.jump(picker, item, action) end
|
||||||
|
local buf = item.buf or vim.fn.bufadd(path)
|
||||||
|
local visible = false
|
||||||
|
for _, w in ipairs(vim.fn.win_findbuf(buf)) do
|
||||||
|
if
|
||||||
|
vim.api.nvim_win_get_tabpage(w) == vim.api.nvim_get_current_tabpage()
|
||||||
|
and vim.api.nvim_win_get_config(w).relative == ""
|
||||||
|
then
|
||||||
|
visible = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local main_buf = picker.main and vim.api.nvim_win_is_valid(picker.main) and vim.api.nvim_win_get_buf(picker.main)
|
||||||
|
local main_empty = main_buf
|
||||||
|
and vim.api.nvim_buf_get_name(main_buf) == ""
|
||||||
|
and vim.bo[main_buf].buftype == ""
|
||||||
|
and not vim.bo[main_buf].modified
|
||||||
|
local cmd = (visible or main_empty) and "edit" or "vsplit"
|
||||||
|
return actions.jump(picker, item, vim.tbl_extend("force", {}, action, { cmd = cmd }))
|
||||||
|
end
|
||||||
|
|
||||||
---@type LazySpec
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
{
|
{ "sphamba/smear-cursor.nvim", opts = {} },
|
||||||
"sphamba/smear-cursor.nvim",
|
|
||||||
opts = {
|
|
||||||
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- customize dashboard options
|
|
||||||
{
|
{
|
||||||
"folke/snacks.nvim",
|
"folke/snacks.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
|
picker = {
|
||||||
|
jump = { reuse_win = true },
|
||||||
|
-- vsplit-by-default only for file-opening pickers; location pickers
|
||||||
|
-- (lsp_*, lines, diagnostics, grep) keep the default in-window jump
|
||||||
|
sources = {
|
||||||
|
files = { confirm = vsplit_confirm },
|
||||||
|
git_files = { confirm = vsplit_confirm },
|
||||||
|
smart = { confirm = vsplit_confirm },
|
||||||
|
recent = { confirm = vsplit_confirm },
|
||||||
|
buffers = { confirm = vsplit_confirm },
|
||||||
|
},
|
||||||
|
},
|
||||||
dashboard = {
|
dashboard = {
|
||||||
sections = {
|
enabled = true,
|
||||||
{ section = "header" },
|
preset = {
|
||||||
|
-- "prdlk.nvim" in ansi_regular block style
|
||||||
{ section = "keys", gap = 1, padding = 1 },
|
|
||||||
{
|
|
||||||
pane = 2,
|
|
||||||
icon = " ",
|
|
||||||
desc = "Browse Repo",
|
|
||||||
padding = 1,
|
|
||||||
key = "b",
|
|
||||||
action = function()
|
|
||||||
Snacks.gitbrowse()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon = " ",
|
|
||||||
desc = "Projects (ghq)",
|
|
||||||
padding = 1,
|
|
||||||
key = "p",
|
|
||||||
action = function()
|
|
||||||
local repos = vim.fn.systemlist("ghq list -p")
|
|
||||||
vim.ui.select(repos, { prompt = "Select repository" }, function(dir)
|
|
||||||
if not dir then return end
|
|
||||||
vim.cmd.cd(dir)
|
|
||||||
Snacks.picker.files()
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
function()
|
|
||||||
local in_git = Snacks.git.get_root() ~= nil
|
|
||||||
local cmds = {
|
|
||||||
{
|
|
||||||
title = "Notifications",
|
|
||||||
cmd = "gh notify -s -a -n5",
|
|
||||||
action = function()
|
|
||||||
vim.ui.open("https://github.com/notifications")
|
|
||||||
end,
|
|
||||||
key = "N",
|
|
||||||
icon = " ",
|
|
||||||
height = 5,
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title = "Open Issues",
|
|
||||||
cmd = "gh issue list -L 3",
|
|
||||||
key = "i",
|
|
||||||
action = function()
|
|
||||||
vim.fn.jobstart("gh issue list --web", { detach = true })
|
|
||||||
end,
|
|
||||||
icon = " ",
|
|
||||||
height = 7,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon = " ",
|
|
||||||
title = "Open PRs",
|
|
||||||
cmd = "gh pr list -L 3",
|
|
||||||
key = "P",
|
|
||||||
action = function()
|
|
||||||
vim.fn.jobstart("gh pr list --web", { detach = true })
|
|
||||||
end,
|
|
||||||
height = 7,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon = " ",
|
|
||||||
title = "Git Status",
|
|
||||||
cmd = "git --no-pager diff --stat -B -M -C",
|
|
||||||
height = 10,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
return vim.tbl_map(function(cmd)
|
|
||||||
return vim.tbl_extend("force", {
|
|
||||||
pane = 2,
|
|
||||||
section = "terminal",
|
|
||||||
enabled = in_git,
|
|
||||||
padding = 1,
|
|
||||||
ttl = 5 * 60,
|
|
||||||
indent = 3,
|
|
||||||
}, cmd)
|
|
||||||
end, cmds)
|
|
||||||
end,
|
|
||||||
{ section = "startup" },
|
|
||||||
},
|
|
||||||
preset = {
|
|
||||||
header = table.concat({
|
header = table.concat({
|
||||||
" █████ ███████ ████████ ██████ ██████ ",
|
"██████ ██████ ██████ ██ ██ ██ ███ ██ ██ ██ ██ ███ ███",
|
||||||
"██ ██ ██ ██ ██ ██ ██ ██",
|
"██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ████ ████",
|
||||||
"███████ ███████ ██ ██████ ██ ██",
|
"██████ ██████ ██ ██ ██ █████ ██ ██ ██ ██ ██ ██ ██ ████ ██",
|
||||||
"██ ██ ██ ██ ██ ██ ██ ██",
|
"██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██",
|
||||||
"██ ██ ███████ ██ ██ ██ ██████ ",
|
"██ ██ ██ ██████ ███████ ██ ██ ██ ██ ████ ████ ██ ██ ██",
|
||||||
"",
|
|
||||||
"███ ██ ██ ██ ██ ███ ███",
|
|
||||||
"████ ██ ██ ██ ██ ████ ████",
|
|
||||||
"██ ██ ██ ██ ██ ██ ██ ████ ██",
|
|
||||||
"██ ██ ██ ██ ██ ██ ██ ██ ██",
|
|
||||||
"██ ████ ████ ██ ██ ██",
|
|
||||||
}, "\n"),
|
}, "\n"),
|
||||||
},
|
},
|
||||||
|
sections = {
|
||||||
|
{ section = "header" },
|
||||||
|
{ section = "keys", gap = 1, padding = 1 },
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
desc = "Browse Repo",
|
||||||
|
padding = 1,
|
||||||
|
key = "b",
|
||||||
|
action = function() Snacks.gitbrowse() end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
desc = "Projects (ghq)",
|
||||||
|
padding = 1,
|
||||||
|
key = "p",
|
||||||
|
action = function()
|
||||||
|
local repos = vim.fn.systemlist "ghq list -p"
|
||||||
|
vim.ui.select(repos, { prompt = "Select repository" }, function(dir)
|
||||||
|
if not dir then return end
|
||||||
|
vim.cmd.cd(dir)
|
||||||
|
Snacks.picker.files()
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{ section = "startup" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user