plugins: return to lazy.nvim's original syntax
This commit is contained in:
parent
f7b14809c6
commit
fd90625574
|
|
@ -1,15 +1,6 @@
|
|||
local M = {}
|
||||
local merge_tb = vim.tbl_deep_extend
|
||||
|
||||
M.format_plugins = function(plugins) local final_table = {}
|
||||
for key, _ in pairs(plugins) do
|
||||
plugins[key][1] = key
|
||||
final_table[#final_table + 1] = plugins[key]
|
||||
end
|
||||
|
||||
return final_table
|
||||
end
|
||||
|
||||
M.close_buffer = function(bufnr)
|
||||
if vim.bo.buftype == "terminal" then
|
||||
vim.cmd(vim.bo.buflisted and "set nobl | enew" or "hide")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
-- All plugins have lazy = true by default, to load a plugin on startup just lazy=false
|
||||
local plugins = {
|
||||
["~/repos/krose-pine"] = {
|
||||
dir = "~/repos/krose-pine",
|
||||
{ dir = "~/repos/krose-pine",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
|
|
@ -18,9 +17,9 @@ local plugins = {
|
|||
end
|
||||
},
|
||||
|
||||
['nvim-lua/plenary.nvim'] = {},
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
|
||||
["nvim-treesitter/nvim-treesitter"] = {
|
||||
{ "nvim-treesitter/nvim-treesitter",
|
||||
init = function()
|
||||
require("core.utils").lazy_load "nvim-treesitter"
|
||||
end,
|
||||
|
|
@ -31,7 +30,7 @@ local plugins = {
|
|||
end,
|
||||
},
|
||||
|
||||
["lewis6991/gitsigns.nvim"] = {
|
||||
{ "lewis6991/gitsigns.nvim",
|
||||
ft = "gitcommit",
|
||||
init = function()
|
||||
-- load gitsigns only when a git file is opened
|
||||
|
|
@ -53,7 +52,7 @@ local plugins = {
|
|||
end,
|
||||
},
|
||||
|
||||
["nvim-telescope/telescope.nvim"] = {
|
||||
{ "nvim-telescope/telescope.nvim",
|
||||
cmd = "Telescope",
|
||||
config = function()
|
||||
require "plugins.configs.telescope"
|
||||
|
|
@ -65,14 +64,14 @@ local plugins = {
|
|||
|
||||
-- lsp stuff
|
||||
|
||||
["williamboman/mason.nvim"] = {
|
||||
{ "williamboman/mason.nvim",
|
||||
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" },
|
||||
config = function()
|
||||
require "plugins.configs.mason"
|
||||
end,
|
||||
},
|
||||
|
||||
["neovim/nvim-lspconfig"] = {
|
||||
{ "neovim/nvim-lspconfig",
|
||||
init = function()
|
||||
require("core.utils").lazy_load "nvim-lspconfig"
|
||||
end,
|
||||
|
|
@ -81,7 +80,7 @@ local plugins = {
|
|||
end,
|
||||
},
|
||||
|
||||
["simrat39/rust-tools.nvim"] = {
|
||||
{ "simrat39/rust-tools.nvim",
|
||||
-- after = "nvim-lspconfig",
|
||||
event = "BufEnter *.rs",
|
||||
dependencies = "neovim/nvim-lspconfig",
|
||||
|
|
@ -91,7 +90,7 @@ local plugins = {
|
|||
end,
|
||||
},
|
||||
|
||||
["Saecki/crates.nvim"] = {
|
||||
{ "Saecki/crates.nvim",
|
||||
event = { "BufRead Cargo.toml" },
|
||||
config = function()
|
||||
require("crates").setup()
|
||||
|
|
@ -102,7 +101,7 @@ local plugins = {
|
|||
|
||||
-- load luasnips + cmp related in insert mode only
|
||||
|
||||
["hrsh7th/nvim-cmp"] = {
|
||||
{ "hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
{
|
||||
|
|
@ -138,7 +137,7 @@ local plugins = {
|
|||
},
|
||||
-- misc
|
||||
|
||||
['vimwiki/vimwiki'] = {
|
||||
{ 'vimwiki/vimwiki',
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.g.vimwiki_list = {
|
||||
|
|
@ -151,7 +150,7 @@ local plugins = {
|
|||
end,
|
||||
},
|
||||
|
||||
["numToStr/Comment.nvim"] = {
|
||||
{ "numToStr/Comment.nvim",
|
||||
-- keys = { "gc", "gb" },
|
||||
config = function()
|
||||
require("Comment").setup()
|
||||
|
|
@ -161,14 +160,14 @@ local plugins = {
|
|||
end,
|
||||
},
|
||||
|
||||
["mbbill/undotree"] = {
|
||||
{ "mbbill/undotree",
|
||||
cmd = "UndotreeToggle",
|
||||
init = function()
|
||||
require("core.utils").load_mappings "undotree"
|
||||
end,
|
||||
},
|
||||
|
||||
["krolyxon/kterm"] = {
|
||||
{ "krolyxon/kterm",
|
||||
config = function()
|
||||
require "plugins.configs.kterm"
|
||||
end,
|
||||
|
|
@ -179,7 +178,7 @@ local plugins = {
|
|||
|
||||
-- UI stuff
|
||||
|
||||
["lukas-reineke/indent-blankline.nvim"] = {
|
||||
{ "lukas-reineke/indent-blankline.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("plugins.configs.others").blankline()
|
||||
|
|
@ -190,7 +189,7 @@ local plugins = {
|
|||
end,
|
||||
},
|
||||
|
||||
["nvchad/nvim-colorizer.lua"] = {
|
||||
{ "nvchad/nvim-colorizer.lua",
|
||||
init = function()
|
||||
require("core.utils").lazy_load "nvim-colorizer.lua"
|
||||
end,
|
||||
|
|
@ -199,7 +198,7 @@ local plugins = {
|
|||
end,
|
||||
},
|
||||
|
||||
["nvim-lualine/lualine.nvim"] = {
|
||||
{ "nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.configs.statusline")
|
||||
|
|
@ -207,7 +206,7 @@ local plugins = {
|
|||
},
|
||||
|
||||
-- Only load whichkey after all the gui
|
||||
["folke/which-key.nvim"] = {
|
||||
{ "folke/which-key.nvim",
|
||||
enabled = true,
|
||||
keys = { "<leader>", "\"", "'", "`" },
|
||||
config = function()
|
||||
|
|
@ -219,8 +218,6 @@ local plugins = {
|
|||
},
|
||||
}
|
||||
|
||||
plugins = require("core.utils").format_plugins(plugins)
|
||||
|
||||
-- pin commits for all default plugins
|
||||
for _, value in pairs(plugins) do
|
||||
value.pin = true
|
||||
|
|
|
|||
Reference in New Issue