refactor(nvim): update plugins to use lazy nvim spec's

This commit is contained in:
Price Hiller 2023-05-13 05:16:01 -05:00
parent ec657f89b2
commit abbe1a03b0
No known key found for this signature in database

View File

@ -93,71 +93,13 @@ lazy.setup({
{ url = "https://gitlab.com/HiPhish/nvim-ts-rainbow2.git" }, { url = "https://gitlab.com/HiPhish/nvim-ts-rainbow2.git" },
"nvim-treesitter/nvim-treesitter-context", "nvim-treesitter/nvim-treesitter-context",
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
"nvim-treesitter/nvim-treesitter-textobjects",
}, },
config = function() config = function()
require("plugins.configs.treesitter") require("plugins.configs.treesitter")
end, end,
}, },
{
"nvim-treesitter/nvim-treesitter-textobjects",
event = "VeryLazy",
config = function()
require("nvim-treesitter.configs").setup({
textobjects = {
select = {
enable = true,
lookahead = true,
disable = function(lang, bufnr)
local mode = vim.fn.mode()
if mode == "c" then
return true
end
end,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["ib"] = "@block.inner",
["ab"] = "@block.outer",
},
},
move = {
enable = true,
disable = function(lang, bufnr)
local mode = vim.fn.mode()
if mode == "c" then
return true
end
end,
set_jumps = true,
goto_next_start = {
["]fs"] = "@function.outer",
["]cs"] = "@class.outer",
["]bs"] = "@block.outer",
},
goto_next_end = {
["]fe"] = "@function.outer",
["]ce"] = "@class.outer",
["]be"] = "@block.outer",
},
goto_previous_start = {
["[fs"] = "@function.outer",
["[cs"] = "@class.outer",
["[bs"] = "@block.outer",
},
goto_previous_end = {
["[fe"] = "@function.outer",
["[ce"] = "@class.outer",
["[bs"] = "@block.outer",
},
},
},
})
end,
},
-- Dashboard when no file is given to nvim -- Dashboard when no file is given to nvim
{ {
"goolord/alpha-nvim", "goolord/alpha-nvim",
@ -212,7 +154,6 @@ lazy.setup({
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
event = "BufReadPre", event = "BufReadPre",
dependencies = { dependencies = {
"hrsh7th/cmp-nvim-lsp",
"folke/neodev.nvim", "folke/neodev.nvim",
"Decodetalkers/csharpls-extended-lsp.nvim", "Decodetalkers/csharpls-extended-lsp.nvim",
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
@ -255,18 +196,14 @@ lazy.setup({
{ {
"smjonas/inc-rename.nvim", "smjonas/inc-rename.nvim",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {},
require("inc_rename").setup({})
end,
}, },
-- Better LSP Virtual Text Lines -- Better LSP Virtual Text Lines
{ {
url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim", url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {},
require("lsp_lines").setup()
end,
}, },
-- Lsp From Null LS -- Lsp From Null LS
@ -282,20 +219,7 @@ lazy.setup({
{ {
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {},
require("nvim-autopairs").setup()
end,
},
-- Snippets
{
"L3MON4D3/LuaSnip",
build = "make install_jsregexp",
event = "VeryLazy",
dependencies = {
"rafamadriz/friendly-snippets",
"saadparwaiz1/cmp_luasnip",
},
}, },
-- Code completion -- Code completion
@ -315,7 +239,16 @@ lazy.setup({
"lukas-reineke/cmp-rg", "lukas-reineke/cmp-rg",
"onsails/lspkind.nvim", "onsails/lspkind.nvim",
"f3fora/cmp-spell", "f3fora/cmp-spell",
-- Snippets
{
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
build = "make install_jsregexp",
event = "VeryLazy",
dependencies = {
"rafamadriz/friendly-snippets",
"saadparwaiz1/cmp_luasnip",
},
},
}, },
config = function() config = function()
require("plugins.configs._cmp") require("plugins.configs._cmp")
@ -331,9 +264,7 @@ lazy.setup({
"saecki/crates.nvim", "saecki/crates.nvim",
dependencies = { { "nvim-lua/plenary.nvim" } }, dependencies = { { "nvim-lua/plenary.nvim" } },
ft = "toml", ft = "toml",
config = function() opts = {},
require("crates").setup()
end,
}, },
-- DAP, debugger -- DAP, debugger
@ -359,9 +290,7 @@ lazy.setup({
{ {
"theHamsta/nvim-dap-virtual-text", "theHamsta/nvim-dap-virtual-text",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {},
require("nvim-dap-virtual-text").setup({})
end,
}, },
-- Fancy ui for dap -- Fancy ui for dap
@ -415,41 +344,33 @@ lazy.setup({
{ {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {
require("gitsigns").setup({
current_line_blame = true, current_line_blame = true,
current_line_blame_opts = { current_line_blame_opts = {
delay = 0, delay = 0,
}, },
}) },
end,
}, },
-- Highlight certain comments, TODO, BUG, etc. -- Highlight certain comments, TODO, BUG, etc.
{ {
"folke/todo-comments.nvim", "folke/todo-comments.nvim",
event = "VeryLazy", cmd = {
config = function() "TodoTrouble",
require("todo-comments").setup({}) },
end, opts = {},
}, },
-- Show possible key bindings during typing -- Show possible key bindings during typing
{ {
"folke/which-key.nvim", "folke/which-key.nvim",
event = "VeryLazy", lazy = true,
config = function() opts = {},
require("which-key").setup({})
end,
}, },
-- Create full path if not existing on write -- Create full path if not existing on write
{ {
"jghauser/mkdir.nvim", "jghauser/mkdir.nvim",
event = "VeryLazy",
config = function()
require("mkdir")
end,
}, },
-- Text commenting -- Text commenting
@ -476,11 +397,9 @@ lazy.setup({
{ "tami5/sqlite.lua" }, { "tami5/sqlite.lua" },
{ "nvim-telescope/telescope.nvim" }, { "nvim-telescope/telescope.nvim" },
}, },
config = function() opts = {
require("neoclip").setup({
enable_persistent_history = true, enable_persistent_history = true,
}) },
end,
}, },
-- Markdown Previewer -- Markdown Previewer
@ -497,33 +416,23 @@ lazy.setup({
-- Better Git integration -- Better Git integration
{ {
"TimUntersberger/neogit", "TimUntersberger/neogit",
event = "VeryLazy", lazy = true,
config = function() opts = {
require("neogit").setup({
disable_commit_confirmation = true, disable_commit_confirmation = true,
integrations = { integrations = {
diffview = true, diffview = true,
}, },
}) },
end,
dependencies = { dependencies = {
"sindrets/diffview.nvim", "sindrets/diffview.nvim",
}, },
}, },
-- Ansible Syntax Highlighting
{
"pearofducks/ansible-vim",
event = "VeryLazy",
},
-- Better search display -- Better search display
{ {
"kevinhwang91/nvim-hlslens", "kevinhwang91/nvim-hlslens",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {},
require("hlslens").setup()
end,
}, },
-- Note Taking -- Note Taking
@ -544,6 +453,7 @@ lazy.setup({
{ {
"MTDL9/vim-log-highlighting", "MTDL9/vim-log-highlighting",
event = "VeryLazy", event = "VeryLazy",
ft = "log",
}, },
-- Lots of small modules pulled into -- Lots of small modules pulled into
@ -560,11 +470,9 @@ lazy.setup({
{ {
"karb94/neoscroll.nvim", "karb94/neoscroll.nvim",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {
require("neoscroll").setup({
easing_function = "circular", easing_function = "circular",
}) },
end,
}, },
-- Generate function/class/etc annotations -- Generate function/class/etc annotations
@ -574,8 +482,7 @@ lazy.setup({
"Neogen", "Neogen",
}, },
dependencies = "nvim-treesitter/nvim-treesitter", dependencies = "nvim-treesitter/nvim-treesitter",
config = function() opts = {
require("neogen").setup({
snippet_engine = "luasnip", snippet_engine = "luasnip",
languages = { languages = {
cs = { cs = {
@ -584,8 +491,7 @@ lazy.setup({
}, },
}, },
}, },
}) },
end,
}, },
-- Multiple cursor/multiple visual selection support -- Multiple cursor/multiple visual selection support
@ -600,13 +506,11 @@ lazy.setup({
-- Maintain last cursor position in files -- Maintain last cursor position in files
{ {
"ethanholz/nvim-lastplace", "ethanholz/nvim-lastplace",
config = function() opts = {
require("nvim-lastplace").setup({
lastplace_ignore_buftype = { "quickfix", "nofile", "help" }, lastplace_ignore_buftype = { "quickfix", "nofile", "help" },
lastplace_ignore_filetype = { "gitcommit", "gitrebase", "svn", "hgcommit", "fugitive" }, lastplace_ignore_filetype = { "gitcommit", "gitrebase", "svn", "hgcommit", "fugitive" },
lastplace_open_folds = true, lastplace_open_folds = true,
}) },
end,
}, },
-- More codeactions -- More codeactions
@ -626,13 +530,9 @@ lazy.setup({
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
}, },
ft = "http", ft = "http",
config = function() opts = {
local rest_nvim = require("rest-nvim")
rest_nvim.setup({
-- This is a dev plugin, makes life easier
skip_ssl_verification = true, skip_ssl_verification = true,
}) },
end,
}, },
-- Allows repeating actions and more -- Allows repeating actions and more
@ -653,20 +553,23 @@ lazy.setup({
-- Faster motions -- Faster motions
{ {
"phaazon/hop.nvim", "phaazon/hop.nvim",
event = "VeryLazy", cmd = {
config = function() "HopLineStart",
-- you can configure Hop the way you like here; see :h hop-config "HopPattern",
require("hop").setup({ keys = "etovxqpdygfblzhckisuran" }) "HopWord",
end, "HopAnywhere",
"HopVertical",
},
opts = {
keys = "etovxqpdygfblzhckisuran",
},
}, },
-- Surround actions -- Surround actions
{ {
"kylechui/nvim-surround", "kylechui/nvim-surround",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {},
require("nvim-surround").setup({})
end,
}, },
-- Better list continuation -- Better list continuation
@ -679,17 +582,14 @@ lazy.setup({
"plaintex", "plaintex",
"norg", "norg",
}, },
config = function() opts = {},
require("autolist").setup({})
end,
}, },
-- Tint inactive windows -- Tint inactive windows
{ {
"levouh/tint.nvim", "levouh/tint.nvim",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {
require("tint").setup({
highlight_ignore_patterns = { highlight_ignore_patterns = {
"WinSeparator", "WinSeparator",
}, },
@ -710,8 +610,7 @@ lazy.setup({
end, end,
tint = -30, tint = -30,
saturation = 0.8, saturation = 0.8,
}) },
end,
}, },
-- Highlight argument definitions and usages -- Highlight argument definitions and usages
@ -719,9 +618,7 @@ lazy.setup({
"m-demare/hlargs.nvim", "m-demare/hlargs.nvim",
event = "VeryLazy", event = "VeryLazy",
dependencies = { "nvim-treesitter/nvim-treesitter" }, dependencies = { "nvim-treesitter/nvim-treesitter" },
config = function() opts = {},
require("hlargs").setup({})
end,
}, },
-- Vim Latex Support -- Vim Latex Support
@ -736,8 +633,7 @@ lazy.setup({
{ {
"akinsho/toggleterm.nvim", "akinsho/toggleterm.nvim",
config = function() opts = {
require("toggleterm").setup({
start_in_insert = false, start_in_insert = false,
direction = "float", direction = "float",
autochdir = true, autochdir = true,
@ -747,8 +643,7 @@ lazy.setup({
return term.name return term.name
end, end,
}, },
}) },
end,
cmd = { cmd = {
"ToggleTerm", "ToggleTerm",
"ToggleTermSetName", "ToggleTermSetName",
@ -769,8 +664,7 @@ lazy.setup({
cmd = { cmd = {
"Silicon", "Silicon",
}, },
config = function() opts = {
require("silicon").setup({
font = "FiraCode Nerd Font=20", font = "FiraCode Nerd Font=20",
theme = "Monokai Extended", theme = "Monokai Extended",
background = "#87F", background = "#87F",
@ -783,16 +677,14 @@ lazy.setup({
local icon = devicons.get_icon_by_filetype(vim.bo.filetype) local icon = devicons.get_icon_by_filetype(vim.bo.filetype)
return icon .. " " .. vim.fn.fnamemodify(vim.fn.bufname(vim.fn.bufnr()), ":~:.") return icon .. " " .. vim.fn.fnamemodify(vim.fn.bufname(vim.fn.bufnr()), ":~:.")
end, end,
}) },
end,
}, },
-- Nice sidebar cursor goodies -- Nice sidebar cursor goodies
{ {
"gen740/SmoothCursor.nvim", "gen740/SmoothCursor.nvim",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {
require("smoothcursor").setup({
priority = 8, priority = 8,
fancy = { fancy = {
enable = true, enable = true,
@ -808,8 +700,7 @@ lazy.setup({
}, },
}, },
disabled_filetypes = { "NeogitNotification" }, disabled_filetypes = { "NeogitNotification" },
}) },
end,
}, },
-- Color Picker -- Color Picker
@ -831,21 +722,19 @@ lazy.setup({
{ {
"stevearc/overseer.nvim", "stevearc/overseer.nvim",
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {},
require("overseer").setup()
end,
}, },
-- Better buffer deletion -- Better buffer deletion
{ {
"famiu/bufdelete.nvim", "famiu/bufdelete.nvim",
event = "VeryLazy", lazy = true,
}, },
-- Improved Visuals for Documentation -- Improved Visuals for Documentation
{ {
"lukas-reineke/headlines.nvim", "lukas-reineke/headlines.nvim",
config = true, opts = {},
ft = { ft = {
"markdown", "markdown",
"norg", "norg",
@ -863,11 +752,9 @@ lazy.setup({
"NibblerHexStringToCArray", "NibblerHexStringToCArray",
"NibblerToggle", "NibblerToggle",
}, },
config = function() opts = {
require("nibbler").setup({ display_enabled = true,
display_enabled = true, -- Set to false to disable real-time display (default: true) },
})
end,
}, },
-- Preview Norm commands, global, macros -- Preview Norm commands, global, macros