diff --git a/dot_config/gh-dash/config.yml b/dot_config/gh-dash/config.yml index c074cbbe..d29448d5 100644 --- a/dot_config/gh-dash/config.yml +++ b/dot_config/gh-dash/config.yml @@ -114,20 +114,20 @@ theme: compact: false # compact table rows colors: text: - primary: "#cdcecf" - secondary: "#71839b" - inverted: "#131a24" - faint: "#71839b" - warning: "#dbc074" - success: "#81b29a" - error: "#c94f6d" - actor: "#63cdcf" + primary: "#d3c6aa" + secondary: "#83c092" + inverted: "#2b3339" + faint: "#7393b3" + warning: "#dbbc7f" + success: "#83c092" + error: "#e67e80" + actor: "#7fbbb3" background: - selected: "#2b3b51" + selected: "#2E383C" border: - primary: "#2b3b51" - secondary: "#393b44" - faint: "#2b3b51" + primary: "#2E383C" + secondary: "#4e565c" + faint: "#2E383C" pager: diff: "" diff --git a/dot_config/nvim/lazyvim.json b/dot_config/nvim/lazyvim.json index 79c25b23..986a44c2 100644 --- a/dot_config/nvim/lazyvim.json +++ b/dot_config/nvim/lazyvim.json @@ -9,7 +9,6 @@ "lazyvim.plugins.extras.dap.nlua", "lazyvim.plugins.extras.editor.dial", "lazyvim.plugins.extras.editor.outline", - "lazyvim.plugins.extras.editor.refactoring", "lazyvim.plugins.extras.formatting.prettier", "lazyvim.plugins.extras.lang.astro", "lazyvim.plugins.extras.lang.clangd", diff --git a/dot_config/nvim/lua/config/autocmds.lua b/dot_config/nvim/lua/config/autocmds.lua index 971928ed..4eed155d 100644 --- a/dot_config/nvim/lua/config/autocmds.lua +++ b/dot_config/nvim/lua/config/autocmds.lua @@ -68,9 +68,7 @@ end, { usercmd("Btop", function() if vim.fn.executable("btop") == 1 then Snacks.terminal.toggle("btop", { - win = vim.g.floating_terminal and { - style = "float", - } or { + win = { style = "terminal", width = 0, height = 0, @@ -88,9 +86,7 @@ end, { usercmd("Gh", function() if vim.fn.executable("gh") == 1 then Snacks.terminal.toggle({ "gh", "dash" }, { - win = vim.g.floating_terminal and { - style = "float", - } or { + win = { style = "terminal", width = 0, height = 0, diff --git a/dot_config/nvim/lua/config/keymaps.lua b/dot_config/nvim/lua/config/keymaps.lua index a1e6454f..254b9085 100644 --- a/dot_config/nvim/lua/config/keymaps.lua +++ b/dot_config/nvim/lua/config/keymaps.lua @@ -1,6 +1,7 @@ -- Keymaps are automatically loaded on the VeryLazy event -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +local wk = require("which-key") local set = vim.keymap.set local del = vim.keymap.del local opts = { noremap = true, silent = true } @@ -43,8 +44,22 @@ set("c", [[\\-]], [[\(.\{-}\)]], { desc = "Inserts \\(.{-})" }) set("x", "/", "/\\%V", opts) -- Yank to clipboard -set({ "n", "v" }, "y", [["+y]], vim.tbl_extend("force", opts, { desc = "[Y]ank to clipboard" })) -set({ "n", "v" }, "Y", [["+y$]], vim.tbl_extend("force", opts, { desc = "[Y]ank to end of line to clipboard" })) +wk.add({ + { + "y", + [["+y]], + desc = "yank to clipboard", + mode = { "n", "v" }, + icon = { icon = " " }, + }, + { + "Y", + [["+y$]], + desc = "yank to end of line to clipboard", + mode = { "n", "v" }, + icon = { icon = " " }, + }, +}) -- exit terminal mode while in terminal set("t", "[", "", vim.tbl_extend("force", opts, { desc = "terminal escape terminal mode" })) diff --git a/dot_config/nvim/lua/config/options.lua b/dot_config/nvim/lua/config/options.lua index b8c964a6..9619409c 100644 --- a/dot_config/nvim/lua/config/options.lua +++ b/dot_config/nvim/lua/config/options.lua @@ -49,6 +49,9 @@ vim.opt.shadafile = shadafile vim.o.autoread = true +-- LSP +vim.lsp.codelens.enable() + -- Personal - controls floating terminal for various plugins. vim.g.floating_terminal = false diff --git a/dot_config/nvim/lua/plugins/ai/opencode.lua b/dot_config/nvim/lua/plugins/ai/opencode.lua deleted file mode 100644 index edf65150..00000000 --- a/dot_config/nvim/lua/plugins/ai/opencode.lua +++ /dev/null @@ -1,130 +0,0 @@ -local keymap_prefix = "a" - -return { - "sudo-tee/opencode.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "saghen/blink.cmp", - "folke/snacks.nvim", - { "MeanderingProgrammer/render-markdown.nvim", optional = true }, - { "OXY2DEV/markview.nvim", optional = true }, - }, - opts = { - keymap_prefix = keymap_prefix, -- Default keymap prefix for global keymaps change to your preferred prefix and it will be applied to all keymaps starting with o - keymap = { - editor = { - ["oq"] = false, - - ["og"] = false, - ["oa"] = { "toggle" }, -- Open opencode. Close if opened - - ["ot"] = false, - ["of"] = { "toggle_focus" }, -- Toggle focus between opencode and last window - - -- Diff - ["od"] = false, - ["odd"] = { "diff_open", desc = "Open diff view" }, - ["o]"] = false, - ["od]"] = { "diff_next", desc = "Next diff" }, - ["o["] = false, - ["od["] = { "diff_prev", desc = "Previous diff" }, - ["oc"] = false, - ["odq"] = { "diff_close", desc = "Close diff view" }, - - -- Configure providers & variants - ["op"] = false, - ["ocp"] = { "configure_provider", desc = "Configure provider" }, - ["oV"] = false, - ["ocv"] = { "configure_variant", desc = "Configure variant" }, - - -- Sessions - ["oI"] = false, - ["osn"] = { "open_input_new_session", desc = "Open input (new session)" }, - ["os"] = false, - ["oss"] = { "select_session", desc = "Select and load a session" }, - ["oR"] = false, - ["osr"] = { "rename_session", desc = "Rename current session" }, - ["oT"] = false, - ["ost"] = { "timeline", desc = "Session timeline" }, -- Display timeline picker to navigate/undo/redo/fork messages - - -- Mentions - ["@/"] = { "quick_chat", mode = { "n", "x" } }, - ["@v"] = { "paste_image" }, - ["@y"] = { "add_visual_selection", mode = { "v" } }, - - -- Toggle - ["ox"] = false, - ["otx"] = { "swap_position", desc = "Toggle Opencode pane left/right" }, - ["oz"] = false, - ["otz"] = { "toggle_zoom", desc = "Toggle Zoom in/out on the Opencode windows" }, - }, - input_window = { - ["~"] = false, - [""] = false, - [""] = false, - [""] = false, - [""] = false, - [""] = false, - - ["q"] = { "close", mode = { "n" } }, -- Close UI windows - [""] = { "close" }, - [""] = { "cancel" }, - - ["@f"] = { "mention_file", mode = { "n", "i" } }, -- Pick a file and add to context. - ["@v"] = { "paste_image", mode = { "n", "i" }, desc = "Paste image from clipboard" }, - - [""] = { "switch_mode", mode = { "n", "v", "i" } }, -- build/plan - [""] = { "cycle_variant", mode = { "n", "v", "i" } }, -- model variants - [""] = { "next_prompt_history", mode = { "n", "i" } }, -- Navigate to next prompt in history - [""] = { "prev_prompt_history", mode = { "n", "i" } }, -- Navigate to previous prompt in history - [""] = { "submit_input_prompt", mode = { "n", "i" } }, -- Submit prompt (normal mode and insert mode) - }, - output_window = { - ["q"] = { "close" }, -- Close UI windows - [""] = { "close" }, - [""] = { "cancel" }, - - [""] = { "switch_mode", mode = { "n", "v" } }, - [""] = { "cycle_variant", mode = { "n", "v" } }, - }, - session_picker = { - delete_session = { "" }, -- Delete selected session in the session picker - }, - history_picker = { - delete_entry = { "", mode = { "i", "n" } }, -- Delete selected entry in the history picker - clear_all = { "", mode = { "i", "n" } }, -- Clear all entries in the history picker - }, - }, - ui = { - window_width = 0.50, - input = { - text = { - wrap = false, - }, - }, - output = { - filetype = "markdown", -- Filetype assigned to the output buffer (default: 'opencode_output') - }, - picker = { - snacks_layout = { - preset = "select", - }, - }, - }, - }, - config = function(_, opts) - require("opencode").setup(opts) - - -- does not work when passed into keymap config - vim.keymap.set({ "n", "t", "i", "x" }, "", function() - require("opencode.api").toggle() - end, { desc = "Opencode Toggle" }) - - vim.keymap.set({ "n", "v" }, "@", "", { desc = "+ai mentions" }) - vim.keymap.set({ "n", "v" }, keymap_prefix .. "c", "", { desc = "+configure models" }) - vim.keymap.set({ "n", "v" }, keymap_prefix .. "d", "", { desc = "+diff" }) - vim.keymap.set({ "n", "v" }, keymap_prefix .. "r", "", { desc = "+revert" }) - vim.keymap.set({ "n", "v" }, keymap_prefix .. "s", "", { desc = "+session management" }) - vim.keymap.set({ "n", "v" }, keymap_prefix .. "t", "", { desc = "+toggle" }) - end, -} diff --git a/dot_config/nvim/lua/plugins/ai/sidekick.lua b/dot_config/nvim/lua/plugins/ai/sidekick.lua index 6e527612..dd103bec 100644 --- a/dot_config/nvim/lua/plugins/ai/sidekick.lua +++ b/dot_config/nvim/lua/plugins/ai/sidekick.lua @@ -1,3 +1,6 @@ +local keymap_prefix = "a" +local toggle = "" + return { "folke/sidekick.nvim", opts = { @@ -11,11 +14,38 @@ return { enabled = vim.fn.executable("tmux") == 1, }, win = { + wo = { + scrolloff = 0, -- prevent global scrolloff from shifting terminal view on toggle + }, + -- Force opencode to redraw when sidekick re-opens the terminal window. + -- Without this, the window-pty association is lost during hide() and the + -- TUI never receives SIGWINCH, so stale content from the previous render + -- stays visible until the user manually resizes the split. + config = function(terminal) + local orig = terminal.open_win + terminal.open_win = function(self) + orig(self) + vim.defer_fn(function() + if self:win_valid() and self:is_running() then + local w = vim.api.nvim_win_get_width(self.win) + local h = vim.api.nvim_win_get_height(self.win) + pcall(vim.fn.jobresize, self.job, w - 1, h) + pcall(vim.fn.jobresize, self.job, w, h) + end + end, 30) + end + end, layout = vim.g.floating_terminal and "float" or "right", ---@type "float"|"left"|"bottom"|"top"|"right" float = { width = 0.6, height = 0.6, }, + -- Options used when layout is "left"|"bottom"|"top"|"right" + ---@type vim.api.keyset.win_config + split = { + width = 0.5, -- set to 0 for default split width + height = 0, -- set to 0 for default split height + }, }, }, nes = { @@ -33,24 +63,80 @@ return { }, }, }, - -- Disable cli keybindings, only keeping nes keys = function() + require("which-key").add({ + { + keymap_prefix, + group = "ai/sidekick", + }, + }) + return { + -- nes { "", LazyVim.cmp.map({ "ai_nes" }, ""), mode = { "n" }, expr = true }, + + -- cli + { + toggle, + function() + require("sidekick.cli").toggle() + end, + desc = "Sidekick Toggle", + mode = { "n", "t", "i", "x" }, + }, + { + keymap_prefix .. "d", + function() + require("sidekick.cli").close() + end, + desc = "Detach a CLI Session", + }, + { + keymap_prefix .. "f", + function() + require("sidekick.cli").focus() + end, + desc = "Sidekick Focus", + mode = { "n", "t", "i", "x" }, + }, + { + keymap_prefix .. "g", + function() + require("sidekick.cli").send({ msg = "{file}" }) + end, + desc = "Send File", + }, + { + keymap_prefix .. "p", + function() + require("sidekick.cli").prompt() + end, + mode = { "n", "x" }, + desc = "Sidekick Select Prompt", + }, + { + keymap_prefix .. "s", + function() + require("sidekick.cli").select({ filter = { installed = true } }) + end, + desc = "Select CLI", + }, + { + keymap_prefix .. "t", + function() + require("sidekick.cli").send({ msg = "{this}" }) + end, + mode = { "x", "n" }, + desc = "Send This", + }, { - "", - false, + keymap_prefix .. "v", + function() + require("sidekick.cli").send({ msg = "{selection}" }) + end, + mode = { "x" }, + desc = "Send Visual Selection", }, } end, - -- keys = { - -- { - -- "", - -- function() - -- require("sidekick.cli").toggle() - -- end, - -- desc = "Sidekick Toggle", - -- mode = { "n", "t", "i", "x" }, - -- }, - -- }, } diff --git a/dot_config/nvim/lua/plugins/editor/autopairs.lua b/dot_config/nvim/lua/plugins/editor/autopairs.lua index 9e0947ad..0f1996f4 100644 --- a/dot_config/nvim/lua/plugins/editor/autopairs.lua +++ b/dot_config/nvim/lua/plugins/editor/autopairs.lua @@ -12,7 +12,6 @@ return { "codecompanion", "grug-far", "markdown", - "opencode", "snacks_input", "snacks_picker_input", "spectre_panel", diff --git a/dot_config/nvim/lua/plugins/editor/logging.lua b/dot_config/nvim/lua/plugins/editor/logging.lua new file mode 100644 index 00000000..134983c2 --- /dev/null +++ b/dot_config/nvim/lua/plugins/editor/logging.lua @@ -0,0 +1,75 @@ +local keymap_prefix = "p" + +local function chainsaw(name) + return function() + require("chainsaw")[name]() + end +end + +return { + "chrisgrieser/nvim-chainsaw", + event = "VeryLazy", + -- required even if left empty + opts = { + marker = "LOG 🪵", + visuals = { + icon = false, ---@type string|false + }, + logStatements = { + variableLog = { + javascript = { + "/* prettier-ignore */ // {{marker}}", + 'console.log("[{{marker}}] {{filename}}:{{lnum}} - {{var}} → ", {{var}});', + }, + nvim_lua = "Chainsaw({{var}}) -- {{marker}}", + }, + }, + }, + keys = { + -- variable / value inspection + { keymap_prefix .. "a", chainsaw("assertLog"), mode = { "n", "x" }, desc = "assert log" }, + { keymap_prefix .. "o", chainsaw("objectLog"), mode = { "n", "x" }, desc = "object log" }, + { keymap_prefix .. "p", chainsaw("variableLog"), mode = { "n", "x" }, desc = "variable log" }, + { keymap_prefix .. "t", chainsaw("typeLog"), mode = { "n", "x" }, desc = "type log" }, + + -- control-flow / freeform + { keymap_prefix .. "e", chainsaw("emojiLog"), desc = "Emoji log" }, + { keymap_prefix .. "m", chainsaw("messageLog"), desc = "Message log" }, + + -- diagnostics + { keymap_prefix .. "b", chainsaw("debugLog"), desc = "debugger / breakpoint" }, + { keymap_prefix .. "s", chainsaw("stacktraceLog"), desc = "stacktrace log" }, + { keymap_prefix .. "S", chainsaw("sound"), desc = "sound log" }, + { keymap_prefix .. "T", chainsaw("timeLog"), desc = "time log" }, + + -- Search + { + keymap_prefix .. "g", + function() + local marker = require("chainsaw.config.config").config.marker + require("snacks").picker.grep_word({ + title = marker .. " log statements", + cmd = "rg", + args = { "--trim" }, + search = "[" .. marker .. "]", + regex = false, + live = false, + }) + end, + desc = "Find logs", + }, + + -- maintenance + { keymap_prefix .. "C", chainsaw("clearLog"), desc = "clearing statement, e.g. console.clear()" }, + { keymap_prefix .. "d", chainsaw("removeLogs"), mode = { "n", "x" }, desc = "Remove logs" }, + }, + config = function(_, opts) + require("chainsaw").setup(opts) + local ok, wk = pcall(require, "which-key") + if ok then + wk.add({ + { keymap_prefix, group = "print log", icon = { icon = "󱞆 " } }, + }) + end + end, +} diff --git a/dot_config/nvim/lua/plugins/editor/multicursor.lua b/dot_config/nvim/lua/plugins/editor/multicursor.lua index ed0f098b..1609496a 100644 --- a/dot_config/nvim/lua/plugins/editor/multicursor.lua +++ b/dot_config/nvim/lua/plugins/editor/multicursor.lua @@ -4,7 +4,7 @@ return { config = function() require("which-key").add({ "m", - group = "MultiCursor", + group = "multiCursor", icon = { icon = "󰆿 " }, }) diff --git a/dot_config/nvim/lua/plugins/editor/nvim-treesitter.lua b/dot_config/nvim/lua/plugins/editor/nvim-treesitter.lua index 4e1960c1..6190d4a0 100644 --- a/dot_config/nvim/lua/plugins/editor/nvim-treesitter.lua +++ b/dot_config/nvim/lua/plugins/editor/nvim-treesitter.lua @@ -3,7 +3,6 @@ return { "nvim-treesitter/nvim-treesitter", opts = {}, config = function(_, opts) - vim.treesitter.language.register("markdown", "opencode") vim.filetype.add({ extension = { lyaml = "yaml", git = "git", keymap = "dts" }, }) diff --git a/dot_config/nvim/lua/plugins/editor/refactoring.lua b/dot_config/nvim/lua/plugins/editor/refactoring.lua deleted file mode 100644 index 779a21e7..00000000 --- a/dot_config/nvim/lua/plugins/editor/refactoring.lua +++ /dev/null @@ -1,18 +0,0 @@ -local js_ts_print_var_statements = { - 'console.log("[LOGS] %s → ", %s);', -} - -return { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "lewis6991/async.nvim", - }, - opts = { - print_var_statements = { - javascript = js_ts_print_var_statements, - javascriptreact = js_ts_print_var_statements, - typescript = js_ts_print_var_statements, - typescriptreact = js_ts_print_var_statements, - }, - }, -} diff --git a/dot_config/nvim/lua/plugins/editor/stay-centered.lua b/dot_config/nvim/lua/plugins/editor/stay-centered.lua index d5f7385e..940ae7ee 100644 --- a/dot_config/nvim/lua/plugins/editor/stay-centered.lua +++ b/dot_config/nvim/lua/plugins/editor/stay-centered.lua @@ -1,3 +1,4 @@ +-- TODO: remove plugin once neovim release has `scrolloffpad` return { "arnamak/stay-centered.nvim", config = function() diff --git a/dot_config/nvim/lua/plugins/editor/which-key.lua b/dot_config/nvim/lua/plugins/editor/which-key.lua index f5e24dca..1b509f93 100644 --- a/dot_config/nvim/lua/plugins/editor/which-key.lua +++ b/dot_config/nvim/lua/plugins/editor/which-key.lua @@ -3,24 +3,16 @@ return { lazy = false, opts = { preset = "classic", + sort = { "local", "order", "alphanum", "mod" }, }, config = function(_, opts) local wk = require("which-key") wk.setup(opts) wk.add({ - { - "a", - group = "ai", - }, - { - "n", - group = "Notes/New...", - icon = { icon = "󰎝 ", color = "purple", cat = "extension" }, - }, { "N", - group = "News...", + group = "news...", icon = { icon = "󰅸 " }, }, { diff --git a/dot_config/nvim/lua/plugins/editor/yanky.lua b/dot_config/nvim/lua/plugins/editor/yanky.lua index 7e05cbfb..624ef549 100644 --- a/dot_config/nvim/lua/plugins/editor/yanky.lua +++ b/dot_config/nvim/lua/plugins/editor/yanky.lua @@ -11,6 +11,7 @@ return { { "p", nil, + mode = { "n", "x" }, }, }, } diff --git a/dot_config/nvim/lua/plugins/mason/lsp.lua b/dot_config/nvim/lua/plugins/mason/lsp.lua index 77014fd1..67db81cb 100644 --- a/dot_config/nvim/lua/plugins/mason/lsp.lua +++ b/dot_config/nvim/lua/plugins/mason/lsp.lua @@ -116,6 +116,13 @@ return { servers = { vtsls = { enabled = ts_lsp == "vtsls", + keys = { + { + "cu", + LazyVim.lsp.action["source.removeUnused.ts"], + desc = "Remove unused", + }, + }, }, }, }, diff --git a/dot_config/nvim/lua/plugins/misc/obsidian.lua b/dot_config/nvim/lua/plugins/misc/obsidian.lua index 7e36b7ab..88241601 100644 --- a/dot_config/nvim/lua/plugins/misc/obsidian.lua +++ b/dot_config/nvim/lua/plugins/misc/obsidian.lua @@ -8,6 +8,15 @@ return { lazy = true, ft = "markdown", cmd = { "Obsidian" }, + init = function() + require("which-key").add({ + { + "n", + group = "Notes/New...", + icon = { icon = "󰎝 " }, + }, + }) + end, keys = { { "nd", ":Obsidian dailies -7 7", mode = { "n", "v" }, desc = "Obsidian daily" }, { "ng", ":Obsidian search", mode = { "n", "v" }, desc = "Obsidian search" }, diff --git a/dot_config/nvim/lua/plugins/ui/colorschemes/everforest.lua b/dot_config/nvim/lua/plugins/ui/colorschemes/everforest.lua index 2affe014..d40ec98a 100644 --- a/dot_config/nvim/lua/plugins/ui/colorschemes/everforest.lua +++ b/dot_config/nvim/lua/plugins/ui/colorschemes/everforest.lua @@ -13,7 +13,7 @@ return { ---components be transparent (e.g. status line background) transparent_background_level = 2, ---Whether italics should be used for keywords and more. - italics = true, + italics = false, ---Disable italic fonts for comments. Comments are in italics by default, set ---this to `true` to make them _not_ italic! disable_italic_comments = false, @@ -81,6 +81,7 @@ return { LspReferenceText = { bg = palette.bg1 }, LspReferenceRead = { link = "LspReferenceText" }, + LspCodeLens = { fg = palette.grey1, bg = palette.bg1, italic = true }, RenderMarkdownH1Bg = { link = "RenderMarkdownHeadingBG" }, RenderMarkdownH2Bg = { link = "RenderMarkdownHeadingBG" }, diff --git a/dot_config/nvim/lua/plugins/ui/lualine.lua b/dot_config/nvim/lua/plugins/ui/lualine.lua index f197c520..8aa05fb8 100644 --- a/dot_config/nvim/lua/plugins/ui/lualine.lua +++ b/dot_config/nvim/lua/plugins/ui/lualine.lua @@ -12,8 +12,6 @@ local disabled_filetypes = { "dap-repl", "leetcode.nvim", "sidekick_terminal", - "opencode", - "opencode_output", "codecompanion", } diff --git a/dot_config/nvim/lua/plugins/ui/markdown.lua b/dot_config/nvim/lua/plugins/ui/markdown.lua index 72f686fb..b681f124 100644 --- a/dot_config/nvim/lua/plugins/ui/markdown.lua +++ b/dot_config/nvim/lua/plugins/ui/markdown.lua @@ -1,4 +1,4 @@ -local ft = { "md", "markdown", "opencode_output", "codecompanion" } +local ft = { "md", "markdown" } return { -- visual keybinds for markdown, C-b for bold, C-k for link, etc diff --git a/dot_config/nvim/lua/plugins/ui/nvim-colorizer.lua b/dot_config/nvim/lua/plugins/ui/nvim-colorizer.lua index 6b27ec7c..22a519a0 100644 --- a/dot_config/nvim/lua/plugins/ui/nvim-colorizer.lua +++ b/dot_config/nvim/lua/plugins/ui/nvim-colorizer.lua @@ -6,8 +6,6 @@ return { "*", "!grug-far", "!lazy", - "!opencode", - "!opencode_output", "!sidekick_terminal", "!snacks_input", "!snacks_picker_input", diff --git a/dot_config/nvim/lua/plugins/ui/symbol-usage.lua b/dot_config/nvim/lua/plugins/ui/symbol-usage.lua deleted file mode 100644 index 0d16d32e..00000000 --- a/dot_config/nvim/lua/plugins/ui/symbol-usage.lua +++ /dev/null @@ -1,71 +0,0 @@ -local SymbolKind = vim.lsp.protocol.SymbolKind - -return { - "Wansmer/symbol-usage.nvim", - event = "LspAttach", -- need run before LspAttach if you use nvim 0.9. On 0.10 use 'LspAttach' - config = function() - local function h(name) - return vim.api.nvim_get_hl(0, { name = name }) - end - - -- hl-groups can have any name - vim.api.nvim_set_hl(0, "SymbolUsageRounding", { fg = h("CursorLine").bg, italic = true }) - vim.api.nvim_set_hl(0, "SymbolUsageContent", { bg = h("CursorLine").bg, fg = h("Comment").fg, italic = true }) - vim.api.nvim_set_hl(0, "SymbolUsageRef", { fg = h("Function").fg, bg = h("CursorLine").bg, italic = true }) - vim.api.nvim_set_hl(0, "SymbolUsageDef", { fg = h("Type").fg, bg = h("CursorLine").bg, italic = true }) - vim.api.nvim_set_hl(0, "SymbolUsageImpl", { fg = h("@keyword").fg, bg = h("CursorLine").bg, italic = true }) - - local function text_format(symbol) - local res = {} - - -- local round_start = { "", "SymbolUsageRounding" } - -- local round_end = { "", "SymbolUsageRounding" } - - -- Indicator that shows if there are any other symbols in the same line - local stacked_functions_content = symbol.stacked_count > 0 and ("+%s"):format(symbol.stacked_count) or "" - - if symbol.references then - local usage = symbol.references <= 1 and "usage" or "usages" - local num = symbol.references == 0 and "no" or symbol.references - table.insert(res, { "󰌹 ", "SymbolUsageRef" }) - table.insert(res, { ("%s %s"):format(num, usage), "SymbolUsageContent" }) - end - - if symbol.definition then - if #res > 0 then - table.insert(res, { " ", "NonText" }) - end - table.insert(res, { "󰳽 ", "SymbolUsageDef" }) - table.insert(res, { symbol.definition .. " defs", "SymbolUsageContent" }) - end - - if symbol.implementation then - if #res > 0 then - table.insert(res, { " ", "NonText" }) - end - table.insert(res, { "󰡱 ", "SymbolUsageImpl" }) - table.insert(res, { symbol.implementation .. " impls", "SymbolUsageContent" }) - end - - if stacked_functions_content ~= "" then - if #res > 0 then - table.insert(res, { " ", "NonText" }) - end - table.insert(res, { " ", "SymbolUsageImpl" }) - table.insert(res, { stacked_functions_content, "SymbolUsageContent" }) - end - - return res - end - - ---@diagnostic disable: missing-fields - require("symbol-usage").setup({ - text_format = text_format, - disable = { - filetypes = { - "markdown", - }, - }, - }) - end, -} diff --git a/dot_config/nvim/lua/plugins/ui/tiny-code-action.lua b/dot_config/nvim/lua/plugins/ui/tiny-code-action.lua index 67687c6f..3f452609 100644 --- a/dot_config/nvim/lua/plugins/ui/tiny-code-action.lua +++ b/dot_config/nvim/lua/plugins/ui/tiny-code-action.lua @@ -2,8 +2,6 @@ return { { "rachartier/tiny-code-action.nvim", dependencies = { - -- {"nvim-telescope/telescope.nvim"}, - -- { "ibhagwan/fzf-lua" }, -- { "folke/snacks.nvim" }, }, event = "LspAttach", @@ -29,9 +27,41 @@ return { auto_preview = true, -- Enable auto preview of the code action position = "cursor", -- "cursor" or "center" winborder = "rounded", -- Set the window border style ("single", "rounded", "solid", etc.) + keymaps = { + preview = "", -- Key to show preview + preview_close = "", -- Keys to return from preview to main window (can be string or table) + select = "", + close = { "q", "" }, + }, }, }, }, + config = function(_, opts) + require("tiny-code-action").setup(opts) + + -- The plugin's safe_buf_op pcalls preview rendering and emits a DEBUG + -- vim.notify on failure ("Buffer operation failed: ..."). The preview + -- still works (or just stays blank), but the notification is noisy. + -- Drop the notify; keep the pcall. + ---@diagnostic disable-next-line: duplicate-set-field + require("tiny-code-action.utils").safe_buf_op = function(fn) + return pcall(fn) + end + + -- When the LSP fails to resolve an action the previewer surfaces a + -- multi-line stack trace ("Unable to preview code action.\nError: ..."). + -- Replace it with a quiet placeholder. + local prev = require("tiny-code-action.previewers.buffer") + local orig_resolve = prev.preview_with_resolve + ---@diagnostic disable-next-line: duplicate-set-field + prev.preview_with_resolve = function(...) + local content = orig_resolve(...) + if type(content) == "table" and content[1] == "Unable to preview code action." then + return { "No preview available for this action" } + end + return content + end + end, }, { "neovim/nvim-lspconfig", @@ -45,7 +75,7 @@ return { require("tiny-code-action").code_action({}) end, desc = "Code Action", - mode = { "n", "v" }, + mode = { "n", "x" }, has = "codeAction", }, }, diff --git a/dot_config/opencode/opencode.jsonc b/dot_config/opencode/opencode.jsonc index 17ff5f3d..1df719de 100644 --- a/dot_config/opencode/opencode.jsonc +++ b/dot_config/opencode/opencode.jsonc @@ -3,11 +3,19 @@ "$schema": "https://opencode.ai/config.json", "plugin": ["opencode-anthropic-auth@latest"], + "mcp": { + }, "permission": { "external_directory": { "~/.config/opencode/**": "allow", "~/obsidian-vault/**": "allow", "~/.claude/agents/**": "allow", + "/tmp/**": "allow", + "~/.local/share/nvim/**": "allow", + }, + "edit": { + "~/.local/share/nvim/**": "deny", }, }, + "agent": {}, } diff --git a/dot_config/opencode/skills/grill-plan/SKILL.md b/dot_config/opencode/skills/grill-plan/SKILL.md new file mode 100644 index 00000000..8e4387ff --- /dev/null +++ b/dot_config/opencode/skills/grill-plan/SKILL.md @@ -0,0 +1,16 @@ +--- +name: grill-plan +description: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill plan". +--- + +## What I do + +Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer. + +Ask the questions one at a time. + +If a question can be answered by exploring the codebase, explore the codebase instead. + +## When to use me + +Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill plan". diff --git a/dot_config/sesh/sesh.toml b/dot_config/sesh/sesh.toml index c5d48f53..bacfbe64 100644 --- a/dot_config/sesh/sesh.toml +++ b/dot_config/sesh/sesh.toml @@ -1,4 +1,4 @@ -blacklist = ['sidekick claude', 'floating-tmux', 'claude '] +blacklist = ['sidekick claude', 'floating-tmux', 'claude ', 'opencode '] [[window]] name = "opencode" diff --git a/dot_config/tmux/tmux.conf b/dot_config/tmux/tmux.conf index 3766ff0d..4fccf5af 100644 --- a/dot_config/tmux/tmux.conf +++ b/dot_config/tmux/tmux.conf @@ -26,7 +26,7 @@ setw -g mouse on set -g set-clipboard on -# set-option -g default-terminal "screen-256color" +set -g default-terminal "tmux-256color" set -as terminal-features ',*:RGB' bind-key : command-prompt diff --git a/dot_config/yazi/init.lua b/dot_config/yazi/init.lua index 20ab9ec1..99c90947 100644 --- a/dot_config/yazi/init.lua +++ b/dot_config/yazi/init.lua @@ -67,8 +67,8 @@ Status:children_add(function(self) local files_selected = #cx.active.selected local files_cut = cx.yanked.is_cut - local selected_fg = files_selected > 0 and "yellow" or "grey" - local yanked_fg = files_yanked > 0 and (files_cut and "magenta" or "green") or "grey" + local selected_fg = files_selected > 0 and "#dbbc7f" or "#9DA9A0" + local yanked_fg = files_yanked > 0 and (files_cut and "#e67e80" or "#83c092") or "#9DA9A0" local selected_text = files_selected > 0 and "󰼢 " .. files_selected or "󰼢 " .. "0" local yanked_text = files_yanked > 0 and "󱉨 " .. files_yanked or "󱉨 " .. "0" diff --git a/dot_config/yazi/theme.toml b/dot_config/yazi/theme.toml index 7fd42889..67555b61 100644 --- a/dot_config/yazi/theme.toml +++ b/dot_config/yazi/theme.toml @@ -2,15 +2,126 @@ # dark = "kanagawa" [mgr] -marker_selected = { fg = "yellow", bg = 'yellow' } -marker_copied = { fg = "green", bg = 'green' } -marker_cut = { fg = "magenta", bg = 'magenta' } +cwd = { fg = "#7393b3" } + +# Find +find_keyword = { fg = "#dbbc7f", bold = true, italic = true, underline = true } +find_position = { fg = "#d699b6", bg = "reset", bold = true, italic = true } + +# Marker +marker_copied = { fg = "#83c092", bg = "#83c092" } +marker_cut = { fg = "#e67e80", bg = "#e67e80" } +marker_marked = { fg = "#7393b3", bg = "#7393b3" } +marker_selected = { fg = "#dbbc7f", bg = "#dbbc7f" } + +# Count +count_copied = { fg = "#343f44", bg = "#83c092" } +count_cut = { fg = "#343f44", bg = "#e67e80" } +count_selected = { fg = "#343f44", bg = "#dbbc7f" } + +# Border +border_symbol = "│" +border_style = { fg = "#4f585e" } + +[tabs] +active = { fg = "#343f44", bg = "#83c092", bold = true } +inactive = { fg = "#83c092", bg = "#3d484d" } + +[mode] + +normal_main = { fg = "#3d484d", bg = "#83c092", bold = true } +normal_alt = { fg = "#9DA9A0", bg = "#4f585e", bold = true } + +# Select mode +select_main = { fg = "#3d484d", bg = "#e67e80", bold = true } +select_alt = { fg = "#9DA9A0", bg = "#4f585e", bold = true } + +# Unset mode +unset_main = { fg = "#3d484d", bg = "#7393b3", bold = true } +unset_alt = { fg = "#9DA9A0", bg = "#4f585e", bold = true } [status] -overall = { fg = "gray" } +overall = { fg = "#9DA9A0" } sep_left = { open = "", close = "" } sep_right = { open = "", close = "" } +# Permissions +perm_sep = { fg = "#9DA9A0" } +perm_type = { fg = "#83c092" } +perm_read = { fg = "#dbbc7f" } +perm_write = { fg = "#e67e80" } +perm_exec = { fg = "#7393b3" } + +# Progress +progress_label = { bold = true } +progress_normal = { fg = "#7393b3", bg = "#232a2e" } +progress_error = { fg = "#e67e80", bg = "#232a2e" } + +[pick] +border = { fg = "#7393b3" } +active = { fg = "#d699b6", bold = true } +inactive = {} + +[input] +border = { fg = "#7393b3" } +title = {} +value = {} +selected = { reversed = true } + +[cmp] +border = { fg = "#7393b3" } + +[tasks] +border = { fg = "#7393b3" } +title = {} +hovered = { fg = "#d699b6", underline = true } [which] mask = { bg = "reset" } +cand = { fg = "#e67e80" } +rest = { fg = "#2d353b" } +desc = { fg = "#7393b3" } +separator = "  " +separator_style = { fg = "#83c092" } + +[help] +on = { fg = "#7393b3" } +run = { fg = "#d699b6" } +hovered = { reversed = true, bold = true } +footer = { fg = "#2d353b", bg = "#d3c6aa" } + +[spot] +border = { fg = "#7393b3" } +title = { fg = "#7393b3" } +tbl_col = { fg = "#7393b3" } +tbl_cell = { fg = "#dbbc7f", reversed = true } + +[notify] +title_info = { fg = "#83c092" } +title_warn = { fg = "#dbbc7f" } +title_error = { fg = "#e67e80" } + +[indicator] +current = { bg = '#2e383c' } + +[icon] +prepend_conds = [ + { if = "dir", text = "󰉋", fg = "#7393b3" }, # Directories +] + +[filetype] + +rules = [ + # Images + { mime = "image/*", fg = "#7393b3" }, + # Media + { mime = "{audio,video}/*", fg = "#d699b6" }, + # Archives + { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#e67e80" }, + # Documents + { mime = "application/{pdf,doc,rtf}", fg = "#7393b3" }, + # Virtual file system + { mime = "vfs/{absent,stale}", fg = "#4f585e" }, + # Fallback + { url = "*/", fg = "#83c092" }, +]