From 63c1ed5104150f8d94bbfd6920d470cb553b38f2 Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:43:16 +0100 Subject: [PATCH] Revert "feat(nvim): Replace Comment.nvim & nvim-ts-context-commentstring with ts-comments.nvim & builtin comment command" This reverts commit 2017028fc103efda7871bf690c722961ec99d7ae. --- nvim/lazy-lock.json | 5 ++--- nvim/lua/plugin/Comment.lua | 13 +++++++++++++ nvim/lua/plugin/nvim-ts-context-commentstring.lua | 11 +++++++++++ nvim/lua/plugin/ts-comments.lua | 7 ------- 4 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 nvim/lua/plugin/Comment.lua create mode 100644 nvim/lua/plugin/nvim-ts-context-commentstring.lua delete mode 100644 nvim/lua/plugin/ts-comments.lua diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 2727fa17..5aa3f0c3 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,4 +1,5 @@ { + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "CopilotChat.nvim": { "branch": "canary", "commit": "9e7010bd33808e31d3f729b5e18a772d8e84f704" }, "actions-preview.nvim": { "branch": "master", "commit": "9f52a01c374318e91337697ebed51c6fae57f8a4" }, "alpha-nvim": { "branch": "main", "commit": "b6f4129302db197a7249e67a90de3f2b676de13e" }, @@ -51,7 +52,6 @@ "flask-snippets": { "branch": "master", "commit": "db0a50c214b541c5514cdfcae221bdd236cd39d1" }, "flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "fuzzy-motion.vim": { "branch": "main", "commit": "f926a6080489d03b08af66cdd1e89b8c2f5c4f39" }, "garbage-day.nvim": { "branch": "main", "commit": "4a1160bfffb2f499fb55a54333f29d160ab3c8a1" }, "gh-actions-cache": { "branch": "main", "commit": "0e7c371e56e408bcc06c06001b29593f488b8d31" }, "gh-copilot": { "branch": "main", "commit": "f85a1926cb1c9369a2f1ad7f8a1a7b074ba12eab" }, @@ -81,7 +81,6 @@ "live-command.nvim": { "branch": "main", "commit": "d460067d47948725a6f25b20f31ea8bbfdfe4622" }, "lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" }, "mark-code-action.nvim": { "branch": "main", "commit": "8d5f356ac837e8041b2b9242c40a95eb7191884b" }, - "markdown.nvim": { "branch": "main", "commit": "3b8f191d8acbd75d55665d0ffc27fce659361249" }, "marks.nvim": { "branch": "master", "commit": "bb25ae3f65f504379e3d08c8a02560b76eaf91e8" }, "mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" }, "mini.jump": { "branch": "stable", "commit": "5c656080cc0be1d60c4b7b6e0d4b1ab7ed2d902b" }, @@ -120,6 +119,7 @@ "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "a8d2844bba925d9450ef7ab215f3b054028288ca" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "375c2d86cee6674afd75b4f727ce3a80065552f7" }, "nvim-vtsls": { "branch": "main", "commit": "45c6dfea9f83a126e9bfc5dd63430562b3f8af16" }, "nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" }, "nvim_context_vt": { "branch": "master", "commit": "03fb506bbd5fdbb2b21ac6b0fe38ed40e339b143" }, @@ -175,7 +175,6 @@ "todo-comments.nvim": { "branch": "main", "commit": "319c01b99b7a8c9ac2066bf0efd4d6ec68fef444" }, "treesitter-unit": { "branch": "main", "commit": "89968a1f8c72427691088e6d09d26a52c2ddc6f4" }, "troublesum.nvim": { "branch": "master", "commit": "b00301bb565bfcb6fcfa41f2012e43a0528da65b" }, - "ts-comments.nvim": { "branch": "main", "commit": "98d7d4dec0af1312d38e288f800bbf6ff562b6ab" }, "ts-error-translator.nvim": { "branch": "main", "commit": "11ae55b28bde02663b5f983f59b0e3fd9c4e845b" }, "tsnode-marker.nvim": { "branch": "main", "commit": "551b617629c3bd0ff6c98d89d679e405f28deeb7" }, "ugaterm.nvim": { "branch": "main", "commit": "19c489918a15926464d86a11d6bb4466f0838bb1" }, diff --git a/nvim/lua/plugin/Comment.lua b/nvim/lua/plugin/Comment.lua new file mode 100644 index 00000000..2c061d86 --- /dev/null +++ b/nvim/lua/plugin/Comment.lua @@ -0,0 +1,13 @@ +return { + "numToStr/Comment.nvim", + event = "BufReadPost", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "JoosepAlviste/nvim-ts-context-commentstring", + }, + config = function() + require("Comment").setup({ + pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), + }) + end, +} diff --git a/nvim/lua/plugin/nvim-ts-context-commentstring.lua b/nvim/lua/plugin/nvim-ts-context-commentstring.lua new file mode 100644 index 00000000..091e62bf --- /dev/null +++ b/nvim/lua/plugin/nvim-ts-context-commentstring.lua @@ -0,0 +1,11 @@ +return { + "JoosepAlviste/nvim-ts-context-commentstring", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + init = function() + vim.g.skip_ts_context_commentstring_module = true + end, + opts = { + enable = true, + enable_autocmd = false, + }, +} diff --git a/nvim/lua/plugin/ts-comments.lua b/nvim/lua/plugin/ts-comments.lua deleted file mode 100644 index 92faaa6f..00000000 --- a/nvim/lua/plugin/ts-comments.lua +++ /dev/null @@ -1,7 +0,0 @@ ----@type LazySpec -return { - "folke/ts-comments.nvim", - opts = {}, - event = "VeryLazy", - enabled = vim.fn.has("nvim-0.10.0") == 1, -}