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 <leader>cy/cY to <leader>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 <noreply@anthropic.com>
This commit is contained in:
+17
-1
@@ -26,7 +26,7 @@
|
||||
-- map("n", "<C-p>", "<cmd>Ex<cr>", { desc = "Explorer (netrw)" }) -- built-in
|
||||
-- end
|
||||
--
|
||||
-- -- Ctrl+Shift+P → “command palette”
|
||||
-- -- Ctrl+Shift+P → "command palette"
|
||||
-- -- Many terminals don't send <C-S-p>, so keep <leader>P as a reliable fallback.
|
||||
-- if has_cmd("WhichKey") then
|
||||
-- map("n", "<C-S-p>", "<cmd>WhichKey<cr>", { desc = "Command Palette" })
|
||||
@@ -35,3 +35,19 @@
|
||||
-- map("n", "<C-S-p>", "<cmd>Telescope commands<cr>", { desc = "Command Palette" })
|
||||
-- map("n", "<leader>P", "<cmd>Telescope commands<cr>", { desc = "Command Palette [fallback]" })
|
||||
-- end
|
||||
|
||||
-- Copy the current file's path to the system clipboard.
|
||||
-- <leader>yp = relative to cwd, <leader>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", "<leader>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", "<leader>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" })
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
news = {
|
||||
lazyvim = false,
|
||||
neovim = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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" },
|
||||
},
|
||||
},
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ return {
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
inlay_hints = {
|
||||
enabled = true,
|
||||
enabled = false,
|
||||
exclude = { "vue" },
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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" }, "<leader>oa", function()
|
||||
require("opencode").ask("@this: ", { submit = true })
|
||||
end, { desc = "Ask about this" })
|
||||
vim.keymap.set({ "n", "x" }, "<leader>os", function()
|
||||
require("opencode").select()
|
||||
end, { desc = "Select prompt" })
|
||||
vim.keymap.set({ "n", "x" }, "<leader>o+", function()
|
||||
require("opencode").prompt("@this")
|
||||
end, { desc = "Add this" })
|
||||
vim.keymap.set("n", "<leader>ot", function()
|
||||
require("opencode").toggle()
|
||||
end, { desc = "Toggle embedded" })
|
||||
vim.keymap.set("n", "<leader>oc", function()
|
||||
require("opencode").command()
|
||||
end, { desc = "Select command" })
|
||||
vim.keymap.set("n", "<leader>on", function()
|
||||
require("opencode").command("session_new")
|
||||
end, { desc = "New session" })
|
||||
vim.keymap.set("n", "<leader>oi", function()
|
||||
require("opencode").command("session_interrupt")
|
||||
end, { desc = "Interrupt session" })
|
||||
vim.keymap.set("n", "<leader>oA", function()
|
||||
require("opencode").command("agent_cycle")
|
||||
end, { desc = "Cycle selected agent" })
|
||||
vim.keymap.set("n", "<S-C-u>", function()
|
||||
require("opencode").command("messages_half_page_up")
|
||||
end, { desc = "Messages half page up" })
|
||||
vim.keymap.set("n", "<S-C-d>", function()
|
||||
require("opencode").command("messages_half_page_down")
|
||||
end, { desc = "Messages half page down" })
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user