plugins.lua 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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. -- NOTE: Temporary fix till folke comes back
  105. "max397574/lua-dev.nvim",
  106. module = "lua-dev",
  107. },
  108. -- Autopairs
  109. {
  110. "windwp/nvim-autopairs",
  111. -- event = "InsertEnter",
  112. config = function()
  113. require("lvim.core.autopairs").setup()
  114. end,
  115. disable = not lvim.builtin.autopairs.active,
  116. },
  117. -- Treesitter
  118. {
  119. "nvim-treesitter/nvim-treesitter",
  120. -- run = ":TSUpdate",
  121. config = function()
  122. require("lvim.core.treesitter").setup()
  123. end,
  124. },
  125. {
  126. "JoosepAlviste/nvim-ts-context-commentstring",
  127. event = "BufReadPost",
  128. },
  129. -- NvimTree
  130. {
  131. "kyazdani42/nvim-tree.lua",
  132. -- event = "BufWinOpen",
  133. -- cmd = "NvimTreeToggle",
  134. config = function()
  135. require("lvim.core.nvimtree").setup()
  136. end,
  137. disable = not lvim.builtin.nvimtree.active,
  138. },
  139. {
  140. "lewis6991/gitsigns.nvim",
  141. config = function()
  142. require("lvim.core.gitsigns").setup()
  143. end,
  144. event = "BufRead",
  145. disable = not lvim.builtin.gitsigns.active,
  146. },
  147. -- Whichkey
  148. {
  149. "max397574/which-key.nvim",
  150. config = function()
  151. require("lvim.core.which-key").setup()
  152. end,
  153. event = "BufWinEnter",
  154. disable = not lvim.builtin.which_key.active,
  155. },
  156. -- Comments
  157. {
  158. "numToStr/Comment.nvim",
  159. event = "BufRead",
  160. config = function()
  161. require("lvim.core.comment").setup()
  162. end,
  163. disable = not lvim.builtin.comment.active,
  164. },
  165. -- project.nvim
  166. {
  167. "ahmedkhalf/project.nvim",
  168. config = function()
  169. require("lvim.core.project").setup()
  170. end,
  171. disable = not lvim.builtin.project.active,
  172. },
  173. -- Icons
  174. {
  175. "kyazdani42/nvim-web-devicons",
  176. disable = not lvim.use_icons,
  177. },
  178. -- Status Line and Bufferline
  179. {
  180. -- "hoob3rt/lualine.nvim",
  181. "nvim-lualine/lualine.nvim",
  182. -- "Lunarvim/lualine.nvim",
  183. config = function()
  184. require("lvim.core.lualine").setup()
  185. end,
  186. disable = not lvim.builtin.lualine.active,
  187. },
  188. {
  189. "akinsho/bufferline.nvim",
  190. config = function()
  191. require("lvim.core.bufferline").setup()
  192. end,
  193. branch = "main",
  194. event = "BufWinEnter",
  195. disable = not lvim.builtin.bufferline.active,
  196. },
  197. -- Debugging
  198. {
  199. "mfussenegger/nvim-dap",
  200. -- event = "BufWinEnter",
  201. config = function()
  202. require("lvim.core.dap").setup()
  203. end,
  204. disable = not lvim.builtin.dap.active,
  205. },
  206. -- Debugger management
  207. {
  208. "Pocco81/dap-buddy.nvim",
  209. branch = "dev",
  210. -- event = "BufWinEnter",
  211. -- event = "BufRead",
  212. disable = not lvim.builtin.dap.active,
  213. },
  214. -- alpha
  215. {
  216. "goolord/alpha-nvim",
  217. config = function()
  218. require("lvim.core.alpha").setup()
  219. end,
  220. disable = not lvim.builtin.alpha.active,
  221. },
  222. -- Terminal
  223. {
  224. "akinsho/toggleterm.nvim",
  225. event = "BufWinEnter",
  226. branch = "main",
  227. config = function()
  228. require("lvim.core.terminal").setup()
  229. end,
  230. disable = not lvim.builtin.terminal.active,
  231. },
  232. -- SchemaStore
  233. {
  234. "b0o/schemastore.nvim",
  235. },
  236. }
  237. local default_snapshot_path = join_paths(get_lvim_base_dir(), "snapshots", "default.json")
  238. local content = vim.fn.readfile(default_snapshot_path)
  239. local default_sha1 = vim.fn.json_decode(content)
  240. local get_default_sha1 = function(spec)
  241. local short_name, _ = require("packer.util").get_plugin_short_name(spec)
  242. return default_sha1[short_name] and default_sha1[short_name].commit
  243. end
  244. for _, spec in ipairs(core_plugins) do
  245. if not vim.env.LVIM_DEV_MODE then
  246. -- Manually lock the commit hash since Packer's snapshots are unreliable in headless mode
  247. spec["commit"] = get_default_sha1(spec)
  248. end
  249. end
  250. return core_plugins