From 102af95a0bf90f093575aba512ff888e0a8d765f Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Fri, 26 Apr 2024 16:57:31 -0600 Subject: [PATCH] feat: move coding-related plugins to `coding.lua` This is the first commit of my v2 update. I am following the LazyVim pattern for organizing all of my configuration options. I like LazyVim a lot and would use it myself - except I have an obsession with tinkering and doing this part myself. So I shall! --- lazy-lock.json | 44 +++++++++---------- lua/plugins/coding.lua | 86 ++++++++++++++++++++++++++++++++++++++ lua/plugins/commentary.lua | 3 -- lua/plugins/completion.lua | 59 -------------------------- lua/plugins/hardtime.lua | 28 ------------- lua/plugins/surround.lua | 3 -- 6 files changed, 109 insertions(+), 114 deletions(-) create mode 100644 lua/plugins/coding.lua delete mode 100644 lua/plugins/commentary.lua delete mode 100644 lua/plugins/completion.lua delete mode 100644 lua/plugins/hardtime.lua delete mode 100644 lua/plugins/surround.lua diff --git a/lazy-lock.json b/lazy-lock.json index 06761ad..310898c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,33 +1,35 @@ { - "LuaSnip": { "branch": "master", "commit": "79cc25c39878401d4e8b6ec42fcf14639426bafc" }, + "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, - "conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" }, - "hardtime.nvim": { "branch": "main", "commit": "21b0f9146198bb43fbc9f5ec66c8af3234f278ed" }, + "conform.nvim": { "branch": "master", "commit": "4660e534bf7678ee0f85879aa75fdcb6855612c2" }, + "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, - "lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "1212fb6082b7177dde17ea65e429e027835aeb40" }, + "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "b129892f783740e6cf741f2ea09fa5dd512aa584" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "16d1b194376bf1fc2acd89ccb3c29ba8315bfcea" }, + "mini.comment": { "branch": "main", "commit": "f9f1a646fd3d9df7397aa1b9550a875fe8189eb0" }, + "mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" }, + "mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" }, + "mini.surround": { "branch": "main", "commit": "a00d69be09e3fe27dfa9e5b0298410d0e148e3e2" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, - "nvim-autopairs": { "branch": "master", "commit": "dbfc1c34bed415906395db8303c71039b3a3ffb4" }, - "nvim-cmp": { "branch": "main", "commit": "2fb2a3cf78bbc1b0bea030e8c8728985af1cf302" }, - "nvim-lint": { "branch": "master", "commit": "6670b3ac73fa4caf720f017b91c619e9424d955e" }, - "nvim-lspconfig": { "branch": "master", "commit": "f4619ab31fc4676001ea05ae8200846e6e7700c7" }, - "nvim-treesitter": { "branch": "master", "commit": "30492e7e1c9e5af3642e8a74c2f88dc1f50ec305" }, - "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, - "nvim-web-devicons": { "branch": "master", "commit": "3ee60deaa539360518eaab93a6c701fe9f4d82ef" }, - "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, + "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, + "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, + "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, + "nvim-lspconfig": { "branch": "master", "commit": "7133e85c3df14a387da8942c094c7edddcdef309" }, + "nvim-treesitter": { "branch": "master", "commit": "3ef8d25df2d8eca6f15a6889cb2bc9d4c6101096" }, + "nvim-treesitter-context": { "branch": "master", "commit": "4fe0a54e86859744968e1a5c7867b49c86855774" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, + "nvim-web-devicons": { "branch": "master", "commit": "beb6367ab8496c9e43f22e0252735fdadae1872d" }, + "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, - "tokyonight.nvim": { "branch": "main", "commit": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5" }, + "tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" }, "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, - "vim-commentary": { "branch": "master", "commit": "f67e3e67ea516755005e6cccb178bc8439c6d402" }, - "vim-fugitive": { "branch": "master", "commit": "c0b03f1cac242d96837326d300f42a660306fc1a" }, - "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua new file mode 100644 index 0000000..35e93d5 --- /dev/null +++ b/lua/plugins/coding.lua @@ -0,0 +1,86 @@ +return { + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-nvim-lsp" }, + config = function() + local cmp = require("cmp") + + cmp.setup({ + -- Highlights the first result always + completion = { + completeopt = "menu,menuone,noinsert", + }, + + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { "i" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { "i" }), + [""] = cmp.mapping.confirm({ + behaviour = cmp.ConfirmBehavior.Insert, + select = true, + }), + }), + + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, + }, + { + "L3MON4D3/LuaSnip", + dependencies = { "rafamadriz/friendly-snippets" }, + }, + { + "echasnovski/mini.pairs", + version = false, + opts = {}, + }, + { + "echasnovski/mini.surround", + version = false, + opts = {}, + }, + { + "JoosepAlviste/nvim-ts-context-commentstring", + opts = { + enable_autocmd = false, + }, + }, + { + "echasnovski/mini.comment", + version = false, + opts = { + options = { + custom_commentstring = function() + return require("ts_context_commentstring.internal").calculate_commentstring() + or vim.bo.commentstring + end, + }, + }, + }, +} diff --git a/lua/plugins/commentary.lua b/lua/plugins/commentary.lua deleted file mode 100644 index 4e85c75..0000000 --- a/lua/plugins/commentary.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "tpope/vim-commentary" -} diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua deleted file mode 100644 index 6696501..0000000 --- a/lua/plugins/completion.lua +++ /dev/null @@ -1,59 +0,0 @@ -return { - { - "hrsh7th/nvim-cmp", - config = function() - local cmp = require("cmp") - - cmp.setup({ - -- Highlights the first result always - completion = { - completeopt = "menu,menuone,noinsert" - }, - - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, { "i" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { "i" }), - [""] = cmp.mapping.confirm({ - behaviour = cmp.ConfirmBehavior.Insert, - select = true - }) - }), - - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end - }, - - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" } - }, { - { name = "buffer" } - }) - }) - end - }, - { - "hrsh7th/cmp-nvim-lsp" - }, - { - "L3MON4D3/LuaSnip" - } -} diff --git a/lua/plugins/hardtime.lua b/lua/plugins/hardtime.lua deleted file mode 100644 index 47b18eb..0000000 --- a/lua/plugins/hardtime.lua +++ /dev/null @@ -1,28 +0,0 @@ -return { - "m4xshen/hardtime.nvim", - dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" }, - opts = { - disable_mouse = true, - disabled_keys = { - -- Drill Sergeant Demchuk! - [""] = { "", "i" }, - [""] = { "", "i" }, - [""] = { "", "i" }, - [""] = { "", "i" }, - }, - disabled_filetypes = { - "checkhealth", - "fugitive", - "help", - "lazy", - "mason", - "markdown", - "neo-tree", - "neo-tree-popup", - "netrw", - "noice", - "notify", - "qf", - }, - }, -} diff --git a/lua/plugins/surround.lua b/lua/plugins/surround.lua deleted file mode 100644 index b5dd6ff..0000000 --- a/lua/plugins/surround.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "tpope/vim-surround" -}