updated nvim treesitter
This commit is contained in:
1 parent
893fe34a11
commit
d1b2fbdf15
24 files changed
+1054
-1011
No files matched your search
@@ -1,3 +1,4 @@
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
-- In your init.lua or after lazy setup
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "fb525166ccc30296fb3457441eb979113de46b00" },
|
||||
"R.nvim": { "branch": "main", "commit": "c56ebe0f8445e251673981c40ac2d74659ecd6ed" },
|
||||
"LuaSnip": { "branch": "master", "commit": "642b0c595e11608b4c18219e93b88d7637af27bc" },
|
||||
"R.nvim": { "branch": "main", "commit": "fccfebab6c47a62716615559ab2aec92688cbd0e" },
|
||||
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
|
||||
"catppuccin": { "branch": "main", "commit": "c7c692a0ad3080710893abbae100171819a3e4be" },
|
||||
"catppuccin": { "branch": "main", "commit": "edefef779ab08ce1a4a404713e3012b0d202bd35" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
@@ -11,65 +11,64 @@
|
||||
"cmp-r": { "branch": "main", "commit": "70bfe8f4c062acc10266e24825439c009a0b1b89" },
|
||||
"cmp-vimtex": { "branch": "master", "commit": "c09ca05bfa0641754516f13294d73d3799a02fc8" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" },
|
||||
"conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" },
|
||||
"dashboard-nvim": { "branch": "master", "commit": "f787e3462c2ee2b6117b17c1aa4ddf66cb6f57fe" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||
"dracula.nvim": { "branch": "main", "commit": "ae752c13e95fb7c5f58da4b5123cb804ea7568ee" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||
"everforest": { "branch": "master", "commit": "85a86eb62409e3ec88713bff3d1b9d7374e112e4" },
|
||||
"flash.nvim": { "branch": "main", "commit": "b6346946d10d07998efee029fb0f7a593806d0cd" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||
"fzf-lua": { "branch": "main", "commit": "511651f198068ef5841ee1635ade58daa2486ef7" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "31d6fb2d618bca1482b9f274751ead5f03461408" },
|
||||
"flash.nvim": { "branch": "main", "commit": "5f0f270fdc7c5b0c21d903ee85b9cb06f2ac636a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "a5a73e586521fe5c12d751ad81a0db67649a94ed" },
|
||||
"fzf-lua": { "branch": "main", "commit": "05e44d38de0a79c11fba5f7bf8138791b1dbdd1e" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "f2421c550618d257048afa650413d9e542ddbe67" },
|
||||
"grapple.nvim": { "branch": "main", "commit": "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7" },
|
||||
"gruvbox-mat": { "branch": "master", "commit": "11d779b26a9ab2b3db8c22c6ac9fb6e8ed4fea79" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "f1e186e44d3b7f9ae918008e2c28ce37c6023d2d" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "bb85e4bfc8d89b0e62c8fa53ccdd13d12e2f77b3" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" },
|
||||
"live-preview.nvim": { "branch": "main", "commit": "a30e54e51e7480d7060c8c8185f2a963ad3518b4" },
|
||||
"live-preview.nvim": { "branch": "main", "commit": "a6307fa340ed7c0d96f5c567afc8c991aad94ce0" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
|
||||
"luvit-meta": { "branch": "main", "commit": "cc9b2d412d2fbd30b94a70cfc214c2a3be27a0a2" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "7adc933dabcc7c86ae6b07aff7ee68eac398491f" },
|
||||
"luvit-meta": { "branch": "main", "commit": "7edcd52ac6f2acc2f83f0cc27ac989a142408fbf" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "b5576cd62899a1a478d0e67ef3d378ee55dba82d" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
|
||||
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "ebd66767191714e008ce73b769518a763ff31bdc" },
|
||||
"neogit": { "branch": "master", "commit": "2043096b7ae81e8350ec8cceb3e7ab08dca1dcfe" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "1a14083046d96e88e361d1da00761c40d45012f3" },
|
||||
"neogit": { "branch": "master", "commit": "5adc81b26232954cd7a90f158aa7844c18fc3165" },
|
||||
"nightfox.nvim": { "branch": "main", "commit": "4dacd3f0185a2227bdf3b6c0975a8f0bf87cac9a" },
|
||||
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
|
||||
"nui.nvim": { "branch": "main", "commit": "10fc361835c856ba4233ef5ea135b919bf3dce97" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "430522f95fe4fb7c511ec64f8c1a90cc6a66c05c" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "2ffe79f1f021def8dd1fcd81deb16f1bb0d989f3" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||
"nvim-lint": { "branch": "master", "commit": "a219b2c9e5b4765e5c845aba119dad55806fcaf1" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "d592c1e6ad9a0a01b3d5ed3f0345d68407167181" },
|
||||
"nvim-navic": { "branch": "master", "commit": "f5eba192f39b453675d115351808bd51276d9de5" },
|
||||
"nvim-lint": { "branch": "master", "commit": "3d55c8f67c6ae5c15e1042571e107c7a3d5c5f4e" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "84b6b6c3f13cb34a6c8a0354b0da4c67d8ccf867" },
|
||||
"nvim-navic": { "branch": "master", "commit": "455808fd0fae06e6d70fadfd61432275db8f34ce" },
|
||||
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "72f56f7585903cd7bf92c665351aa585e150af0f" },
|
||||
"nvim-surround": { "branch": "main", "commit": "2e93e154de9ff326def6480a4358bfc149d5da2c" },
|
||||
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "bd41519ff7901da11ba6e1c8f419f17f2d94305a" },
|
||||
"nvim-treesitter-textobjects": { "branch": "main", "commit": "898ee307df58f854d11cd7edd06472574d48014e" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "5cb0114e6242625db56dd6440e945ed1ece10bc7" },
|
||||
"nvim-treesitter-textobjects": { "branch": "main", "commit": "5c7b0263797dfd1bd6202f2b219f3b53a80b2187" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "6141a40173c6efa98242dc951ed4b6f892c97027" },
|
||||
"nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "2ae6958df7ced50baac5035cec0c15799eedfbf7" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "5f032a85be210cd1c6ac98861eb3b187ff3bd5eb" },
|
||||
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
|
||||
"onedark-warm": { "branch": "master", "commit": "df4792accde9db0043121f32628bcf8e645d9aea" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||
"portal.nvim": { "branch": "main", "commit": "77d9d53fec945bfa407d5fd7120f1b4f117450ed" },
|
||||
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
|
||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "a798325b7f36acc62741d1029930a7b96d4dd4bf" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "f422cb5c6855f150e2ddcfaf44e7157b98b34f6a" },
|
||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "3a0fc08dd39e8bf034a4cfef3f2845bd5f565a2e" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "4663eb3ecd538bd5062628fb6d95bbe6bdca78f6" },
|
||||
"rose-pine": { "branch": "main", "commit": "ff483051a47e27d84bdef47703538df1ed9f4a47" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" },
|
||||
"sonokai": { "branch": "master", "commit": "b023c5280b16fe2366f5e779d8d2756b3e5ee9c3" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "40aedd8a68c78a656a10a8d62d80c54af59420fb" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||
"tokyonight": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||
"vimtex": { "branch": "master", "commit": "1d27d95258d8273d0690c7d3d4ff6e1fa2bd24af" },
|
||||
"vimtex": { "branch": "master", "commit": "e355987594cbf16283bee7b37e3aa3a65d5e1c5c" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" },
|
||||
"yazi.nvim": { "branch": "main", "commit": "d87cd885e06d50e1bb5607e48d96c1094d3b10e3" }
|
||||
"yazi.nvim": { "branch": "main", "commit": "bf3e26d87d96c00dcf4bb4f67230bf717b7b76f6" }
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
-- lsp-config.lua: Configures Language Server Protocol for code analysis and diagnostics.
|
||||
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
lazy = false,
|
||||
opts = {
|
||||
auto_install = true,
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"pyright",
|
||||
"bashls",
|
||||
"ts_ls",
|
||||
"solargraph",
|
||||
"html",
|
||||
"texlab",
|
||||
"ltex",
|
||||
"dockerls",
|
||||
"yamlls",
|
||||
"taplo",
|
||||
"cssls",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"SmiteshP/nvim-navic",
|
||||
},
|
||||
config = function()
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
local navic = require("nvim-navic")
|
||||
|
||||
-- Common on_attach function
|
||||
local on_attach = function(client, bufnr)
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
navic.attach(client, bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
-- Define server configurations
|
||||
local servers = {
|
||||
ts_ls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
taplo = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
solargraph = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
textlsp = {
|
||||
filetypes = { "ltx", "txt" },
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
texlab = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
texlab = {
|
||||
build = {
|
||||
executable = "latexmk",
|
||||
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
|
||||
onSave = true,
|
||||
},
|
||||
forwardSearch = {
|
||||
executable = "zathura",
|
||||
args = { "--synctex-forward", "%l:1:%f", "%p" },
|
||||
},
|
||||
chktex = {
|
||||
onOpenAndSave = true,
|
||||
onEdit = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ltex = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = { "latex", "tex", "bib", "markdown", "mail", "text" },
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-US",
|
||||
enabled = { "latex", "tex", "bib", "markdown", "mail", "text" },
|
||||
checkFrequency = "save", -- Only check when you save, not on every keystroke
|
||||
diagnosticSeverity = "warning", -- Less intrusive
|
||||
completionEnabled = true,
|
||||
additionalRules = {
|
||||
enablePickyRules = true,
|
||||
motherTongue = "en-US",
|
||||
},
|
||||
disabledRules = {
|
||||
-- Add rules you want to disable, e.g.:
|
||||
-- ["en-US"] = { "MORFOLOGIK_RULE_EN_US" },
|
||||
},
|
||||
dictionary = {
|
||||
-- Add custom words here that shouldn't be flagged
|
||||
["en-US"] = {
|
||||
-- "aerc",
|
||||
-- "notmuch",
|
||||
-- "dovecot",
|
||||
},
|
||||
},
|
||||
java = {
|
||||
path = "",
|
||||
initialHeapSize = 64,
|
||||
maximumHeapSize = 512,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
html = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
lua_ls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
cssls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
css = {
|
||||
validate = true,
|
||||
lint = {
|
||||
unknownAtRules = "ignore",
|
||||
},
|
||||
},
|
||||
scss = {
|
||||
validate = true,
|
||||
lint = {
|
||||
unknownAtRules = "ignore",
|
||||
},
|
||||
},
|
||||
less = {
|
||||
validate = true,
|
||||
lint = {
|
||||
unknownAtRules = "ignore",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
pyright = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
bashls = {
|
||||
filetypes = { "sh", "bash", "zsh" },
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
bashIde = {
|
||||
globPattern = "*@(.sh|.inc|.bash|.command|.zsh)",
|
||||
shellcheckPath = "shellcheck",
|
||||
},
|
||||
},
|
||||
},
|
||||
dockerls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
yamlls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
["https://json.schemastore.org/docker-compose.json"] = "docker-compose*.{yml,yaml}",
|
||||
["https://json.schemastore.org/github-workflow.json"] = ".github/workflows/*",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Setup each server
|
||||
for server, config in pairs(servers) do
|
||||
vim.lsp.config[server] = config
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
|
||||
-- Configure diagnostics globally
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false, -- Disable inline diagnostic text (no more popups!)
|
||||
signs = true, -- Keep gutter signs
|
||||
underline = true, -- Underline errors
|
||||
update_in_insert = false, -- Don't update diagnostics while typing
|
||||
severity_sort = true,
|
||||
float = {
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
header = "",
|
||||
prefix = "",
|
||||
},
|
||||
})
|
||||
|
||||
-- LSP keymaps
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
|
||||
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, {})
|
||||
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, {})
|
||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {})
|
||||
|
||||
-- Show diagnostics in floating window (optional - press this when you want to see the error)
|
||||
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, {})
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, {})
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, {})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
-- nvim-colorizer.lua: Highlights color codes (e.g., #FFFFFF) directly in code.
|
||||
|
||||
return {
|
||||
{
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
config = function()
|
||||
require("colorizer").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,235 +1,55 @@
|
||||
-- lsp-config.lua: Configures Language Server Protocol for code analysis and diagnostics.
|
||||
|
||||
return {
|
||||
-- Core nvim-treesitter plugin (new main-branch API)
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
lazy = false,
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
build = ":TSUpdate", -- Updates parsers on install
|
||||
lazy = false, -- load at startup so highlighting works on the first buffer
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
lazy = false,
|
||||
opts = {
|
||||
auto_install = true,
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"pyright",
|
||||
"bashls",
|
||||
"ts_ls",
|
||||
"solargraph",
|
||||
require("nvim-treesitter").setup()
|
||||
|
||||
-- On the main branch, ensure_installed does not exist anymore;
|
||||
-- install parsers explicitly instead (same list as your old config)
|
||||
require("nvim-treesitter").install({
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"markdown",
|
||||
"java",
|
||||
"yaml",
|
||||
"latex",
|
||||
"r",
|
||||
"query",
|
||||
"python",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"rust",
|
||||
"go",
|
||||
"bash",
|
||||
"c",
|
||||
"cpp",
|
||||
"html",
|
||||
"texlab",
|
||||
"ltex",
|
||||
"dockerls",
|
||||
"yamlls",
|
||||
"taplo",
|
||||
"cssls",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"SmiteshP/nvim-navic",
|
||||
},
|
||||
config = function()
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
local navic = require("nvim-navic")
|
||||
|
||||
-- Common on_attach function
|
||||
local on_attach = function(client, bufnr)
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
navic.attach(client, bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
-- Define server configurations
|
||||
local servers = {
|
||||
ts_ls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
taplo = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
solargraph = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
textlsp = {
|
||||
filetypes = { "ltx", "txt" },
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
texlab = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
texlab = {
|
||||
build = {
|
||||
executable = "latexmk",
|
||||
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
|
||||
onSave = true,
|
||||
},
|
||||
forwardSearch = {
|
||||
executable = "zathura",
|
||||
args = { "--synctex-forward", "%l:1:%f", "%p" },
|
||||
},
|
||||
chktex = {
|
||||
onOpenAndSave = true,
|
||||
onEdit = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ltex = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = { "latex", "tex", "bib", "markdown", "mail", "text" },
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-US",
|
||||
enabled = { "latex", "tex", "bib", "markdown", "mail", "text" },
|
||||
checkFrequency = "save", -- Only check when you save, not on every keystroke
|
||||
diagnosticSeverity = "warning", -- Less intrusive
|
||||
completionEnabled = true,
|
||||
additionalRules = {
|
||||
enablePickyRules = true,
|
||||
motherTongue = "en-US",
|
||||
},
|
||||
disabledRules = {
|
||||
-- Add rules you want to disable, e.g.:
|
||||
-- ["en-US"] = { "MORFOLOGIK_RULE_EN_US" },
|
||||
},
|
||||
dictionary = {
|
||||
-- Add custom words here that shouldn't be flagged
|
||||
["en-US"] = {
|
||||
-- "aerc",
|
||||
-- "notmuch",
|
||||
-- "dovecot",
|
||||
},
|
||||
},
|
||||
java = {
|
||||
path = "",
|
||||
initialHeapSize = 64,
|
||||
maximumHeapSize = 512,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
html = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
lua_ls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
cssls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
css = {
|
||||
validate = true,
|
||||
lint = {
|
||||
unknownAtRules = "ignore",
|
||||
},
|
||||
},
|
||||
scss = {
|
||||
validate = true,
|
||||
lint = {
|
||||
unknownAtRules = "ignore",
|
||||
},
|
||||
},
|
||||
less = {
|
||||
validate = true,
|
||||
lint = {
|
||||
unknownAtRules = "ignore",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
pyright = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
bashls = {
|
||||
filetypes = { "sh", "bash", "zsh" },
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
bashIde = {
|
||||
globPattern = "*@(.sh|.inc|.bash|.command|.zsh)",
|
||||
shellcheckPath = "shellcheck",
|
||||
},
|
||||
},
|
||||
},
|
||||
dockerls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
},
|
||||
yamlls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
["https://json.schemastore.org/docker-compose.json"] = "docker-compose*.{yml,yaml}",
|
||||
["https://json.schemastore.org/github-workflow.json"] = ".github/workflows/*",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Setup each server
|
||||
for server, config in pairs(servers) do
|
||||
vim.lsp.config[server] = config
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
|
||||
-- Configure diagnostics globally
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false, -- Disable inline diagnostic text (no more popups!)
|
||||
signs = true, -- Keep gutter signs
|
||||
underline = true, -- Underline errors
|
||||
update_in_insert = false, -- Don't update diagnostics while typing
|
||||
severity_sort = true,
|
||||
float = {
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
header = "",
|
||||
prefix = "",
|
||||
},
|
||||
})
|
||||
|
||||
-- LSP keymaps
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
|
||||
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, {})
|
||||
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, {})
|
||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {})
|
||||
-- highlight = { enable = true } also no longer exists;
|
||||
-- start treesitter highlighting manually for every buffer
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
pcall(vim.treesitter.start)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Show diagnostics in floating window (optional - press this when you want to see the error)
|
||||
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, {})
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, {})
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, {})
|
||||
-- Textobjects plugin that depends on the core plugin
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
branch = "main", -- must use the matching main branch, otherwise it breaks with the rewritten core
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
config = function()
|
||||
require("nvim-treesitter-textobjects").setup({
|
||||
-- add select/move textobject keymaps here when you need them
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
-- nvim-colorizer.lua: Highlights color codes (e.g., #FFFFFF) directly in code.
|
||||
|
||||
-- ~/.config/nvim/lua/plugins/nvim-colorizer.lua
|
||||
return {
|
||||
{
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
config = function()
|
||||
require("colorizer").setup()
|
||||
end,
|
||||
},
|
||||
"catgoose/nvim-colorizer.lua", -- maintained fork, same API
|
||||
config = function()
|
||||
require("colorizer").setup({
|
||||
-- your existing options from line 7 onward go here unchanged
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
-- nvim-tmux-navigator.lua: Switch between Neovim and tmux panes using consistent keybindings.
|
||||
|
||||
return {
|
||||
"alexghergh/nvim-tmux-navigation",
|
||||
config = function()
|
||||
require("nvim-tmux-navigation").setup({})
|
||||
vim.keymap.set("n", "<C-h>", "<Cmd>NvimTmuxNavigateLeft<CR>", {})
|
||||
vim.keymap.set("n", "<C-j>", "<Cmd>NvimTmuxNavigateDown<CR>", {})
|
||||
vim.keymap.set("n", "<C-k>", "<Cmd>NvimTmuxNavigateUp<CR>", {})
|
||||
vim.keymap.set("n", "<C-l>", "<Cmd>NvimTmuxNavigateRight<CR>", {})
|
||||
end,
|
||||
}
|
||||
@@ -1,12 +1,16 @@
|
||||
return {
|
||||
-- Core nvim-treesitter plugin
|
||||
-- Core nvim-treesitter plugin (new main-branch API)
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
build = ":TSUpdate", -- Updates parsers on install
|
||||
priority = 1000, -- ← HIGHEST priority
|
||||
config = true, -- Let lazy.nvim auto-call .setup() with opts
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
lazy = false, -- load at startup so highlighting works on the first buffer
|
||||
config = function()
|
||||
require("nvim-treesitter").setup()
|
||||
|
||||
-- Replaces the old ensure_installed/auto_install options;
|
||||
-- already-installed parsers are skipped, missing ones download in the background
|
||||
require("nvim-treesitter").install({
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
@@ -25,26 +29,26 @@ return {
|
||||
"c",
|
||||
"cpp",
|
||||
"html",
|
||||
},
|
||||
sync_install = false,
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Replaces the old highlight = { enable = true } option
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
pcall(vim.treesitter.start)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Textobjects plugin that depends on the core plugin
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
branch = "main", -- must match the new core API
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
config = function()
|
||||
-- Configuration is integrated into the main setup
|
||||
-- No need to call require() here
|
||||
require("nvim-treesitter-textobjects").setup({
|
||||
-- add select/move textobject keymaps here when you need them
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user