diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua index cdc423a..1456284 100644 --- a/lua/plugins/none-ls.lua +++ b/lua/plugins/none-ls.lua @@ -5,14 +5,28 @@ return { }, config = function() local null_ls = require("null-ls") + local formatting = null_ls.builtins.formatting + + local prettypst = { + name = "prettypst", + method = require("null-ls").methods.FORMATTING, + filetypes = { "typst" }, + generator = require("null-ls.helpers").formatter_factory({ + command = vim.fn.stdpath("data") .. "/mason/bin/prettypst", + args = { "-" }, + to_stdin = true, + }), + } + null_ls.setup({ sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.formatting.black, - null_ls.builtins.formatting.isort, - null_ls.builtins.formatting.prettier.with({ + formatting.stylua, + formatting.black, + formatting.isort, + formatting.prettier.with({ extra_filetypes = { "svelte" }, }), + prettypst, }, }) diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 033094c..4f0822b 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -25,6 +25,14 @@ return { -- You can use the capture groups defined in textobjects.scm ["af"] = "@function.outer", ["if"] = "@function.inner", + ["ai"] = "@conditional.outer", + ["ii"] = "@conditional.inner", + ["ao"] = "@block.outer", + ["io"] = "@block.inner", + ["aO"] = "@object.outer", + ["iO"] = "@object.inner", + ["aa"] = "@array.outer", + ["ia"] = "@array.inner", }, -- You can choose the select mode (default is charwise 'v') -- @@ -33,11 +41,7 @@ return { -- * method: eg 'v' or 'o' -- and should return the mode ('v', 'V', or '') or a table -- mapping query_strings to modes. - selection_modes = { - ["@parameter.outer"] = "v", -- charwise - ["@function.outer"] = "v", - ["@class.outer"] = "", -- blockwise - }, + selection_modes = {}, -- If you set this to `true` (default is `false`) then any textobject is -- extended to include preceding or succeeding whitespace. Succeeding -- whitespace has priority in order to act similarly to eg the built-in