X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/dd35844f0c0ecb1eb059f60a66d55bd064df4fc2..1e773e058b070d5fb82b6d0086543c0dc156250f:/nvim/lua/plugins/coding.lua diff --git a/nvim/lua/plugins/coding.lua b/nvim/lua/plugins/coding.lua index 9238f1d..77d4955 100644 --- a/nvim/lua/plugins/coding.lua +++ b/nvim/lua/plugins/coding.lua @@ -1,22 +1,22 @@ ---@type LazySpec return { -- snippets - { - "L3MON4D3/LuaSnip", - -- disable luasnip bindings for and + { "l3mon4d3/luasnip", + build = "make install_jsregexp", -- optional dependencies = { - { - "honza/vim-snippets", - config = function() - require("luasnip.loaders.from_snipmate").lazy_load() - require("luasnip.loaders.from_lua").load({ paths = vim.fn.stdpath("config") .. "/lua/snippets" }) - end, - }, + { "honza/vim-snippets", }, }, + config = function() + local snippets = vim.fn.stdpath("config").."/snippets" + require("luasnip.loaders.from_snipmate").load({ paths = { snippets }}) + require("luasnip.loaders.from_lua").load({ paths = { snippets }}) + end, keys = function() return {} end, opts = { + history = true, + delete_check_events = "TextChanged", store_selection_keys = "", }, }, @@ -144,43 +144,91 @@ return { }, } end, - config = function(_, opts) - require("mini.ai").setup(opts) - LazyVim.on_load("which-key.nvim", function() - vim.schedule(function() - LazyVim.mini.ai_whichkey(opts) - end) - end) - end, }, - -- comments { "numToStr/Comment.nvim", - -- used to be what I use, but nvim will include commenting based on mini.comment - enabled = false , + dependencies = { + { "JoosepAlviste/nvim-ts-context-commentstring", -- nested language commenting (f.ex markdown code blocks) + opts = { enable_autocmd = false, }, + } + }, + opts = function(_, opts) + local tscci = require('ts_context_commentstring.integrations.comment_nvim') + vim.tbl_deep_extend('force', opts, { + toggler = { + line = "gcc", + block = "gbb", + }, + mappings = { + basic = true, + extra = true, + }, + pre_hook = tscci.create_pre_hook() + }) + return opts + end, + }, + { "danymat/neogen", -- Generate annotations like doxygen + cmd = "Neogen", + keys = { + { "cn", function() require("neogen").generate() end, desc = "Generate Annotations (Neogen)", }, + }, opts = { - toggler = { - line = "gcc", - block = "gbb", - }, - mappings = { - basic = true, - extra = true, - }, + snippet_engine = "luasnip", }, }, - { "echasnovski/mini.comment", enabled = false }, - - { - "folke/lazydev.nvim", + { "folke/lazydev.nvim", ft = "lua", cmd = "LazyDev", opts = { library = { { path = "${3rd}/luv/library", words = { "vim%.uv" } }, - { path = "LazyVim", words = { "LazyVim" } }, { path = "snacks.nvim", words = { "Snacks" } }, - { path = "lazy.nvim", words = { "LazyVim" } }, + { path = "lazy.nvim", words = { "LazySpec" } }, + }, + }, + }, + { "gbprod/yanky.nvim", enabled = false, -- better yank/paste + -- TODO: integrate? + -- I'm not entirely convinced, it doesn't provide functionality like vim-peekaboo, + -- maybe it can supplement it though? + -- Also, see issues on OSC52: https://github.com/gbprod/yanky.nvim/issues/213 + recommended = true, + desc = "Better Yank/Paste", + event = "LazyFile", + opts = { + highlight = { timer = 150 }, + }, + keys = { + { + "p", + function() vim.cmd([[YankyRingHistory]]) end, + mode = { "n", "x" }, + desc = "Open Yank History", }, + -- stylua: ignore + { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" }, + { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Text After Cursor" }, + { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Text Before Cursor" }, + { "gp", "(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Text After Selection" }, + { "gP", "(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Text Before Selection" }, + { "[y", "(YankyCycleForward)", desc = "Cycle Forward Through Yank History" }, + { "]y", "(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" }, + { "]p", "(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, + { "[p", "(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" }, + { "]P", "(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, + { "[P", "(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" }, + { ">p", "(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" }, + { "(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" }, + { ">P", "(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" }, + { "(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" }, + { "=p", "(YankyPutAfterFilter)", desc = "Put After Applying a Filter" }, + { "=P", "(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" }, }, }, + + { "andrewferrier/debugprint.nvim", + dependencies = { "nvim-treesitter" }, + -- TODO: setup debugprint (or maybe not) + opts = { } + } }