diff options
Diffstat (limited to 'nvim/.config')
-rw-r--r-- | nvim/.config/nvim/lazy-lock.json | 1 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/tobyvin/plugins/comment.lua | 16 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/tobyvin/plugins/init.lua | 9 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/tobyvin/plugins/treesitter.lua | 17 |
4 files changed, 25 insertions, 18 deletions
diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index f8d08ac..627d165 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -51,7 +51,6 @@ "nvim-treesitter-textobjects": { "branch": "master", "commit": "85a6f9d1af8b731f09f4031e1f9478d4b40d13ab" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "0bf8fbc2ca8f8cdb6efbd0a9e32740d7a991e4c3" }, "nvim-ts-hint-textobject": { "branch": "master", "commit": "5a28bff46c05d28bdb4bcaef67e046eb915a9390" }, - "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" }, "plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "pretty-fold.nvim": { "branch": "master", "commit": "a7d8b424abe0eedf50116c460fbe6dfd5783b1d5" }, diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/comment.lua b/nvim/.config/nvim/lua/tobyvin/plugins/comment.lua new file mode 100644 index 0000000..fa14f6f --- /dev/null +++ b/nvim/.config/nvim/lua/tobyvin/plugins/comment.lua @@ -0,0 +1,16 @@ +---@type LazyPluginSpec +local M = { + "numToStr/Comment.nvim", + version = "*", + event = "BufReadPre", + dependencies = { + "JoosepAlviste/nvim-ts-context-commentstring", + }, +} + +function M:config(opts) + opts.pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook() + require("Comment").setup(opts) +end + +return M diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/init.lua b/nvim/.config/nvim/lua/tobyvin/plugins/init.lua index 7ae53df..dd6d0d4 100644 --- a/nvim/.config/nvim/lua/tobyvin/plugins/init.lua +++ b/nvim/.config/nvim/lua/tobyvin/plugins/init.lua @@ -22,12 +22,9 @@ local M = { { "nvim-treesitter/nvim-treesitter-context", event = "BufReadPre", - config = true, - }, - { - "numToStr/Comment.nvim", - version = "*", - event = "BufReadPre", + dependencies = { + "nvim-treesitter/nvim-treesitter", + }, config = true, }, { diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/treesitter.lua b/nvim/.config/nvim/lua/tobyvin/plugins/treesitter.lua index 9be46f4..8076edb 100644 --- a/nvim/.config/nvim/lua/tobyvin/plugins/treesitter.lua +++ b/nvim/.config/nvim/lua/tobyvin/plugins/treesitter.lua @@ -6,14 +6,8 @@ local M = { "nvim-treesitter/nvim-treesitter-textobjects", "JoosepAlviste/nvim-ts-context-commentstring", "mfussenegger/nvim-ts-hint-textobject", - { "nvim-treesitter/playground", cmd = "TSPlaygroundToggle" }, }, -} - -function M.config() - local treesitter = require("nvim-treesitter.configs") - - treesitter.setup({ + opts = { ensure_installed = { "bash", "c", @@ -58,9 +52,6 @@ function M.config() highlight = { enable = true, }, - playground = { - enable = true, - }, textobjects = { move = { enable = true, @@ -118,7 +109,11 @@ function M.config() lua = "-- %s", }, }, - }) + }, +} + +function M:config(opts) + require("nvim-treesitter.configs").setup(opts) vim.opt.foldmethod = "expr" vim.opt.foldexpr = "nvim_treesitter#foldexpr()" |