From 206336a9a3e416299e1ff27ad5aea6910f174198 Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Tue, 23 Dec 2025 14:14:22 +0100 Subject: [PATCH] fix treesitter config --- .DS_Store | Bin 0 -> 6148 bytes lua/.DS_Store | Bin 0 -> 6148 bytes lua/autocmd.lua | 16 ++++++++-------- lua/config/treesitter.lua | 29 ++++++++++++++++------------- lua/plugins/init.lua | 5 ++--- 5 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 .DS_Store create mode 100644 lua/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..497993f617ab551cdba1a2dbd379119e0da806f7 GIT binary patch literal 6148 zcmeHK%}T>S5S}$bf?j&`B)NK#_9%kHk{$)2M?q|?t%cSU+8%`*yb2ygd@|Emn0l+n9-3CAn03vLJ;TF0jMsaEt+t3~=b~MJY-)LXv zqj4qEI!pmm;5RD3FFx!;9|kb>-rs}Q0TK>BW1~DxvtgcLU-a^J_LSYukNtReZG3!P zS{n}Qq{Sw5V1mCZn8L)HJGeXf9{1*Noj&UP-Wa32#9>8_$0K+k9uf4A!5D@xV;ych zE)X6q%PI4DpD*}S#wv4Km*?>U)+b;_9gmIMBgPsjb2xwAz3<6?vWR}EQH^@@g$a#n z_P-RsJ)11r7Bp`Pm;$E2LIGMIVr+zoVj;*&2Rc3iAcok@hS&5-K{c^rqF4xG1kFh) zqLey4VmK+s{#f%8#X?ZZ!Rg_{>C8?~D2`{x@ncR0mk63S1xx{7fk19+wEwqOpa134);`Oym{%2Br!uER{MVK~fr!k|t8=h?JE#VCE4zGqLa*47>+? zXS*doL@Wp)bQhh!_)eDXy#gg!dov zh$*K9&FO}c`aXJkY>rp+cz-*J=bJn#b7c8v9$h}QJbDw(V}}Y#X+;V0STuL^;c45W zn#=wA{Mm8Rn5UXew^uD6(wvWoFdz&F13%3GYBr0%XHi;VKo}4PwhZw1A%HS!howdH z=|JP5%j11U7TlYEIbh)W+F@xCBM@anfi_gRBZji!um{dhJ1i~Qa8hPv%;Q#8?u4Su z>aYjKos_mHtuP=A)EVg6?vU&MN%#4`9wa?sKp6N}45)rM4aaySS6f>T$F(+qUO-vc nue7)g!Hp@!@a0l`05t-8z&Akcu(SvZM1BMe4blh$zskS|5pi%j literal 0 HcmV?d00001 diff --git a/lua/autocmd.lua b/lua/autocmd.lua index b0d4e41..85c8d45 100644 --- a/lua/autocmd.lua +++ b/lua/autocmd.lua @@ -1,13 +1,13 @@ local autocmd = vim.api.nvim_create_autocmd -autocmd("LspAttach", { - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - if client then - vim.lsp.document_color.enable(false, args.buf, { "background" }) - end - end, -}) +-- autocmd("LspAttach", { +-- callback = function(args) +-- local client = vim.lsp.get_client_by_id(args.data.client_id) +-- if client then +-- vim.lsp.document_color.enable(false, args.buf, { "background" }) +-- end +-- end, +-- }) autocmd("VimLeave", { command = "set guicursor=a:ver25-Cursor", diff --git a/lua/config/treesitter.lua b/lua/config/treesitter.lua index 977cc14..c511881 100644 --- a/lua/config/treesitter.lua +++ b/lua/config/treesitter.lua @@ -1,13 +1,16 @@ -require'nvim-treesitter.configs'.setup { - ensure_installed = "all", - ignore_install = { "ipkg" }, - sync_install = true, - auto_install = true, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - indent = { - enable = true, - }, -} +local treesitter = require'nvim-treesitter' + +treesitter.setup {} + +vim.api.nvim_create_autocmd('FileType', { + callback = function(args) + local has_parser = pcall(vim.treesitter.get_parser, args.buf) + + if not has_parser then + return + end + + vim.treesitter.start() + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end, +}) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index ef0b07d..c955e24 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,7 +1,4 @@ return { - { - require "plugins.colorschemes", - }, { "nvim-mini/mini.nvim", version = false, @@ -12,6 +9,8 @@ return { }, { "nvim-treesitter/nvim-treesitter", + lazy = false, + build = ":TSUpdate", config = function() require "config.treesitter" end,