X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/40347709de69309d944058ddde2383107dbd9036..4ff0f8e91ba57d1c6bcab470ae41ae152dfee814:/nvim/lua/plugins/coding.lua diff --git a/nvim/lua/plugins/coding.lua b/nvim/lua/plugins/coding.lua index 6e8adc9..6194756 100644 --- a/nvim/lua/plugins/coding.lua +++ b/nvim/lua/plugins/coding.lua @@ -4,6 +4,14 @@ return { { "L3MON4D3/LuaSnip", -- disable luasnip bindings for and + dependencies = { + { + "honza/vim-snippets", + config = function() + require("luasnip.loaders.from_snipmate").lazy_load() + end, + }, + }, keys = function() return {} end, @@ -12,6 +20,7 @@ return { -- auto completion { "hrsh7th/nvim-cmp", + ---@param opts cmp.ConfigSchema opts = function(_, opts) local has_words_before = function() unpack = unpack or table.unpack @@ -23,7 +32,7 @@ return { local luasnip = require("luasnip") opts.completion = vim.tbl_extend("force", opts.completion, { - completeopt = "menu,menuone,noinsert", + completeopt = "menu,menuone,noselect", }) --TODO: review if I want to keep any of LazyVim's mappings opts.mapping = vim.tbl_extend("force", opts.mapping, { @@ -50,4 +59,31 @@ return { }) end, }, + + -- auto pairs + { + "echasnovski/mini.pairs", + }, + + -- surround + { + "echasnovski/mini.surround", + keys = { + { "S", "lua MiniSurround.add('visual')", "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 = "", + }, + }, + }, }