LunarVim/lua/lvim/plugins.lua

300 lines
6.7 KiB
Lua
Raw Normal View History

-- local require = require("lvim.utils.require").require
local core_plugins = {
2021-07-07 05:22:46 +02:00
-- Packer can manage itself as an optional plugin
{ "wbthomason/packer.nvim" },
{ "neovim/nvim-lspconfig" },
{ "tamago324/nlsp-settings.nvim" },
2021-11-16 15:55:45 +01:00
{
"jose-elias-alvarez/null-ls.nvim",
},
{ "williamboman/mason-lspconfig.nvim" },
{
"williamboman/mason.nvim",
config = function()
require("lvim.core.mason").setup()
end,
},
{
"folke/tokyonight.nvim",
},
{ "Tastyep/structlog.nvim" },
2021-07-10 19:27:52 +02:00
{ "nvim-lua/popup.nvim" },
{ "nvim-lua/plenary.nvim" },
2021-07-10 09:19:44 +02:00
-- Telescope
{
2021-07-07 05:22:46 +02:00
"nvim-telescope/telescope.nvim",
2022-07-23 14:16:43 +02:00
branch = "0.1.x",
config = function()
require("lvim.core.telescope").setup()
end,
disable = not lvim.builtin.telescope.active,
},
{
"nvim-telescope/telescope-fzf-native.nvim",
requires = { "nvim-telescope/telescope.nvim" },
run = "make",
disable = not lvim.builtin.telescope.active,
},
2021-09-08 01:23:14 +02:00
-- Install nvim-cmp, and buffer source as a dependency
{
2021-09-08 01:23:14 +02:00
"hrsh7th/nvim-cmp",
2021-07-07 05:22:46 +02:00
config = function()
if lvim.builtin.cmp then
require("lvim.core.cmp").setup()
end
end,
requires = {
"L3MON4D3/LuaSnip",
},
},
{
"rafamadriz/friendly-snippets",
disable = not lvim.builtin.luasnip.sources.friendly_snippets,
},
2021-11-06 19:19:35 +01:00
{
"L3MON4D3/LuaSnip",
config = function()
local utils = require "lvim.utils"
local paths = {}
if lvim.builtin.luasnip.sources.friendly_snippets then
paths[#paths + 1] = utils.join_paths(get_runtime_dir(), "site", "pack", "packer", "start", "friendly-snippets")
end
local user_snippets = utils.join_paths(get_config_dir(), "snippets")
if utils.is_directory(user_snippets) then
paths[#paths + 1] = user_snippets
end
require("luasnip.loaders.from_lua").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load {
paths = paths,
}
require("luasnip.loaders.from_snipmate").lazy_load()
end,
2021-11-06 19:19:35 +01:00
},
{
"hrsh7th/cmp-nvim-lsp",
},
2021-11-06 19:19:35 +01:00
{
"saadparwaiz1/cmp_luasnip",
},
{
"hrsh7th/cmp-buffer",
},
{
"hrsh7th/cmp-path",
},
{
"folke/neodev.nvim",
module = "neodev",
2021-11-06 19:19:35 +01:00
},
2021-07-07 05:22:46 +02:00
2021-07-10 16:51:53 +02:00
-- Autopairs
{
2021-07-10 16:51:53 +02:00
"windwp/nvim-autopairs",
-- event = "InsertEnter",
2021-07-10 16:51:53 +02:00
config = function()
require("lvim.core.autopairs").setup()
2021-07-10 16:51:53 +02:00
end,
2021-09-08 01:23:14 +02:00
disable = not lvim.builtin.autopairs.active,
},
2021-07-10 16:51:53 +02:00
2021-07-07 05:22:46 +02:00
-- Treesitter
{
2021-07-13 03:11:43 +02:00
"nvim-treesitter/nvim-treesitter",
2021-07-26 06:34:40 +02:00
-- run = ":TSUpdate",
2021-07-13 03:11:43 +02:00
config = function()
require("lvim.core.treesitter").setup()
end,
},
{
"JoosepAlviste/nvim-ts-context-commentstring",
event = "BufReadPost",
},
2021-07-17 00:30:38 +02:00
2021-07-10 09:19:44 +02:00
-- NvimTree
{
2021-07-07 05:22:46 +02:00
"kyazdani42/nvim-tree.lua",
-- event = "BufWinOpen",
-- cmd = "NvimTreeToggle",
2021-07-07 05:22:46 +02:00
config = function()
require("lvim.core.nvimtree").setup()
2021-07-07 05:22:46 +02:00
end,
disable = not lvim.builtin.nvimtree.active,
},
2022-09-19 17:44:04 +02:00
-- Lir
{
"christianchiarulli/lir.nvim",
config = function()
require("lvim.core.lir").setup()
2022-09-19 17:44:04 +02:00
end,
requires = { "kyazdani42/nvim-web-devicons" },
2022-09-19 17:44:04 +02:00
disable = not lvim.builtin.lir.active,
},
{
2021-07-07 05:22:46 +02:00
"lewis6991/gitsigns.nvim",
config = function()
require("lvim.core.gitsigns").setup()
2021-07-07 05:22:46 +02:00
end,
event = "BufRead",
disable = not lvim.builtin.gitsigns.active,
},
2021-07-07 05:22:46 +02:00
-- Whichkey
{
"folke/which-key.nvim",
2021-07-08 01:27:27 +02:00
config = function()
require("lvim.core.which-key").setup()
2021-07-08 01:27:27 +02:00
end,
event = "BufWinEnter",
disable = not lvim.builtin.which_key.active,
},
2021-07-07 05:22:46 +02:00
-- Comments
{
"numToStr/Comment.nvim",
2021-07-10 16:51:53 +02:00
event = "BufRead",
2021-07-07 05:22:46 +02:00
config = function()
require("lvim.core.comment").setup()
2021-07-07 05:22:46 +02:00
end,
disable = not lvim.builtin.comment.active,
},
2021-07-07 05:22:46 +02:00
-- project.nvim
{
"ahmedkhalf/project.nvim",
2021-07-12 17:58:30 +02:00
config = function()
require("lvim.core.project").setup()
2021-07-12 17:58:30 +02:00
end,
disable = not lvim.builtin.project.active,
},
2021-07-12 17:58:30 +02:00
2021-07-07 05:22:46 +02:00
-- Icons
{
"kyazdani42/nvim-web-devicons",
disable = not lvim.use_icons,
},
2021-07-07 05:22:46 +02:00
-- Status Line and Bufferline
{
-- "hoob3rt/lualine.nvim",
"nvim-lualine/lualine.nvim",
-- "Lunarvim/lualine.nvim",
2021-07-08 03:57:36 +02:00
config = function()
require("lvim.core.lualine").setup()
2021-07-08 03:57:36 +02:00
end,
disable = not lvim.builtin.lualine.active,
},
2021-07-07 05:22:46 +02:00
2022-09-20 04:14:32 +02:00
-- breadcrumbs
{
"SmiteshP/nvim-navic",
config = function()
require("lvim.core.breadcrumbs").setup()
2022-09-20 04:14:32 +02:00
end,
disable = not lvim.builtin.breadcrumbs.active,
2022-09-20 04:14:32 +02:00
},
{
"akinsho/bufferline.nvim",
2021-07-07 05:22:46 +02:00
config = function()
require("lvim.core.bufferline").setup()
2021-07-07 05:22:46 +02:00
end,
branch = "main",
2021-07-08 03:57:36 +02:00
event = "BufWinEnter",
2021-08-05 21:50:09 +02:00
disable = not lvim.builtin.bufferline.active,
},
2021-07-07 05:22:46 +02:00
2021-07-10 09:19:44 +02:00
-- Debugging
{
2021-07-10 09:19:44 +02:00
"mfussenegger/nvim-dap",
2021-07-10 21:34:59 +02:00
-- event = "BufWinEnter",
2021-07-10 09:19:44 +02:00
config = function()
require("lvim.core.dap").setup()
2021-07-10 09:19:44 +02:00
end,
disable = not lvim.builtin.dap.active,
},
2021-07-10 09:19:44 +02:00
-- Debugger user interface
{
"rcarriga/nvim-dap-ui",
config = function()
require("lvim.core.dap").setup_ui()
end,
disable = not lvim.builtin.dap.active,
},
-- alpha
{
"goolord/alpha-nvim",
2021-07-10 03:01:23 +02:00
config = function()
require("lvim.core.alpha").setup()
2021-07-10 03:01:23 +02:00
end,
disable = not lvim.builtin.alpha.active,
},
2021-07-10 01:38:15 +02:00
-- Terminal
{
"akinsho/toggleterm.nvim",
2021-07-10 09:19:44 +02:00
event = "BufWinEnter",
branch = "main",
2021-07-10 09:19:44 +02:00
config = function()
require("lvim.core.terminal").setup()
2021-07-10 09:19:44 +02:00
end,
disable = not lvim.builtin.terminal.active,
},
-- SchemaStore
{
"b0o/schemastore.nvim",
},
{
"RRethy/vim-illuminate",
2022-09-20 14:11:36 +02:00
config = function()
require("lvim.core.illuminate").setup()
end,
disable = not lvim.builtin.illuminate.active,
},
2022-09-21 16:48:15 +02:00
{
"lukas-reineke/indent-blankline.nvim",
config = function()
require("lvim.core.indentlines").setup()
2022-09-21 16:48:15 +02:00
end,
disable = not lvim.builtin.indentlines.active,
},
{
"lunarvim/onedarker.nvim",
branch = "freeze",
config = function()
pcall(function()
if lvim and lvim.colorscheme == "onedarker" then
require("onedarker").setup()
lvim.builtin.lualine.options.theme = "onedarker"
end
end)
end,
disable = lvim.colorscheme ~= "onedarker",
},
}
local default_snapshot_path = join_paths(get_lvim_base_dir(), "snapshots", "default.json")
local content = vim.fn.readfile(default_snapshot_path)
local default_sha1 = vim.fn.json_decode(content)
local get_default_sha1 = function(spec)
local short_name, _ = require("packer.util").get_plugin_short_name(spec)
return default_sha1[short_name] and default_sha1[short_name].commit
end
if not vim.env.LVIM_DEV_MODE then
for _, spec in ipairs(core_plugins) do
-- Manually lock the commit hash since Packer's snapshots are unreliable in headless mode
spec["commit"] = get_default_sha1(spec)
end
end
return core_plugins