fix: get osc52 working

This commit is contained in:
Nicholas Novak
2026-05-03 14:00:55 -07:00
parent 739d64d6eb
commit 6076a4f3bf
3 changed files with 73 additions and 27 deletions
+66 -24
View File
@@ -335,7 +335,8 @@ require("lazy").setup({
-- --
-- tsgo = {}, -- tsgo = {},
eslint = {}, -- eslint = {},
biome = {},
lua_ls = { lua_ls = {
-- cmd = { ... }, -- cmd = { ... },
@@ -747,11 +748,13 @@ require("lazy").setup({
{ -- Highlight, edit, and navigate code { -- Highlight, edit, and navigate code
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
lazy = false,
build = ":TSUpdate", build = ":TSUpdate",
main = "nvim-treesitter.config", -- Sets main module to use for opts branch = "main",
-- [[ Configure Treesitter ]] See `:help nvim-treesitter` -- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro`
opts = { config = function()
ensure_installed = { -- ensure basic parser are installed
local parsers = {
"bash", "bash",
"c", "c",
"diff", "diff",
@@ -763,25 +766,61 @@ require("lazy").setup({
"query", "query",
"vim", "vim",
"vimdoc", "vimdoc",
"typescript", }
}, require("nvim-treesitter").install(parsers)
-- Autoinstall languages that are not installed
auto_install = true, ---@param buf integer
highlight = { ---@param language string
enable = true, local function treesitter_try_attach(buf, language)
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. -- check if parser exists and load it
-- If you are experiencing weird indenting issues, add the language to if not vim.treesitter.language.add(language) then
-- the list of additional_vim_regex_highlighting and disabled languages for indent. return
additional_vim_regex_highlighting = { "ruby" }, end
}, -- enables syntax highlighting and other treesitter features
indent = { enable = true, disable = { "ruby" } }, vim.treesitter.start(buf, language)
},
-- There are additional nvim-treesitter modules that you can use to interact -- enables treesitter based folds
-- with nvim-treesitter. You should go explore a few and see what interests you: -- for more info on folds see `:help folds`
-- -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` -- vim.wo.foldmethod = 'expr'
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects -- check if treesitter indentation is available for this language, and if so enable it
-- in case there is no indent query, the indentexpr will fallback to the vim's built in one
local has_indent_query = vim.treesitter.query.get(language, "indents") ~= nil
-- enables treesitter based indentation
if has_indent_query then
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end
end
local available_parsers = require("nvim-treesitter").get_available()
vim.api.nvim_create_autocmd("FileType", {
callback = function(args)
local buf, filetype = args.buf, args.match
local language = vim.treesitter.language.get_lang(filetype)
if not language then
return
end
local installed_parsers = require("nvim-treesitter").get_installed("parsers")
if vim.tbl_contains(installed_parsers, language) then
-- enable the parser if it is installed
treesitter_try_attach(buf, language)
elseif vim.tbl_contains(available_parsers, language) then
-- if a parser is available in `nvim-treesitter` auto install it, and enable it after the installation is done
require("nvim-treesitter").install(language):await(function()
treesitter_try_attach(buf, language)
end)
else
-- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter`
treesitter_try_attach(buf, language)
end
end,
})
end,
}, },
{ {
@@ -802,3 +841,6 @@ vim.o.termguicolors = true
-- Keymaps for better default experience -- Keymaps for better default experience
-- See `:help vim.keymap.set()` -- See `:help vim.keymap.set()`
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true }) vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
vim.g.loaded_python3_provider = nil
vim.cmd("runtime autoload/provider/python3.vim")
+1 -1
View File
@@ -7,7 +7,7 @@
"gitsigns.nvim": { "branch": "main", "commit": "6d808f99bd63303646794406e270bd553ad7792e" }, "gitsigns.nvim": { "branch": "main", "commit": "6d808f99bd63303646794406e270bd553ad7792e" },
"gruvbox": { "branch": "master", "commit": "697c00291db857ca0af00ec154e5bd514a79191f" }, "gruvbox": { "branch": "master", "commit": "697c00291db857ca0af00ec154e5bd514a79191f" },
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" }, "lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" },
"lualine.nvim": { "branch": "master", "commit": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c" }, "lualine.nvim": { "branch": "master", "commit": "a905eeebc4e63fdc48b5135d3bf8aea5618fb21c" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "0a3b42c3e503df87aef6d6513e13148381495c3a" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "0a3b42c3e503df87aef6d6513e13148381495c3a" },
+6 -2
View File
@@ -5,8 +5,7 @@ vim.g.have_nerd_font = false
vim.o.colorcolumn = "80" vim.o.colorcolumn = "80"
vim.o.background = "dark" vim.o.background = "dark"
vim.opt.clipboard = "unnamedplus" vim.o.clipboard = "unnamedplus"
vim.g.clipboard = { vim.g.clipboard = {
name = "OSC 52", name = "OSC 52",
copy = { copy = {
@@ -19,6 +18,11 @@ vim.g.clipboard = {
}, },
} }
if vim.g.loaded_clipboard_provider ~= nil then
vim.g.loaded_clipboard_provider = nil
vim.cmd("runtime autoload/provider/clipboard.vim")
end
-- Enable mouse mode -- Enable mouse mode
vim.o.mouse = "a" vim.o.mouse = "a"