Fix issues when nvim plugin deps aren't available and make system clipboard more consistent

This commit is contained in:
2026-07-10 15:38:33 -07:00
parent e8f6eeb8fb
commit 0d3260dab1
5 changed files with 53 additions and 5 deletions
+19
View File
@@ -59,3 +59,22 @@ opt.splitright = true
opt.updatetime = 300
opt.shortmess:append("c")
-- Clipboard: OSC 52 copy-only. This sends the "+ / "* register content to
-- the real terminal via escape sequence, so <leader>y works whether nvim is
-- local or several ssh/tmux hops deep -- no xclip/wl-copy/pbcopy needed on
-- the remote host. Paste is intentionally left as a no-op: OSC 52 read
-- support is inconsistent across terminals and can hang waiting for a
-- reply, so use the terminal's own native paste (e.g. Ctrl-Shift-V) instead.
local osc52 = require("vim.ui.clipboard.osc52")
vim.g.clipboard = {
name = "OSC 52 (copy-only)",
copy = {
["+"] = osc52.copy("+"),
["*"] = osc52.copy("*"),
},
paste = {
["+"] = function() return {} end,
["*"] = function() return {} end,
},
}
+11 -1
View File
@@ -1,4 +1,14 @@
local servers = { "ts_ls", "svelte", "html", "cssls", "basedpyright", "ruff", "bashls" }
local servers = { "basedpyright", "ruff" }
local npm_servers = { "ts_ls", "svelte", "html", "cssls", "bashls" }
if vim.fn.executable("npm") == 1 then
vim.list_extend(servers, npm_servers)
else
vim.notify(
"npm not found: skipping LSP servers " .. table.concat(npm_servers, ", "),
vim.log.levels.WARN
)
end
return {
{
+15 -4
View File
@@ -25,8 +25,16 @@ return {
"regex",
}
-- Install parsers
require("nvim-treesitter").install(parsers)
-- Install parsers (skip if the tree-sitter CLI isn't available; parsers
-- already cached from a previous run on this machine still work fine)
if vim.fn.executable("tree-sitter") == 1 then
require("nvim-treesitter").install(parsers)
else
vim.notify(
"tree-sitter CLI not found: skipping install of missing parsers",
vim.log.levels.WARN
)
end
-- Enable treesitter highlighting, folding, and indentation for
-- filetypes with an installed parser. Note some filetype names differ
@@ -53,8 +61,11 @@ return {
"markdown",
},
callback = function()
-- Highlighting, provided by Neovim
vim.treesitter.start()
-- Highlighting, provided by Neovim. Falls back to Vim's legacy
-- syntax/indent if no parser is installed for this filetype.
if not pcall(vim.treesitter.start) then
return
end
-- Folding, provided by Neovim
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.wo.foldmethod = "expr"
+6
View File
@@ -52,6 +52,12 @@ set-option -g -q mouse on
bind y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy'
bind C-y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy'
# Let OSC 52 escape sequences (e.g. nvim's clipboard writes) pass through
# this tmux to the real terminal, even when nested behind ssh/tmux layers.
# allow-passthrough was added in tmux 3.3; older tmux doesn't understand the
# option, so only set it when the running tmux is new enough.
if-shell "tmux -V | awk '{print $2}' | awk -F. '{if ($1*1000+$2 >= 3003) exit 0; else exit 1}'" 'set -g allow-passthrough on'
# tmux renamed the copy-mode key table (vi-copy -> copy-mode-vi) and changed
# bind-key's table flag (-t -> -T) in 2.4. Source the file matching the
# running tmux so old tmux never parses syntax it doesn't understand.
+2
View File
@@ -7,6 +7,8 @@ thefuck
tree
nodejs
zsh
npm
tree-sitter-cli
# Useless stuff
fortune-mod