diff options
Diffstat (limited to 'lua')
29 files changed, 314 insertions, 450 deletions
diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index f9ce4da..ffb5d57 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -90,6 +90,24 @@ local function augroup(name) return vim.api.nvim_create_augroup("my_lazyvim_" .. name, { clear = true }) end +vim.api.nvim_create_autocmd("FileType", { + group = augroup "disable_treesitter_special_buffers", + pattern = { "oil", "snacks_notif" }, + callback = function(event) + pcall(vim.treesitter.stop, event.buf) + end, +}) + +-- Auto-ajustar la altura del quickfix a su contenido (reemplaza nvim-bqf auto_resize_height) +vim.api.nvim_create_autocmd("FileType", { + group = augroup "qf_autoresize", + pattern = "qf", + callback = function() + local height = math.max(1, math.min(10, vim.fn.line "$")) + vim.cmd("resize " .. height) + end, +}) + -- Set filetype for .env and .env.* files vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { group = augroup "env_filetype", @@ -125,3 +143,37 @@ vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { vim.opt_local.filetype = "embedded_template" end, }) + +vim.api.nvim_create_autocmd("User", { + pattern = { + "CodeCompanionToolApprovalRequested", + "CodeCompanionChatDone", + }, + callback = function(args) + local event = args.match + + local messages = { + CodeCompanionToolApprovalRequested = "Aprobación requerida", + CodeCompanionChatDone = "Respuesta lista", + } + + local msg = messages[event] or event + vim.fn.jobstart({ "notify-send", "-a", "CodeCompanion", "CodeCompanion", msg }) + end, +}) + + + +-- vim.api.nvim_create_autocmd("User", { +-- pattern = "CodeCompanion*", +-- callback = function(args) +-- local event = args.match +-- local line = os.date("%H:%M:%S") .. " " .. event .. "\n" +-- +-- local f = io.open("/tmp/codecompanionEvents.txt", "a") +-- if f then +-- f:write(line) +-- f:close() +-- end +-- end, +-- }) diff --git a/lua/config/direnv.lua b/lua/config/direnv.lua new file mode 100644 index 0000000..bc89e33 --- /dev/null +++ b/lua/config/direnv.lua @@ -0,0 +1,62 @@ +-- Integración nativa con direnv (reemplaza direnv/direnv.vim) +-- `direnv export json` emite el diff de variables a aplicar para el cwd actual; +-- las variables a eliminar llegan como null (vim.NIL). +local M = {} + +local function apply(env) + if type(env) ~= "table" then + return + end + for k, v in pairs(env) do + if v == vim.NIL then + vim.env[k] = nil + else + vim.env[k] = v + end + end +end + +local function load(sync) + if vim.fn.executable("direnv") == 0 then + return + end + if sync then + -- Carga inicial sincrónica: el entorno debe estar listo antes de los LSP. + local out = vim.fn.system({ "direnv", "export", "json" }) + if vim.v.shell_error ~= 0 or vim.trim(out) == "" then + return + end + local ok, env = pcall(vim.json.decode, out) + if ok then + apply(env) + end + else + vim.system({ "direnv", "export", "json" }, { text = true }, function(obj) + if obj.code ~= 0 then + return + end + local out = vim.trim(obj.stdout or "") + if out == "" then + return + end + local ok, env = pcall(vim.json.decode, out) + if ok then + vim.schedule(function() + apply(env) + end) + end + end) + end +end + +function M.setup() + vim.api.nvim_create_autocmd("DirChanged", { + group = vim.api.nvim_create_augroup("direnv", { clear = true }), + callback = function() + load(false) + end, + }) + load(true) +end + +return M diff --git a/lua/config/init.lua b/lua/config/init.lua index ee1c549..5da196b 100644 --- a/lua/config/init.lua +++ b/lua/config/init.lua @@ -19,6 +19,9 @@ if vim.fn.has "termguicolors" == 1 then end -- ===================================================== +-- Cargar entorno de direnv temprano (reemplaza direnv/direnv.vim) +require("config.direnv").setup() + -- autocmds and keymaps can wait to load vim.api.nvim_create_autocmd("User", { group = vim.api.nvim_create_augroup("LazyVim", { clear = true }), diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 3b20175..c1e126e 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -32,6 +32,48 @@ map("n", "<C-k>", ":cprev<CR>zz", { desc = "Goes to the previous item in the qui -- map("n", "<leader>o", ":lprev<CR>zz") map("n", "<leader>cc", ":cclose<CR>", { desc = "Close the quick fix list" }) +-- Toggle de diagnósticos en quickfix (reemplaza trouble.nvim) +map("n", "<leader><leader>t", function() + local qf_open = false + for _, win in ipairs(vim.fn.getwininfo()) do + if win.quickfix == 1 then + qf_open = true + end + end + if qf_open then + vim.cmd "cclose" + else + vim.diagnostic.setqflist() + end +end, { desc = "Toggle diagnostics quickfix list" }) + +-- Navegación entre referencias del símbolo bajo el cursor (snacks.words; reemplaza vim-illuminate) +map("n", "]r", function() + Snacks.words.jump(1, true) +end, { desc = "Next Reference" }) +map("n", "[r", function() + Snacks.words.jump(-1, true) +end, { desc = "Previous Reference" }) + +-- Modo sin distracciones (reemplaza zen-mode.nvim) +map("n", "<leader>cz", function() + Snacks.zen() +end, { desc = "Distraction Free Mode" }) + +-- Git worktrees (reemplaza git-worktree.nvim) +map("n", "<leader>gt", function() + require("config.worktree").switch() +end, { desc = "Git Worktree switch" }) +map("n", "<leader>gn", function() + require("config.worktree").create() +end, { desc = "Git Worktree new branch" }) + +-- Redimensionar ventanas (reemplaza smart-splits.nvim) +map("n", "<A-h>", "<cmd>vertical resize -3<cr>", { desc = "Resize window: narrower" }) +map("n", "<A-l>", "<cmd>vertical resize +3<cr>", { desc = "Resize window: wider" }) +map("n", "<A-j>", "<cmd>resize +3<cr>", { desc = "Resize window: taller" }) +map("n", "<A-k>", "<cmd>resize -3<cr>", { desc = "Resize window: shorter" }) + map("n", "<leader><leader><leader>tc", ":TSContextToggle<CR>", { desc = "Toggle treesitter context" }) -- tabulation diff --git a/lua/config/usercmds.lua b/lua/config/usercmds.lua index e69de29..c9cf9f3 100644 --- a/lua/config/usercmds.lua +++ b/lua/config/usercmds.lua @@ -0,0 +1,15 @@ +-- Alternar la columna de color (reemplaza ecthelionvi/NeoColumn.nvim) +vim.api.nvim_create_user_command("ToggleColorColumn", function() + vim.opt_local.colorcolumn = vim.wo.colorcolumn == "" and "80" or "" +end, { desc = "Alternar colorcolumn (80)" }) + +-- Atenuar el código fuera del scope (reemplaza twilight.nvim con snacks.dim) +local dim_on = false +vim.api.nvim_create_user_command("Twilight", function() + dim_on = not dim_on + if dim_on then + Snacks.dim.enable() + else + Snacks.dim.disable() + end +end, { desc = "Toggle dim del scope (snacks)" }) diff --git a/lua/config/worktree.lua b/lua/config/worktree.lua new file mode 100644 index 0000000..dd4e837 --- /dev/null +++ b/lua/config/worktree.lua @@ -0,0 +1,59 @@ +-- Git worktrees nativos vía `git` + vim.ui (reemplaza ThePrimeagen/git-worktree.nvim). +-- vim.ui.select/input los provee Snacks, así que se elimina además una dependencia de telescope. +local M = {} + +local function git(args) + local res = vim.system(vim.list_extend({ "git" }, args), { text = true }):wait() + return res.code == 0, vim.trim(res.stdout or ""), vim.trim(res.stderr or "") +end + +function M.switch() + local ok, out = git { "worktree", "list", "--porcelain" } + if not ok then + vim.notify("No es un repositorio git con worktrees", vim.log.levels.WARN) + return + end + local trees = {} + for path in out:gmatch "worktree (.-)\n" do + table.insert(trees, path) + end + -- el último no termina en \n + local last = out:match "worktree ([^\n]+)$" + if last then + table.insert(trees, last) + end + if #trees == 0 then + vim.notify("Sin worktrees", vim.log.levels.WARN) + return + end + vim.ui.select(trees, { prompt = "Cambiar a worktree" }, function(choice) + if not choice then + return + end + vim.cmd("cd " .. vim.fn.fnameescape(choice)) + vim.notify("Worktree: " .. choice) + end) +end + +function M.create() + vim.ui.input({ prompt = "Nueva rama/worktree: " }, function(name) + if not name or name == "" then + return + end + local ok, root = git { "rev-parse", "--show-toplevel" } + if not ok then + vim.notify("No es un repositorio git", vim.log.levels.WARN) + return + end + local path = vim.fn.fnamemodify(root, ":h") .. "/" .. name + local cok, _, cerr = git { "worktree", "add", path, "-b", name } + if not cok then + vim.notify("Error al crear worktree: " .. cerr, vim.log.levels.ERROR) + return + end + vim.cmd("cd " .. vim.fn.fnameescape(path)) + vim.notify("Worktree creado: " .. path) + end) +end + +return M diff --git a/lua/pi/lsp/attach.lua b/lua/pi/lsp/attach.lua index 3611279..7030cbd 100644 --- a/lua/pi/lsp/attach.lua +++ b/lua/pi/lsp/attach.lua @@ -9,10 +9,7 @@ return function(client, bufnr) vim.keymap.set({ "n", "v" }, "<leader>vca", vim.lsp.buf.code_action, { buffer = 0, desc = "LSP Code actions" }) vim.keymap.set("n", "<leader>vf", function() return vim.lsp.buf.format { - async = true, - filter = function(cli) - return cli.name ~= "lua_ls" - end, + async = true } end, { buffer = 0, desc = "LSP format file" }) @@ -37,4 +34,6 @@ return function(client, bufnr) vim.lsp.inlay_hint.enable(true, { bufnr = bufnr }) end) end + -- El resaltado de referencias bajo el cursor lo provee snacks.words (snacks.lua), + -- y la navegación ]r/[r se define en config.keymaps. end diff --git a/lua/pi/lsp/init.lua b/lua/pi/lsp/init.lua index 31b5161..de6e95b 100644 --- a/lua/pi/lsp/init.lua +++ b/lua/pi/lsp/init.lua @@ -3,12 +3,12 @@ return { ops = vim.tbl_deep_extend("force", require "pi.lsp.default", ops) -- Configure LSP border for native LSP - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { - border = "single", - }) - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { - border = "single", - }) + local orig_open_floating_preview = vim.lsp.util.open_floating_preview + vim.lsp.util.open_floating_preview = function(contents, syntax, opts, ...) + opts = opts or {} + opts.border = opts.border or "single" + return orig_open_floating_preview(contents, syntax, opts, ...) + end local mason_servers = {} for server, options in pairs(ops.servers) do diff --git a/lua/pi/lsp/null-ls.lua b/lua/pi/lsp/null-ls.lua index d8211ed..eef6be6 100644 --- a/lua/pi/lsp/null-ls.lua +++ b/lua/pi/lsp/null-ls.lua @@ -11,7 +11,7 @@ null_ls.setup { null_ls.builtins.code_actions.refactoring, null_ls.builtins.formatting.alejandra, require "none-ls-luacheck.diagnostics.luacheck", - -- null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.stylua, require "none-ls.diagnostics.yamllint", -- require("none-ls.diagnostics.ruff"), diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua index 90c78b8..7b805a7 100644 --- a/lua/plugins/codecompanion.lua +++ b/lua/plugins/codecompanion.lua @@ -129,24 +129,6 @@ return { log_level = "DEBUG", }, config = function() - -- Compatibility patch for recent CodeCompanion/Copilot model schemas - -- where `schema.model.choices` can be a function instead of a table. - local adapter_utils = require("codecompanion.utils.adapters") - adapter_utils.model_choice = function(adapter) - local model = adapter_utils.model(adapter) - local choices = adapter.schema.model.choices - - if type(choices) == "function" then - choices = choices(adapter, { async = false }) - end - - if type(choices) ~= "table" then - return nil - end - - return choices[model] - end - require("codecompanion").setup({ mcp = { servers = { @@ -169,6 +151,15 @@ return { }) end, }, + acp = { + claude_code = function() + return require("codecompanion.adapters").extend("claude_code", { + env = { + CLAUDE_CODE_OAUTH_TOKEN = "cmd:echo $CLAUDE_CODE_OAUTH_TOKEN", + }, + }) + end, + }, }, interactions = { chat = { @@ -214,29 +205,61 @@ return { }, -- adapter = "llama.cpp", adapter = { - name = "copilot", - model = "gpt-5-mini", + name ="claude_code", + -- model = "claude-opus-4-8", + -- model = "claude-sonnet-4-6", + model = "claude-haiku-4-5", }, + -- adapter = { + -- name = "copilot", + -- model = "gpt-4.1", + -- }, }, inline = { - -- adapter = "llama.cpp", adapter = { - name = "copilot", - model = "gpt-5-mini", + name ="claude_code", + model = "claude-haiku-4-5", + -- model = "claude-sonnet-4-6", }, + -- adapter = "llama.cpp", + -- adapter = { + -- name = "copilot", + -- model = "gpt-4.1", + -- }, }, cmd = { - -- adapter = "llama.cpp", adapter = { - name = "copilot", - model = "gpt-5-mini", + name ="claude_code", + model = "claude-haiku-4-5", + -- model = "claude-sonnet-4-6", }, + -- adapter = "llama.cpp", + -- adapter = { + -- name = "copilot", + -- model = "gpt-4.1", + -- }, }, background = { - -- adapter = "llama.cpp" adapter = { - name = "copilot", - model = "gpt-5-mini", + name ="claude_code", + model = "claude-haiku-4-5", + -- model = "claude-sonnet-4-6", + }, + -- adapter = "llama.cpp" + -- adapter = { + -- name = "copilot", + -- model = "gpt-4.1", + -- }, + }, + cli = { + agent = "claude_code", + agents = { + claude_code = { + cmd = "claude", + args = {}, + description = "Claude Code CLI", + provider = "terminal", + }, }, }, }, diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua deleted file mode 100644 index 801223b..0000000 --- a/lua/plugins/comment.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "numToStr/Comment.nvim", - keys = { { "gcc", desc = "Comment current line" }, { "gc", mode = "v", desc = "Comment selected text" } }, - config = true, -} diff --git a/lua/plugins/direnv.lua b/lua/plugins/direnv.lua deleted file mode 100644 index df3d01d..0000000 --- a/lua/plugins/direnv.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "direnv/direnv.vim", - lazy = false, - priority = 900, -} diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua deleted file mode 100644 index 188453b..0000000 --- a/lua/plugins/dressing.lua +++ /dev/null @@ -1,205 +0,0 @@ -return { - "stevearc/dressing.nvim", - event = "VeryLazy", - opts = { - -- ===================================================== - -- Input Configuration - Enhanced vim.ui.input - -- ===================================================== - input = { - enabled = true, - default_prompt = " Input:", - prompt_align = "center", - insert_only = true, - start_in_insert = true, - - -- ========== Window Styling ========== - border = "rounded", - relative = "editor", - - -- ========== Size Configuration ========== - prefer_width = 50, - width = nil, - max_width = { 140, 0.8 }, - min_width = { 30, 0.3 }, - - -- ========== Window Options ========== - win_options = { - winblend = 0, -- No transparency for better readability - wrap = false, - cursorline = true, - cursorlineopt = "both", - -- Better highlighting - winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:PmenuSel", - }, - - -- ========== Enhanced Key Mappings ========== - mappings = { - n = { - ["<Esc>"] = "Close", - ["<CR>"] = "Confirm", - ["q"] = "Close", - ["<C-c>"] = "Close", - }, - i = { - ["<C-c>"] = "Close", - ["<CR>"] = "Confirm", - ["<Up>"] = "HistoryPrev", - ["<Down>"] = "HistoryNext", - ["<C-p>"] = "HistoryPrev", - ["<C-n>"] = "HistoryNext", - ["<C-u>"] = function() vim.api.nvim_del_current_line() end, - ["<Esc>"] = "Close", - }, - }, - - -- ========== Custom Configuration Function ========== - get_config = function(opts) - -- Customize based on prompt type - if opts.prompt and opts.prompt:find("rename", 1, true) then - return { - relative = "cursor", - row = 1, - col = 0, - } - end - -- For file operations, make window larger - if opts.prompt and (opts.prompt:find("file", 1, true) or opts.prompt:find("path", 1, true)) then - return { - prefer_width = 80, - } - end - end, - }, - - -- ===================================================== - -- Select Configuration - Enhanced vim.ui.select - -- ===================================================== - select = { - enabled = true, -- Enable for better selection UI - - -- ========== Backend Priority ========== - backend = { "telescope", "builtin", "nui" }, - trim_prompt = true, - - -- ========== Telescope Integration ========== - telescope = require('telescope.themes').get_dropdown({ - layout_config = { - width = 0.6, - height = 0.6, - }, - borderchars = { - prompt = { "─", "│", " ", "│", "┌", "┐", "│", "│" }, - results = { "─", "│", "─", "│", "├", "┤", "┘", "└" }, - preview = { "─", "│", "─", "│", "┌", "┐", "┘", "└" }, - }, - }), - - -- ========== FZF Configuration ========== - fzf = { - window = { - width = 0.7, - height = 0.6, - }, - }, - - -- ========== NUI Configuration ========== - nui = { - position = "50%", - size = nil, - relative = "editor", - border = { - style = "rounded", - text = { - top = " Select ", - top_align = "center", - }, - }, - buf_options = { - swapfile = false, - filetype = "DressingSelect", - }, - win_options = { - winblend = 0, - winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:PmenuSel", - }, - max_width = 100, - max_height = 50, - min_width = 50, - min_height = 15, - }, - - -- ========== Built-in Selector Configuration ========== - builtin = { - border = "rounded", - relative = "editor", - - -- ========== Enhanced Window Options ========== - win_options = { - winblend = 0, - cursorline = true, - winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:PmenuSel", - }, - - -- ========== Size Configuration ========== - width = nil, - max_width = { 120, 0.8 }, - min_width = { 50, 0.4 }, - height = nil, - max_height = 0.8, - min_height = { 15, 0.3 }, - - -- ========== Enhanced Key Mappings ========== - mappings = { - ["<Esc>"] = "Close", - ["<C-c>"] = "Close", - ["<CR>"] = "Confirm", - ["q"] = "Close", - ["j"] = "Next", - ["k"] = "Prev", - ["<Down>"] = "Next", - ["<Up>"] = "Prev", - ["<C-j>"] = "Next", - ["<C-k>"] = "Prev", - }, - }, - - -- ========== Format Item Override ========== - format_item_override = { - -- Add icons for common items - codeaction = function(action_tuple) - local title = action_tuple[2].title:gsub("\r\n", "\\r\\n") - local client = action_tuple[1] - return string.format(" %s - %s", title, client) - end, - }, - - -- ========== Dynamic Configuration ========== - get_config = function(opts) - -- For code actions, use telescope if available - if opts.kind == "codeaction" then - return { - backend = { "telescope", "builtin" }, - telescope = require('telescope.themes').get_cursor({ - layout_config = { - width = 0.6, - height = 0.4, - }, - }), - } - end - - -- For LSP references/definitions, prefer telescope - if opts.kind == "references" or opts.kind == "definitions" then - return { - backend = { "telescope" }, - } - end - - -- For simple selections, use builtin - return { - backend = { "builtin", "telescope" }, - } - end, - }, - }, -} diff --git a/lua/plugins/image.lua b/lua/plugins/image.lua deleted file mode 100644 index edd938f..0000000 --- a/lua/plugins/image.lua +++ /dev/null @@ -1,24 +0,0 @@ - -return { - "3rd/image.nvim", - opts = { - backend = "sixel", - max_width = nil, - max_height = nil, - max_width_window_percentage = nil, - max_height_window_percentage = nil, - window_overlap_clear_enabled = true, - window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "notify", "noice", "lazy", "mason", "oil_list", "TelescopePrompt" }, - editor_only_render_when_focused = true, - tmux_show_only_in_active_window = true, - render = { - debounce_ms = 10, - show_label = true, - label_align = "center", - label_format = "[image.nvim] %s", - foreground_color = true, - background_color = true, - }, - integrations = {}, - }, -} diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua deleted file mode 100644 index 08fc717..0000000 --- a/lua/plugins/indent-blankline.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "lukas-reineke/indent-blankline.nvim", - main = "ibl", - opts = {} -} diff --git a/lua/plugins/luarocks.lua b/lua/plugins/luarocks.lua deleted file mode 100644 index c8dfe6c..0000000 --- a/lua/plugins/luarocks.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "vhyrro/luarocks.nvim", - priority = 1000, -- Very high priority is required, luarocks.nvim should run as the first plugin in your config. - config = true, -} diff --git a/lua/plugins/neocolumn.lua b/lua/plugins/neocolumn.lua deleted file mode 100644 index f02b5b5..0000000 --- a/lua/plugins/neocolumn.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "ecthelionvi/NeoColumn.nvim", - opts = {}, - cmd = { "ToggleNeoColumn" }, -} diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua index 033db3c..57dd934 100644 --- a/lua/plugins/noice.lua +++ b/lua/plugins/noice.lua @@ -233,7 +233,6 @@ return { any = { { event = "msg_show", find = "lines yanked" }, { event = "msg_show", find = "more lines" }, - { event = "msg_show", find = "direnv:" }, { find = "laravel.sail." }, { find = "Pattern not found" }, { event = "msg_show", kind = "", find = "change;" }, diff --git a/lua/plugins/nvim-bqf.lua b/lua/plugins/nvim-bqf.lua deleted file mode 100644 index 5de7214..0000000 --- a/lua/plugins/nvim-bqf.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - 'kevinhwang91/nvim-bqf', - ft = 'qf', - opts = { - auto_resize_height = true, - preview = { - wrap = true, - }, - }, - } diff --git a/lua/plugins/smart-splits.lua b/lua/plugins/smart-splits.lua deleted file mode 100644 index 57faedb..0000000 --- a/lua/plugins/smart-splits.lua +++ /dev/null @@ -1,34 +0,0 @@ -return { - "mrjones2014/smart-splits.nvim", - config = true, - keys = { - { - "<A-h>", - function() - require("smart-splits").resize_left() - end, - desc = "Resize window left +10", - }, - { - "<A-j>", - function() - require("smart-splits").resize_down() - end, - desc = "Resize window down +10", - }, - { - "<A-k>", - function() - require("smart-splits").resize_up() - end, - desc = "Resize window up +10", - }, - { - "<A-l>", - function() - require("smart-splits").resize_right() - end, - desc = "Resize window right +10", - }, - }, -} diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua index c6b63b3..6fa90e8 100644 --- a/lua/plugins/snacks.lua +++ b/lua/plugins/snacks.lua @@ -12,7 +12,7 @@ return { notifier = { enabled = true }, picker = { enabled = true, - ui_select = false, + ui_select = true, jump = { reuse_win = true, }, diff --git a/lua/plugins/transparent.lua b/lua/plugins/transparent.lua deleted file mode 100644 index e8a6939..0000000 --- a/lua/plugins/transparent.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "xiyaowong/nvim-transparent", - lazy = false, - config = true, -} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 80f98cf..aa17471 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -29,7 +29,10 @@ return { 'TSPlaygroundToggle', }, opts = { - endwise = { enable = true }, + endwise = { + enable = true, + disable = { "markdown", "markdown_inline" }, + }, auto_install = true, ensure_installed = { "bash", @@ -68,6 +71,10 @@ return { }, highlight = { enable = true, + disable = function(_, buf) + local ft = vim.bo[buf].filetype + return ft == "oil" or ft == "snacks_notif" + end, additional_vim_regex_highlighting = { "org" }, }, playground = { @@ -83,6 +90,7 @@ return { }, indent = { enable = true, + disable = { "oil", "snacks_notif" }, }, textobjects = { select = { @@ -125,6 +133,15 @@ return { } }) + -- Reuse markdown parser for plugin-specific scratch buffers. + vim.treesitter.language.register("markdown" |