plugins.lua 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. local core_plugins = {
  2. -- Packer can manage itself as an optional plugin
  3. { "wbthomason/packer.nvim" },
  4. { "neovim/nvim-lspconfig" },
  5. { "tamago324/nlsp-settings.nvim" },
  6. {
  7. "jose-elias-alvarez/null-ls.nvim",
  8. },
  9. { "antoinemadec/FixCursorHold.nvim" }, -- Needed while issue https://github.com/neovim/neovim/issues/12587 is still open
  10. { "williamboman/mason-lspconfig.nvim" },
  11. {
  12. "williamboman/mason.nvim",
  13. config = function()
  14. require("lvim.core.mason").setup()
  15. end,
  16. },
  17. {
  18. "lunarvim/onedarker.nvim",
  19. branch = "freeze",
  20. config = function()
  21. pcall(function()
  22. if lvim and lvim.colorscheme == "onedarker" then
  23. require("onedarker").setup()
  24. lvim.builtin.lualine.options.theme = "onedarker"
  25. end
  26. end)
  27. end,
  28. disable = lvim.colorscheme ~= "onedarker",
  29. },
  30. {
  31. "rcarriga/nvim-notify",
  32. config = function()
  33. require("lvim.core.notify").setup()
  34. end,
  35. requires = { "nvim-telescope/telescope.nvim" },
  36. disable = not lvim.builtin.notify.active or not lvim.builtin.telescope.active,
  37. },
  38. { "Tastyep/structlog.nvim" },
  39. { "nvim-lua/popup.nvim" },
  40. { "nvim-lua/plenary.nvim" },
  41. -- Telescope
  42. {
  43. "nvim-telescope/telescope.nvim",
  44. branch = "0.1.x",
  45. config = function()
  46. require("lvim.core.telescope").setup()
  47. end,
  48. disable = not lvim.builtin.telescope.active,
  49. },
  50. {
  51. "nvim-telescope/telescope-fzf-native.nvim",
  52. requires = { "nvim-telescope/telescope.nvim" },
  53. run = "make",
  54. disable = not lvim.builtin.telescope.active,
  55. },
  56. -- Install nvim-cmp, and buffer source as a dependency
  57. {
  58. "hrsh7th/nvim-cmp",
  59. config = function()
  60. if lvim.builtin.cmp then
  61. require("lvim.core.cmp").setup()
  62. end
  63. end,
  64. requires = {
  65. "L3MON4D3/LuaSnip",
  66. },
  67. },
  68. {
  69. "rafamadriz/friendly-snippets",
  70. disable = not lvim.builtin.luasnip.sources.friendly_snippets,
  71. },
  72. {
  73. "L3MON4D3/LuaSnip",
  74. config = function()
  75. local utils = require "lvim.utils"
  76. local paths = {}
  77. if lvim.builtin.luasnip.sources.friendly_snippets then
  78. paths[#paths + 1] = utils.join_paths(get_runtime_dir(), "site", "pack", "packer", "start", "friendly-snippets")
  79. end
  80. local user_snippets = utils.join_paths(get_config_dir(), "snippets")
  81. if utils.is_directory(user_snippets) then
  82. paths[#paths + 1] = user_snippets
  83. end
  84. require("luasnip.loaders.from_lua").lazy_load()
  85. require("luasnip.loaders.from_vscode").lazy_load {
  86. paths = paths,
  87. }
  88. require("luasnip.loaders.from_snipmate").lazy_load()
  89. end,
  90. },
  91. {
  92. "hrsh7th/cmp-nvim-lsp",
  93. },
  94. {
  95. "saadparwaiz1/cmp_luasnip",
  96. },
  97. {
  98. "hrsh7th/cmp-buffer",
  99. },
  100. {
  101. "hrsh7th/cmp-path",
  102. },
  103. {
  104. "folke/lua-dev.nvim",
  105. module = "lua-dev",
  106. },
  107. -- Autopairs
  108. {
  109. "windwp/nvim-autopairs",
  110. -- event = "InsertEnter",
  111. config = function()
  112. require("lvim.core.autopairs").setup()
  113. end,
  114. disable = not lvim.builtin.autopairs.active,
  115. },
  116. -- Treesitter
  117. {
  118. "nvim-treesitter/nvim-treesitter",
  119. -- run = ":TSUpdate",
  120. config = function()
  121. require("lvim.core.treesitter").setup()
  122. end,
  123. },
  124. {
  125. "JoosepAlviste/nvim-ts-context-commentstring",
  126. event = "BufReadPost",
  127. },
  128. -- NvimTree
  129. {
  130. "kyazdani42/nvim-tree.lua",
  131. config = function()
  132. require("lvim.core.nvimtree").setup()
  133. end,
  134. disable = not lvim.builtin.nvimtree.active,
  135. },
  136. {
  137. "christianchiarulli/lir.nvim",
  138. config = function()
  139. require("lvim.core.lir").setup()
  140. end,
  141. disable = not lvim.builtin.nvimtree.active,
  142. },
  143. {
  144. "lewis6991/gitsigns.nvim",
  145. config = function()
  146. require("lvim.core.gitsigns").setup()
  147. end,
  148. event = "BufRead",
  149. disable = not lvim.builtin.gitsigns.active,
  150. },
  151. -- Whichkey
  152. {
  153. "folke/which-key.nvim",
  154. config = function()
  155. require("lvim.core.which-key").setup()
  156. end,
  157. event = "BufWinEnter",
  158. disable = not lvim.builtin.which_key.active,
  159. },
  160. -- Comments
  161. {
  162. "numToStr/Comment.nvim",
  163. event = "BufRead",
  164. config = function()
  165. require("lvim.core.comment").setup()
  166. end,
  167. disable = not lvim.builtin.comment.active,
  168. },
  169. -- project.nvim
  170. {
  171. "ahmedkhalf/project.nvim",
  172. config = function()
  173. require("lvim.core.project").setup()
  174. end,
  175. disable = not lvim.builtin.project.active,
  176. },
  177. -- Icons
  178. {
  179. "kyazdani42/nvim-web-devicons",
  180. disable = not lvim.use_icons,
  181. },
  182. -- Status Line and Bufferline
  183. {
  184. -- "hoob3rt/lualine.nvim",
  185. "nvim-lualine/lualine.nvim",
  186. -- "Lunarvim/lualine.nvim",
  187. config = function()
  188. require("lvim.core.lualine").setup()
  189. end,
  190. disable = not lvim.builtin.lualine.active,
  191. },
  192. {
  193. "akinsho/bufferline.nvim",
  194. config = function()
  195. require("lvim.core.bufferline").setup()
  196. end,
  197. branch = "main",
  198. event = "BufWinEnter",
  199. disable = not lvim.builtin.bufferline.active,
  200. },
  201. -- Debugging
  202. {
  203. "mfussenegger/nvim-dap",
  204. -- event = "BufWinEnter",
  205. config = function()
  206. require("lvim.core.dap").setup()
  207. end,
  208. disable = not lvim.builtin.dap.active,
  209. },
  210. -- Debugger management
  211. {
  212. "Pocco81/dap-buddy.nvim",
  213. branch = "dev",
  214. -- event = "BufWinEnter",
  215. -- event = "BufRead",
  216. disable = not lvim.builtin.dap.active,
  217. },
  218. -- alpha
  219. {
  220. "goolord/alpha-nvim",
  221. config = function()
  222. require("lvim.core.alpha").setup()
  223. end,
  224. disable = not lvim.builtin.alpha.active,
  225. },
  226. -- Terminal
  227. {
  228. "akinsho/toggleterm.nvim",
  229. event = "BufWinEnter",
  230. branch = "main",
  231. config = function()
  232. require("lvim.core.terminal").setup()
  233. end,
  234. disable = not lvim.builtin.terminal.active,
  235. },
  236. -- SchemaStore
  237. {
  238. "b0o/schemastore.nvim",
  239. },
  240. }
  241. local default_snapshot_path = join_paths(get_lvim_base_dir(), "snapshots", "default.json")
  242. local content = vim.fn.readfile(default_snapshot_path)
  243. local default_sha1 = vim.fn.json_decode(content)
  244. local get_default_sha1 = function(spec)
  245. local short_name, _ = require("packer.util").get_plugin_short_name(spec)
  246. return default_sha1[short_name] and default_sha1[short_name].commit
  247. end
  248. for _, spec in ipairs(core_plugins) do
  249. if not vim.env.LVIM_DEV_MODE then
  250. -- Manually lock the commit hash since Packer's snapshots are unreliable in headless mode
  251. spec["commit"] = get_default_sha1(spec)
  252. end
  253. end
  254. return core_plugins