]> git.rmz.io Git - dotfiles.git/blobdiff - nvim/lua/plugins/coding.lua
nvim/coding: switch to comments.nvim
[dotfiles.git] / nvim / lua / plugins / coding.lua
index a765a79ae258c206207843c4ab7fa35242f035d7..c1b1c39a8e3b61301105fed7e2d8911e91ce0dd0 100644 (file)
@@ -4,6 +4,14 @@ return {
   {
     "L3MON4D3/LuaSnip",
     -- disable luasnip bindings for <tab> and <s-tab>
   {
     "L3MON4D3/LuaSnip",
     -- disable luasnip bindings for <tab> and <s-tab>
+    dependencies = {
+      {
+        "honza/vim-snippets",
+        config = function()
+          require("luasnip.loaders.from_snipmate").lazy_load()
+        end,
+      },
+    },
     keys = function()
       return {}
     end,
     keys = function()
       return {}
     end,
@@ -51,4 +59,47 @@ return {
       })
     end,
   },
       })
     end,
   },
+
+  -- auto pairs
+  {
+    "echasnovski/mini.pairs",
+  },
+
+  -- surround
+  {
+    "echasnovski/mini.surround",
+    keys = {
+      { "S", "<cmd><C-u>lua MiniSurround.add('visual')<cr>", "x" },
+      { "yss", "ys_", remap = true },
+    },
+    opts = {
+      mappings = {
+        -- TODO: this is tpope/surround like, but should consider using vim-sandwich mappings
+        -- see: :h MiniSurround-vim-surround-config
+        add = "ys",
+        delete = "ds",
+        find = "",
+        find_left = "",
+        highlight = "",
+        replace = "cs",
+        update_n_lines = "",
+      },
+    },
+  },
+  -- comments
+  {
+    "numToStr/Comment.nvim",
+    opts = {
+      toggler = {
+        line = "gcc",
+        block = "gbb",
+      },
+      mappings = {
+        basic = true,
+        extra = true,
+      },
+    },
+  },
+  { "JoosepAlviste/nvim-ts-context-commentstring", enabled = false },
+  { "echasnovski/mini.comment", enabled = false },
 }
 }