diff --git a/lazy-lock.json b/lazy-lock.json index 71431fe..3a106fd 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -27,6 +27,8 @@ "nvim-lspconfig": { "branch": "master", "commit": "a67bc39aaa4f1e13212c5022a561120846eaef27" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-treesitter": { "branch": "master", "commit": "047ce49ccf9a2dce22e1cf3843bef3b5682a8144" }, + "nvim-treesitter-context": { "branch": "master", "commit": "7f7eeaa99e5a9beab518f502292871ae5f20de6f" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, diff --git a/lua/plugins/style.lua b/lua/plugins/style.lua index d35225a..a36e4b5 100644 --- a/lua/plugins/style.lua +++ b/lua/plugins/style.lua @@ -39,6 +39,39 @@ return { end, dependencies = { 'nvim-treesitter/playground' } }, + { + "nvim-treesitter/nvim-treesitter-context", + dependencies = { 'nvim-treesitter/nvim-treesitter' } + }, + { + "nvim-treesitter/nvim-treesitter-textobjects", + dependencies = { 'nvim-treesitter/nvim-treesitter' }, + config = function() + require("nvim-treesitter.configs").setup({ + textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + } + }, + swap = { + enable = true, + swap_next = { + ["a"] = "@parameter.inner", + }, + swap_previous = { + ["A"] = "@parameter.inner", + }, + }, + } + }) + end + }, { 'akinsho/bufferline.nvim', version = "*",