From e67ac436829de6ecf7d9b15e5124961995907ecb Mon Sep 17 00:00:00 2001 From: Andre Padez Date: Sat, 15 Aug 2026 16:05:34 +0100 Subject: [PATCH] Drop opencode and supermaven, fix prettier, move path-copy keymaps - Remove the opencode.nvim and supermaven-nvim plugin specs. - formatting.lua: stop hardcoding prettier's path. It pointed at mise/installs/node/22.20.0, which no longer exists (now 24.19.0), so conform silently failed to format. Dropping `command` lets conform inherit its built-in definition and resolve prettier on PATH, which mason.nvim populates. - keymaps.lua: move the file-path copy maps from cy/cY to yp/yP. - Pick up Omarchy Quattro's remote_clipboard.lua and the news-alert suppression, plus the lazy-lock/lazyvim.json churn from the upgrade. Co-Authored-By: Claude Opus 5 --- init.lua | 2 + lazy-lock.json | 7 ++- lazyvim.json | 6 +- lua/config/keymaps.lua | 18 +++++- lua/config/options.lua | 1 + lua/config/remote_clipboard.lua | 99 ++++++++++++++++++++++++++++++ lua/plugins/disable-news-alert.lua | 9 +++ lua/plugins/formatting.lua | 14 ++++- lua/plugins/lsp.lua | 2 +- lua/plugins/opencode.lua | 48 --------------- 10 files changed, 151 insertions(+), 55 deletions(-) create mode 100644 lua/config/remote_clipboard.lua create mode 100644 lua/plugins/disable-news-alert.lua delete mode 100644 lua/plugins/opencode.lua diff --git a/init.lua b/init.lua index 3ba2bd0..fcb9e7f 100644 --- a/init.lua +++ b/init.lua @@ -5,3 +5,5 @@ require("config.macros") vim.opt.swapfile = false vim.opt.number = true vim.opt.relativenumber = true + +vim.keymap.set("i", "", "\\n", { desc = "Insert literal newline" }) diff --git a/lazy-lock.json b/lazy-lock.json index d703a7a..06214d4 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,11 +1,10 @@ { "LazyVim": { "branch": "main", "commit": "561da43c435f330674c9b18bb335be7e1126d928" }, - "blink-copilot": { "branch": "main", "commit": "5d35fd07fcc148be20442da1bdd2407e03263d7d" }, + "SchemaStore.nvim": { "branch": "main", "commit": "aa25399c48236b77af71d4b64cdf157d2ba4e990" }, "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "catppuccin": { "branch": "main", "commit": "af58927c55c9f3272c940ff02b3cee94a1249f26" }, "conform.nvim": { "branch": "master", "commit": "9fd3d5e0b689ec1bf400c53cbbec72c6fdf24081" }, - "copilot.lua": { "branch": "master", "commit": "3123983d00ae6859f8bc987d14ebb524bb41b618" }, "flash.nvim": { "branch": "main", "commit": "3be9bf7e85550045ec576379a0c45aac144d0438" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" }, @@ -32,9 +31,13 @@ "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "render-markdown.nvim": { "branch": "main", "commit": "10126effbafb74541b69219711dfb2c631e7ebf8" }, "snacks.nvim": { "branch": "main", "commit": "bebf0bd38e3e7071abc4085ad46f1ebc32cdfe17" }, + "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" }, "tokyonight.nvim": { "branch": "main", "commit": "d14614cbfc63b6037bfccd48bb982d2ad2003352" }, "trouble.nvim": { "branch": "main", "commit": "c098362fe603d3922095e7db595961e020bdf2d0" }, "ts-comments.nvim": { "branch": "main", "commit": "217ab9cc137fceb6659b53790bd25e608219abe1" }, + "vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" }, + "vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" }, + "vim-dadbod-ui": { "branch": "master", "commit": "48c4f271da13d380592f4907e2d1d5558044e4e5" }, "which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" } } diff --git a/lazyvim.json b/lazyvim.json index 84560e2..757e376 100644 --- a/lazyvim.json +++ b/lazyvim.json @@ -1,9 +1,11 @@ { "extras": [ - "lazyvim.plugins.extras.ai.copilot", "lazyvim.plugins.extras.lang.astro", + "lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.markdown", - "lazyvim.plugins.extras.lang.tailwind" + "lazyvim.plugins.extras.lang.sql", + "lazyvim.plugins.extras.lang.tailwind", + "lazyvim.plugins.extras.lang.toml" ], "install_version": 8, "news": { diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 6ea6da1..76d960b 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -26,7 +26,7 @@ -- map("n", "", "Ex", { desc = "Explorer (netrw)" }) -- built-in -- end -- --- -- Ctrl+Shift+P → “command palette” +-- -- Ctrl+Shift+P → "command palette" -- -- Many terminals don't send , so keep P as a reliable fallback. -- if has_cmd("WhichKey") then -- map("n", "", "WhichKey", { desc = "Command Palette" }) @@ -35,3 +35,19 @@ -- map("n", "", "Telescope commands", { desc = "Command Palette" }) -- map("n", "P", "Telescope commands", { desc = "Command Palette [fallback]" }) -- end + +-- Copy the current file's path to the system clipboard. +-- yp = relative to cwd, yP = absolute. +-- Writes to the "+" register, which LazyVim binds to the system clipboard via +-- clipboard=unnamedplus, so these land in the OS clipboard directly. +vim.keymap.set("n", "yp", function() + local relative_path = vim.fn.expand("%:~:.") + vim.fn.setreg("+", relative_path) + vim.notify("Copied relative path: " .. relative_path) +end, { desc = "Copy relative file path" }) + +vim.keymap.set("n", "yP", function() + local absolute_path = vim.fn.expand("%:p") + vim.fn.setreg("+", absolute_path) + vim.notify("Copied absolute path: " .. absolute_path) +end, { desc = "Copy absolute file path" }) diff --git a/lua/config/options.lua b/lua/config/options.lua index 2c384e4..1b96ca5 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -1,3 +1,4 @@ +require("config.remote_clipboard").setup() -- Options are automatically loaded before lazy.nvim startup -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua -- Add any additional options here diff --git a/lua/config/remote_clipboard.lua b/lua/config/remote_clipboard.lua new file mode 100644 index 0000000..b54c54e --- /dev/null +++ b/lua/config/remote_clipboard.lua @@ -0,0 +1,99 @@ +-- Clipboard for sessions whose yanks may need to reach another machine: +-- every copy is emitted as OSC 52 (inside tmux this becomes a tmux buffer, +-- rebroadcast to every attached client, local or SSH). Paste prefers the +-- local Wayland clipboard when one is available, so content copied in other +-- apps remains pasteable; without a display, paste is an OSC 52 query that +-- tmux (or the terminal) answers. +local M = {} + +local function proc_lines(pid, file) + local ok, lines = pcall(vim.fn.readfile, "/proc/" .. pid .. "/" .. file) + return ok and lines or {} +end + +local function proc_ppid(pid) + for _, line in ipairs(proc_lines(pid, "status")) do + local ppid = line:match("^PPid:%s+(%d+)") + if ppid then + return tonumber(ppid) + end + end +end + +local function ancestor_process_named(name) + local pid = vim.fn.getpid() + + for _ = 1, 16 do + local ppid = proc_ppid(pid) + if not ppid or ppid <= 1 then + return false + end + + local comm = proc_lines(ppid, "comm")[1] or "" + if comm:find(name, 1, true) then + return true + end + + pid = ppid + end + + return false +end + +function M.setup() + local in_tmux = vim.env.TMUX ~= nil + local in_ssh = vim.env.SSH_TTY ~= nil or vim.env.SSH_CONNECTION ~= nil + local in_herdr = vim.env.HERDR_PANE_ID ~= nil or ancestor_process_named("herdr") + + if not (in_tmux or in_ssh or in_herdr) then + return + end + + local osc52 = require("vim.ui.clipboard.osc52") + local has_wayland = vim.env.WAYLAND_DISPLAY ~= nil + and vim.fn.executable("wl-copy") == 1 + and vim.fn.executable("wl-paste") == 1 + + local function copy(register) + local emit = osc52.copy(register) + + return function(lines) + if has_wayland then + local cmd = { "wl-copy", "--sensitive", "--type", "text/plain" } + if register == "*" then + cmd[#cmd + 1] = "--primary" + end + vim.fn.system(cmd, lines) + end + + if vim.g.omarchy_remote_clipboard_osc52 ~= false then + emit(lines) + end + end + end + + local function paste(register) + if not has_wayland then + return osc52.paste(register) + end + + return function() + local cmd = { "wl-paste", "--no-newline" } + if register == "*" then + cmd[#cmd + 1] = "--primary" + end + + local lines = vim.fn.systemlist(cmd, "", 1) + return vim.v.shell_error == 0 and lines or {} + end + end + + vim.g.clipboard = { + name = "OmarchyRemoteClipboard", + copy = { ["+"] = copy("+"), ["*"] = copy("*") }, + paste = { ["+"] = paste("+"), ["*"] = paste("*") }, + cache_enabled = 0, + } +end + +return M diff --git a/lua/plugins/disable-news-alert.lua b/lua/plugins/disable-news-alert.lua new file mode 100644 index 0000000..5b3cd76 --- /dev/null +++ b/lua/plugins/disable-news-alert.lua @@ -0,0 +1,9 @@ +return { + "LazyVim/LazyVim", + opts = { + news = { + lazyvim = false, + neovim = false, + }, + }, +} diff --git a/lua/plugins/formatting.lua b/lua/plugins/formatting.lua index 9791049..5024ecd 100644 --- a/lua/plugins/formatting.lua +++ b/lua/plugins/formatting.lua @@ -4,7 +4,19 @@ return { opts = { formatters = { prettier = { - command = "/home/pastilhas/.local/share/mise/installs/node/22.20.0/bin/prettier", + -- No `command` here on purpose. conform inherits it from its built-in + -- prettier definition, which resolves the name on PATH — and mason.nvim + -- puts ~/.local/share/nvim/mason/bin on Neovim's PATH, so the copy + -- listed in `ensure_installed` below is found automatically. + -- + -- This used to hardcode a mise node path + -- (.../mise/installs/node/22.20.0/bin/prettier). That node version has + -- since been replaced by 24.19.0, so the path no longer existed and + -- prettier formatting was silently doing nothing. + -- + -- `args` is set rather than appended, so it replaces conform's default + -- argument list. --no-config keeps formatting consistent regardless of + -- any .prettierrc in the project. args = { "--no-config", "--stdin-filepath", "$FILENAME" }, }, }, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index a37ac7a..44c3b90 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -4,7 +4,7 @@ return { "neovim/nvim-lspconfig", opts = { inlay_hints = { - enabled = true, + enabled = false, exclude = { "vue" }, }, }, diff --git a/lua/plugins/opencode.lua b/lua/plugins/opencode.lua deleted file mode 100644 index f346de4..0000000 --- a/lua/plugins/opencode.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - "NickvanDyke/opencode.nvim", - dependencies = { - -- Recommended for `ask()` and `select()`. - -- Required for `toggle()`. - { "folke/snacks.nvim", opts = { input = {}, picker = {} } }, - }, - config = function() - vim.g.opencode_opts = { - -- Your configuration, if any — see `lua/opencode/config.lua` - } - - -- Required for `vim.g.opencode_opts.auto_reload` - vim.opt.autoread = true - - -- Recommended/example keymaps - vim.keymap.set({ "n", "x" }, "oa", function() - require("opencode").ask("@this: ", { submit = true }) - end, { desc = "Ask about this" }) - vim.keymap.set({ "n", "x" }, "os", function() - require("opencode").select() - end, { desc = "Select prompt" }) - vim.keymap.set({ "n", "x" }, "o+", function() - require("opencode").prompt("@this") - end, { desc = "Add this" }) - vim.keymap.set("n", "ot", function() - require("opencode").toggle() - end, { desc = "Toggle embedded" }) - vim.keymap.set("n", "oc", function() - require("opencode").command() - end, { desc = "Select command" }) - vim.keymap.set("n", "on", function() - require("opencode").command("session_new") - end, { desc = "New session" }) - vim.keymap.set("n", "oi", function() - require("opencode").command("session_interrupt") - end, { desc = "Interrupt session" }) - vim.keymap.set("n", "oA", function() - require("opencode").command("agent_cycle") - end, { desc = "Cycle selected agent" }) - vim.keymap.set("n", "", function() - require("opencode").command("messages_half_page_up") - end, { desc = "Messages half page up" }) - vim.keymap.set("n", "", function() - require("opencode").command("messages_half_page_down") - end, { desc = "Messages half page down" }) - end, -}