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
|
||||
Reference in New Issue
Block a user