plugins.lua 6.1 KB

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