From d5dc2162889ba4c1c32064da542859f180528c68 Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Tue, 13 Feb 2024 14:05:37 -0500 Subject: [PATCH] refactor: code cleanup --- init.lua | 1 - lua/plugins/core.lua | 120 ++++++++++++++++++++++--------------------- lua/plugins/user.lua | 16 +++--- 3 files changed, 69 insertions(+), 68 deletions(-) diff --git a/init.lua b/init.lua index 0f0862f..87919e2 100644 --- a/init.lua +++ b/init.lua @@ -14,7 +14,6 @@ if not lazy_loaded then vim.cmd.quit() end ----@type LazyConfig lazy.setup({ { "AstroNvim/AstroNvim", diff --git a/lua/plugins/core.lua b/lua/plugins/core.lua index 680401a..75e363b 100644 --- a/lua/plugins/core.lua +++ b/lua/plugins/core.lua @@ -1,68 +1,70 @@ +if true then return {} end -- REMOVE THIS LINE TO ACTIVATE THIS FILE + -- You can simply override any internal plugins using Lazy, here are some example operations: ---@type LazySpec return { -- customize alpha options - -- { - -- "goolord/alpha-nvim", - -- opts = function(_, opts) - -- -- customize the dashboard header - -- opts.section.header.val = { - -- " █████ ███████ ████████ ██████ ██████", - -- "██ ██ ██ ██ ██ ██ ██ ██", - -- "███████ ███████ ██ ██████ ██ ██", - -- "██ ██ ██ ██ ██ ██ ██ ██", - -- "██ ██ ███████ ██ ██ ██ ██████", - -- " ", - -- " ███  ██ ██  ██ ██ ███  ███", - -- " ████  ██ ██  ██ ██ ████  ████", - -- " ██ ██  ██ ██  ██ ██ ██ ████ ██", - -- " ██  ██ ██  ██  ██  ██ ██  ██  ██", - -- " ██   ████   ████   ██ ██      ██", - -- } - -- return opts - -- end, - -- }, + { + "goolord/alpha-nvim", + opts = function(_, opts) + -- customize the dashboard header + opts.section.header.val = { + " █████ ███████ ████████ ██████ ██████", + "██ ██ ██ ██ ██ ██ ██ ██", + "███████ ███████ ██ ██████ ██ ██", + "██ ██ ██ ██ ██ ██ ██ ██", + "██ ██ ███████ ██ ██ ██ ██████", + " ", + " ███  ██ ██  ██ ██ ███  ███", + " ████  ██ ██  ██ ██ ████  ████", + " ██ ██  ██ ██  ██ ██ ██ ████ ██", + " ██  ██ ██  ██  ██  ██ ██  ██  ██", + " ██   ████   ████   ██ ██      ██", + } + return opts + end, + }, -- You can disable default plugins as follows: - -- { "max397574/better-escape.nvim", enabled = false }, + { "max397574/better-escape.nvim", enabled = false }, -- You can also easily customize additional setup of plugins that is outside of the plugin's setup call - -- { - -- "L3MON4D3/LuaSnip", - -- config = function(plugin, opts) - -- require "astronvim.plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call - -- -- add more custom luasnip configuration such as filetype extend or custom snippets - -- local luasnip = require "luasnip" - -- luasnip.filetype_extend("javascript", { "javascriptreact" }) - -- end, - -- }, - -- { - -- "windwp/nvim-autopairs", - -- config = function(plugin, opts) - -- require "astronvim.plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call - -- -- add more custom autopairs configuration such as custom rules - -- local npairs = require "nvim-autopairs" - -- local Rule = require "nvim-autopairs.rule" - -- local cond = require "nvim-autopairs.conds" - -- npairs.add_rules( - -- { - -- Rule("$", "$", { "tex", "latex" }) - -- -- don't add a pair if the next character is % - -- :with_pair(cond.not_after_regex "%%") - -- -- don't add a pair if the previous character is xxx - -- :with_pair( - -- cond.not_before_regex("xxx", 3) - -- ) - -- -- don't move right when repeat character - -- :with_move(cond.none()) - -- -- don't delete if the next character is xx - -- :with_del(cond.not_after_regex "xx") - -- -- disable adding a newline when you press - -- :with_cr(cond.none()), - -- }, - -- -- disable for .vim files, but it work for another filetypes - -- Rule("a", "a", "-vim") - -- ) - -- end, - -- }, + { + "L3MON4D3/LuaSnip", + config = function(plugin, opts) + require "astronvim.plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call + -- add more custom luasnip configuration such as filetype extend or custom snippets + local luasnip = require "luasnip" + luasnip.filetype_extend("javascript", { "javascriptreact" }) + end, + }, + { + "windwp/nvim-autopairs", + config = function(plugin, opts) + require "astronvim.plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call + -- add more custom autopairs configuration such as custom rules + local npairs = require "nvim-autopairs" + local Rule = require "nvim-autopairs.rule" + local cond = require "nvim-autopairs.conds" + npairs.add_rules( + { + Rule("$", "$", { "tex", "latex" }) + -- don't add a pair if the next character is % + :with_pair(cond.not_after_regex "%%") + -- don't add a pair if the previous character is xxx + :with_pair( + cond.not_before_regex("xxx", 3) + ) + -- don't move right when repeat character + :with_move(cond.none()) + -- don't delete if the next character is xx + :with_del(cond.not_after_regex "xx") + -- disable adding a newline when you press + :with_cr(cond.none()), + }, + -- disable for .vim files, but it work for another filetypes + Rule("a", "a", "-vim") + ) + end, + }, } diff --git a/lua/plugins/user.lua b/lua/plugins/user.lua index 5c739f8..9ebe118 100644 --- a/lua/plugins/user.lua +++ b/lua/plugins/user.lua @@ -1,12 +1,12 @@ +if true then return {} end -- REMOVE THIS LINE TO ACTIVATE THIS FILE + -- You can also add new plugins here as well using the lazy syntax: ---@type LazySpec return { - -- "andweeb/presence.nvim", - -- { - -- "ray-x/lsp_signature.nvim", - -- event = "BufRead", - -- config = function() - -- require("lsp_signature").setup() - -- end, - -- }, + "andweeb/presence.nvim", + { + "ray-x/lsp_signature.nvim", + event = "BufRead", + config = function() require("lsp_signature").setup() end, + }, }