From 66a313363838ac99c45f07a49af9f184e7695885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20P=C3=A1rk=C3=A1nyi?= Date: Fri, 7 Aug 2026 11:21:14 +0200 Subject: [PATCH] fix(nvim): treesitter --- nvim/lua/myinit.lua | 15 +++++++++++++++ nvim/lua/options.lua | 3 --- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/nvim/lua/myinit.lua b/nvim/lua/myinit.lua index 80a9279..8669885 100755 --- a/nvim/lua/myinit.lua +++ b/nvim/lua/myinit.lua @@ -6,6 +6,15 @@ local autocmd = vim.api.nvim_create_autocmd -- command = "tabdo wincmd =", -- }) +autocmd('FileType', { + pattern = { 'lua', 'vhdl', 'python', 'markdown', 'latex', 'c', 'cpp', 'hyprlang', 'html', 'css', 'yaml', 'json' }, + callback = function() + vim.treesitter.start() -- highlighting + vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -- folds + vim.wo.foldmethod = 'expr' + -- vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" -- indentation + end, +}) -- disable folding on startup vim.opt.foldenable = false @@ -47,3 +56,9 @@ local enable_providers = { end vim.g.python3_host_prog = vim.fn.expand(os.getenv("XDG_STATE_HOME") .. "/virtualenvs/neovim/bin/python3") + +-- Acu filetype +autocmd({'BufRead', 'BufNewFile'}, { + pattern = '*.acu', + command = "set filetype=acu" +}) diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index 89fc3a1..dbf5a59 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -6,6 +6,3 @@ require "nvchad.options" -- o.cursorlineopt ='both' -- to enable cursorline! local o = vim.o --- Enable treesitter folding -o.foldmethod = "expr" -o.foldexpr = "nvim_treesitter#foldexpr()"