2023-12-24 11:01:08 +00:00
|
|
|
-- All plugins have lazy=true by default,to load a plugin on startup just lazy=false
|
|
|
|
-- List of all default plugins & their definitions
|
|
|
|
local default_plugins = {
|
|
|
|
|
|
|
|
"nvim-lua/plenary.nvim",
|
|
|
|
|
|
|
|
{
|
|
|
|
"NvChad/base46",
|
|
|
|
branch = "v2.0",
|
|
|
|
build = function()
|
|
|
|
require("base46").load_all_highlights()
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"NvChad/ui",
|
|
|
|
branch = "v2.0",
|
|
|
|
lazy = false,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
2024-03-19 00:57:33 +00:00
|
|
|
"zbirenbaum/nvterm",
|
2023-12-24 11:01:08 +00:00
|
|
|
init = function()
|
|
|
|
require("core.utils").load_mappings "nvterm"
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
require "base46.term"
|
|
|
|
require("nvterm").setup(opts)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"NvChad/nvim-colorizer.lua",
|
2024-01-28 16:10:04 +00:00
|
|
|
event = "User FilePost",
|
2023-12-24 11:01:08 +00:00
|
|
|
config = function(_, opts)
|
|
|
|
require("colorizer").setup(opts)
|
|
|
|
|
|
|
|
-- execute colorizer as soon as possible
|
|
|
|
vim.defer_fn(function()
|
|
|
|
require("colorizer").attach_to_buffer(0)
|
|
|
|
end, 0)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"nvim-tree/nvim-web-devicons",
|
|
|
|
opts = function()
|
|
|
|
return { override = require "nvchad.icons.devicons" }
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "devicons")
|
|
|
|
require("nvim-web-devicons").setup(opts)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"lukas-reineke/indent-blankline.nvim",
|
|
|
|
version = "2.20.7",
|
2024-01-28 16:10:04 +00:00
|
|
|
event = "User FilePost",
|
2023-12-24 11:01:08 +00:00
|
|
|
opts = function()
|
|
|
|
return require("plugins.configs.others").blankline
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
require("core.utils").load_mappings "blankline"
|
|
|
|
dofile(vim.g.base46_cache .. "blankline")
|
|
|
|
require("indent_blankline").setup(opts)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
2024-01-28 16:10:04 +00:00
|
|
|
event = { "BufReadPost", "BufNewFile" },
|
2023-12-24 11:01:08 +00:00
|
|
|
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
|
|
|
|
build = ":TSUpdate",
|
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.treesitter"
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "syntax")
|
|
|
|
require("nvim-treesitter.configs").setup(opts)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- git stuff
|
|
|
|
{
|
|
|
|
"lewis6991/gitsigns.nvim",
|
2024-01-28 16:10:04 +00:00
|
|
|
event = "User FilePost",
|
2023-12-24 11:01:08 +00:00
|
|
|
opts = function()
|
|
|
|
return require("plugins.configs.others").gitsigns
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "git")
|
|
|
|
require("gitsigns").setup(opts)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- lsp stuff
|
|
|
|
{
|
|
|
|
"williamboman/mason.nvim",
|
|
|
|
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" },
|
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.mason"
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "mason")
|
|
|
|
require("mason").setup(opts)
|
|
|
|
|
|
|
|
-- custom nvchad cmd to install all mason binaries listed
|
|
|
|
vim.api.nvim_create_user_command("MasonInstallAll", function()
|
|
|
|
vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " "))
|
|
|
|
end, {})
|
|
|
|
|
|
|
|
vim.g.mason_binaries_list = opts.ensure_installed
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"neovim/nvim-lspconfig",
|
2024-01-28 16:10:04 +00:00
|
|
|
event = "User FilePost",
|
2023-12-24 11:01:08 +00:00
|
|
|
config = function()
|
|
|
|
require "plugins.configs.lspconfig"
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- load luasnips + cmp related in insert mode only
|
|
|
|
{
|
|
|
|
"hrsh7th/nvim-cmp",
|
|
|
|
event = "InsertEnter",
|
|
|
|
dependencies = {
|
|
|
|
{
|
|
|
|
-- snippet plugin
|
|
|
|
"L3MON4D3/LuaSnip",
|
|
|
|
dependencies = "rafamadriz/friendly-snippets",
|
|
|
|
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
|
|
|
config = function(_, opts)
|
|
|
|
require("plugins.configs.others").luasnip(opts)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- autopairing of (){}[] etc
|
|
|
|
{
|
|
|
|
"windwp/nvim-autopairs",
|
|
|
|
opts = {
|
|
|
|
fast_wrap = {},
|
|
|
|
disable_filetype = { "TelescopePrompt", "vim" },
|
|
|
|
},
|
|
|
|
config = function(_, opts)
|
|
|
|
require("nvim-autopairs").setup(opts)
|
|
|
|
|
|
|
|
-- setup cmp for autopairs
|
|
|
|
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
|
|
|
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- cmp sources plugins
|
|
|
|
{
|
|
|
|
"saadparwaiz1/cmp_luasnip",
|
|
|
|
"hrsh7th/cmp-nvim-lua",
|
|
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
|
|
"hrsh7th/cmp-buffer",
|
|
|
|
"hrsh7th/cmp-path",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.cmp"
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
require("cmp").setup(opts)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"numToStr/Comment.nvim",
|
|
|
|
keys = {
|
|
|
|
{ "gcc", mode = "n", desc = "Comment toggle current line" },
|
|
|
|
{ "gc", mode = { "n", "o" }, desc = "Comment toggle linewise" },
|
|
|
|
{ "gc", mode = "x", desc = "Comment toggle linewise (visual)" },
|
|
|
|
{ "gbc", mode = "n", desc = "Comment toggle current block" },
|
|
|
|
{ "gb", mode = { "n", "o" }, desc = "Comment toggle blockwise" },
|
|
|
|
{ "gb", mode = "x", desc = "Comment toggle blockwise (visual)" },
|
|
|
|
},
|
|
|
|
init = function()
|
|
|
|
require("core.utils").load_mappings "comment"
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
require("Comment").setup(opts)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
-- file managing , picker etc
|
|
|
|
{
|
|
|
|
"nvim-tree/nvim-tree.lua",
|
|
|
|
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
|
|
|
init = function()
|
|
|
|
require("core.utils").load_mappings "nvimtree"
|
|
|
|
end,
|
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.nvimtree"
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "nvimtree")
|
|
|
|
require("nvim-tree").setup(opts)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"nvim-telescope/telescope.nvim",
|
|
|
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
|
|
|
cmd = "Telescope",
|
|
|
|
init = function()
|
|
|
|
require("core.utils").load_mappings "telescope"
|
|
|
|
end,
|
|
|
|
opts = function()
|
|
|
|
return require "plugins.configs.telescope"
|
|
|
|
end,
|
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "telescope")
|
|
|
|
local telescope = require "telescope"
|
|
|
|
telescope.setup(opts)
|
|
|
|
|
|
|
|
-- load extensions
|
|
|
|
for _, ext in ipairs(opts.extensions_list) do
|
|
|
|
telescope.load_extension(ext)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
},
|
2024-04-03 11:58:41 +00:00
|
|
|
{
|
|
|
|
"elixir-tools/elixir-tools.nvim",
|
|
|
|
version = "*",
|
|
|
|
event = { "BufReadPre", "BufNewFile" },
|
|
|
|
config = function()
|
|
|
|
local elixir = require("elixir")
|
|
|
|
local elixirls = require("elixir.elixirls")
|
|
|
|
|
|
|
|
elixir.setup {
|
|
|
|
nextls = {enable = true},
|
|
|
|
credo = {},
|
|
|
|
elixirls = {
|
|
|
|
enable = true,
|
|
|
|
settings = elixirls.settings {
|
|
|
|
dialyzerEnabled = false,
|
|
|
|
enableTestLenses = false,
|
|
|
|
},
|
|
|
|
on_attach = function(client, bufnr)
|
|
|
|
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true })
|
|
|
|
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true })
|
|
|
|
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true })
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
dependencies = {
|
|
|
|
"nvim-lua/plenary.nvim",
|
|
|
|
},
|
|
|
|
},
|
2023-12-24 11:01:08 +00:00
|
|
|
|
|
|
|
-- Only load whichkey after all the gui
|
|
|
|
{
|
|
|
|
"folke/which-key.nvim",
|
|
|
|
keys = { "<leader>", "<c-r>", "<c-w>", '"', "'", "`", "c", "v", "g" },
|
|
|
|
init = function()
|
|
|
|
require("core.utils").load_mappings "whichkey"
|
|
|
|
end,
|
|
|
|
cmd = "WhichKey",
|
|
|
|
config = function(_, opts)
|
|
|
|
dofile(vim.g.base46_cache .. "whichkey")
|
|
|
|
require("which-key").setup(opts)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
local config = require("core.utils").load_config()
|
|
|
|
|
|
|
|
if #config.plugins > 0 then
|
|
|
|
table.insert(default_plugins, { import = config.plugins })
|
|
|
|
end
|
|
|
|
|
|
|
|
require("lazy").setup(default_plugins, config.lazy_nvim)
|