Fix treesitter and tmux config for Neovim 0.11
- Update treesitter to use native vim.treesitter API - Fix catppuccin tmux theme path Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
2369df3446
commit
66f880766a
@ -29,6 +29,6 @@ bind-key l select-pane -R
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
#catpuccin theme
|
||||
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
|
||||
run ~/.config/tmux/plugins/catppuccin/catppuccin.tmux
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
|
||||
|
||||
@ -350,35 +350,41 @@ return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
-- Existing
|
||||
"lua", "vim", "vimdoc", "bash",
|
||||
-- Web
|
||||
"javascript", "typescript", "tsx", "json", "yaml", "html", "css", "prisma", "graphql",
|
||||
-- Rust
|
||||
"rust", "toml",
|
||||
-- Python
|
||||
"python",
|
||||
-- C/C++
|
||||
"c", "cpp",
|
||||
-- Markdown
|
||||
"markdown", "markdown_inline",
|
||||
-- Tools
|
||||
"sql", "http",
|
||||
},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
-- Install parsers
|
||||
local ensure_installed = {
|
||||
"lua", "vim", "vimdoc", "bash",
|
||||
"javascript", "typescript", "tsx", "json", "yaml", "html", "css", "graphql",
|
||||
"rust", "toml",
|
||||
"python",
|
||||
"c", "cpp",
|
||||
"markdown", "markdown_inline",
|
||||
"sql",
|
||||
}
|
||||
|
||||
-- Auto-install missing parsers
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
local ft = vim.bo.filetype
|
||||
local lang = vim.treesitter.language.get_lang(ft) or ft
|
||||
if vim.tbl_contains(ensure_installed, lang) then
|
||||
pcall(vim.treesitter.start)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Enable treesitter highlighting globally
|
||||
vim.treesitter.start = vim.treesitter.start or function() end
|
||||
|
||||
-- Run TSUpdate to ensure parsers are installed
|
||||
vim.defer_fn(function()
|
||||
for _, lang in ipairs(ensure_installed) do
|
||||
pcall(function()
|
||||
if not pcall(vim.treesitter.language.inspect, lang) then
|
||||
vim.cmd("TSInstall " .. lang)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end, 100)
|
||||
end,
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user