diff --git a/.config/nvim/after/plugin/lspconfig.lua b/.config/nvim/after/plugin/lspconfig.lua index 83f8e03..0ec8b2d 100644 --- a/.config/nvim/after/plugin/lspconfig.lua +++ b/.config/nvim/after/plugin/lspconfig.lua @@ -32,6 +32,9 @@ vim.lsp.config("odoo_ls", { '--config-path', vim.fn.expand('$HOME/projects/odoo/odools.toml'), } }) +vim.lsp.config("qmlls", { + cmd = { "qmlls6", "-E" } +}) vim.lsp.config("lemminx", {}) vim.lsp.config("eslint", { cmd = { "vscode-eslint-language-server", "--stdio" }, @@ -46,7 +49,7 @@ vim.lsp.config("eslint", { }, }) -vim.lsp.enable({ "angularls", "odoo_ls", "hls", "ruff", "eslint", "cssls", "lua_ls", "lemminx" }) +vim.lsp.enable({ "angularls", "odoo_ls", "hls", "ruff", "eslint", "cssls", "lua_ls", "lemminx", "qmlls" }) vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('user_lsp_attach', { clear = true }), diff --git a/.config/nvim/after/plugin/treesitter.lua b/.config/nvim/after/plugin/treesitter.lua index b416fb8..22127bb 100644 --- a/.config/nvim/after/plugin/treesitter.lua +++ b/.config/nvim/after/plugin/treesitter.lua @@ -1,51 +1,42 @@ -require 'nvim-treesitter.config'.setup { - -- A list of parser names, or "all" (the listed parsers MUST always be installed) - ensure_installed = { - "vimdoc", - "javascript", - "typescript", - "c_sharp", - "c", - "lua", - "vim", - "vimdoc", - "query", - "markdown", - "markdown_inline", - "yaml" - }, +local ts = require('nvim-treesitter') - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, +ts.setup{} - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, +ts.install({ + "vimdoc", + "javascript", + "typescript", + "c_sharp", + "c", + "lua", + "vim", + "vimdoc", + "query", + "markdown", + "markdown_inline", + "yaml", + "haskell" +}) - ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) - -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! +vim.api.nvim_create_autocmd('FileType', { + callback = function(ev) + local lang = vim.treesitter.language.get_lang(ev.match) + local available_langs = ts.get_available() + local is_available = vim.tbl_contains(available_langs, lang) + if is_available then + local installed_langs = ts.get_installed() + local installed = vim.tbl_contains(installed_langs, lang) + if not installed then + ts.install(lang):await() + end + vim.treesitter.start() + ts.indentexpr() + end + vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()' + vim.wo[0][0].foldmethod = 'expr' + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end, +}) - highlight = { - enable = true, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, - - indent = { - enable = true, - disable = { "xml", "python" }, - }, - - fold = { - enable = true, - }, -} - -vim.o.foldmethod = "expr" -vim.o.foldexpr = "nvim_treesitter#foldexpr()" -vim.opt.foldlevel = 99 -vim.opt.foldlevelstart = 99 +vim.o.foldlevel = 99 +vim.o.foldlevelstart = 99 diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 4e4c2c6..3bd8946 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -21,20 +21,18 @@ "nvim-dap": { "branch": "master", "commit": "45a69eba683a2c448dd9ecfc4de89511f0646b5f" }, "nvim-dap-python": { "branch": "master", "commit": "1808458eba2b18f178f990e01376941a42c7f93b" }, "nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" }, - "nvim-lspconfig": { "branch": "master", "commit": "fb5fa30626ae10f7f79f740059d3769993936ecb" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-scrollbar": { "branch": "main", "commit": "f8e87b96cd6362ef8579be456afee3b38fd7e2a8" }, "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, "nvim-web-devicons": { "branch": "master", "commit": "95b7a002d5dba1a42eb58f5fac5c565a485eefd0" }, - "obsidian.nvim": { "branch": "main", "commit": "5ecc62fbc41b1112bb4f4a7a4305e8d601b567e8" }, "odoo-neovim": { "branch": "main", "commit": "6ea306ebcdfa1ee13524c05757f5e739cb2e8001" }, "oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" }, "persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "render-markdown.nvim": { "branch": "main", "commit": "54d4b5431e9634ee3d8d30784e017239b5b89d41" }, - "roslyn.nvim": { "branch": "main", "commit": "f2ec6ee6384c3b611ddc817b9e78b20cd0334bbb" }, "smear-cursor.nvim": { "branch": "main", "commit": "c85bdbb25db096fbcf616bc4e1357bd61fe2c199" }, "snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" }, + "strudel.nvim": { "branch": "main", "commit": "a6b9752b0084a20c37786b54eef2095bb31daff7" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "7ef4d6dccb78ee71e552bbd866176762ad328afa" }, "tidal.nvim": { "branch": "develop", "commit": "bcc9679a1932cfa2f75a38ddf3af18ed344da1fe" }, diff --git a/.config/nvim/lua/wicked/lazy.lua b/.config/nvim/lua/wicked/lazy.lua index bc435be..d6e8e73 100644 --- a/.config/nvim/lua/wicked/lazy.lua +++ b/.config/nvim/lua/wicked/lazy.lua @@ -61,7 +61,11 @@ require("lazy").setup({ }, }, 'odoo/odoo-neovim', - 'nvim-treesitter/nvim-treesitter', + { + 'nvim-treesitter/nvim-treesitter', + lazy = false, + build = ':TSUpdate' + }, { 'theprimeagen/harpoon', branch = 'harpoon2',