plugins.lua 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. return {
  2. -- Packer can manage itself as an optional plugin
  3. { "wbthomason/packer.nvim" },
  4. -- TODO: refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function)
  5. { "neovim/nvim-lspconfig" },
  6. {
  7. "kabouzeid/nvim-lspinstall",
  8. event = "VimEnter",
  9. config = function()
  10. local lspinstall = require "lspinstall"
  11. lspinstall.setup()
  12. if O.plugin.lspinstall.on_config_done then
  13. O.plugin.lspinstall.on_config_done(lspinstall)
  14. end
  15. end,
  16. },
  17. { "nvim-lua/popup.nvim" },
  18. { "nvim-lua/plenary.nvim" },
  19. { "tjdevries/astronauta.nvim" },
  20. -- Telescope
  21. {
  22. "nvim-telescope/telescope.nvim",
  23. config = function()
  24. require("core.telescope").setup()
  25. if O.plugin.telescope.on_config_done then
  26. O.plugin.telescope.on_config_done(require "telescope")
  27. end
  28. end,
  29. },
  30. -- Autocomplete
  31. {
  32. "hrsh7th/nvim-compe",
  33. -- event = "InsertEnter",
  34. config = function()
  35. require("core.compe").setup()
  36. if O.plugin.compe.on_config_done then
  37. O.plugin.compe.on_config_done(require "compe")
  38. end
  39. end,
  40. },
  41. -- Autopairs
  42. {
  43. "windwp/nvim-autopairs",
  44. -- event = "InsertEnter",
  45. config = function()
  46. require "core.autopairs"
  47. if O.plugin.autopairs.on_config_done then
  48. O.plugin.autopairs.on_config_done(require "nvim-autopairs")
  49. end
  50. end,
  51. },
  52. -- Snippets
  53. { "hrsh7th/vim-vsnip", event = "InsertEnter" },
  54. { "rafamadriz/friendly-snippets", event = "InsertEnter" },
  55. -- Treesitter
  56. {
  57. "nvim-treesitter/nvim-treesitter",
  58. config = function()
  59. require("core.treesitter").setup()
  60. if O.plugin.treesitter.on_config_done then
  61. O.plugin.treesitter.on_config_done(require "nvim-treesitter.configs")
  62. end
  63. end,
  64. },
  65. -- Formatter.nvim
  66. {
  67. "mhartington/formatter.nvim",
  68. config = function()
  69. require "core.formatter"
  70. if O.plugin.formatter.on_config_done then
  71. O.plugin.formatter.on_config_done(require "formatter")
  72. end
  73. end,
  74. },
  75. -- Linter
  76. {
  77. "mfussenegger/nvim-lint",
  78. config = function()
  79. require("core.linter").setup()
  80. if O.plugin.lint.on_config_done then
  81. O.plugin.lint.on_config_done(require "lint")
  82. end
  83. end,
  84. },
  85. -- NvimTree
  86. {
  87. "kyazdani42/nvim-tree.lua",
  88. -- event = "BufWinOpen",
  89. -- cmd = "NvimTreeToggle",
  90. -- commit = "fd7f60e242205ea9efc9649101c81a07d5f458bb",
  91. config = function()
  92. require("core.nvimtree").setup()
  93. if O.plugin.nvimtree.on_config_done then
  94. O.plugin.nvimtree.on_config_done(require "nvim-tree.config")
  95. end
  96. end,
  97. },
  98. {
  99. "lewis6991/gitsigns.nvim",
  100. config = function()
  101. require("core.gitsigns").setup()
  102. if O.plugin.gitsigns.on_config_done then
  103. O.plugin.gitsigns.on_config_done(require "gitsigns")
  104. end
  105. end,
  106. event = "BufRead",
  107. },
  108. -- whichkey
  109. {
  110. "folke/which-key.nvim",
  111. config = function()
  112. require("core.which-key").setup()
  113. if O.plugin.which_key.on_config_done then
  114. O.plugin.which_key.on_config_done(require "which-key")
  115. end
  116. end,
  117. event = "BufWinEnter",
  118. },
  119. -- Comments
  120. {
  121. "terrortylor/nvim-comment",
  122. event = "BufRead",
  123. config = function()
  124. local status_ok, nvim_comment = pcall(require, "nvim_comment")
  125. if not status_ok then
  126. return
  127. end
  128. nvim_comment.setup()
  129. if O.plugin.comment.on_config_done then
  130. O.plugin.comment.on_config_done(nvim_comment)
  131. end
  132. end,
  133. },
  134. -- vim-rooter
  135. {
  136. "airblade/vim-rooter",
  137. config = function()
  138. vim.g.rooter_silent_chdir = 1
  139. if O.plugin.rooter.on_config_done then
  140. O.plugin.rooter.on_config_done()
  141. end
  142. end,
  143. },
  144. -- Icons
  145. { "kyazdani42/nvim-web-devicons" },
  146. -- Status Line and Bufferline
  147. {
  148. "glepnir/galaxyline.nvim",
  149. config = function()
  150. require "core.galaxyline"
  151. if O.plugin.galaxyline.on_config_done then
  152. O.plugin.galaxyline.on_config_done(require "galaxyline")
  153. end
  154. end,
  155. event = "BufWinEnter",
  156. disable = not O.plugin.galaxyline.active,
  157. },
  158. {
  159. "romgrk/barbar.nvim",
  160. config = function()
  161. require "core.bufferline"
  162. if O.plugin.bufferline.on_config_done then
  163. O.plugin.bufferline.on_config_done()
  164. end
  165. end,
  166. event = "BufWinEnter",
  167. },
  168. -- Debugging
  169. {
  170. "mfussenegger/nvim-dap",
  171. -- event = "BufWinEnter",
  172. config = function()
  173. require("core.dap").setup()
  174. if O.plugin.dap.on_config_done then
  175. O.plugin.dap.on_config_done(require "dap")
  176. end
  177. end,
  178. disable = not O.plugin.dap.active,
  179. },
  180. -- Debugger management
  181. {
  182. "Pocco81/DAPInstall.nvim",
  183. -- event = "BufWinEnter",
  184. -- event = "BufRead",
  185. disable = not O.plugin.dap.active,
  186. },
  187. -- Builtins, these do not load by default
  188. -- Dashboard
  189. {
  190. "ChristianChiarulli/dashboard-nvim",
  191. event = "BufWinEnter",
  192. config = function()
  193. require("core.dashboard").setup()
  194. if O.plugin.dashboard.on_config_done then
  195. O.plugin.dashboard.on_config_done(require "dashboard")
  196. end
  197. end,
  198. disable = not O.plugin.dashboard.active,
  199. },
  200. -- TODO: remove in favor of akinsho/nvim-toggleterm.lua
  201. -- Floating terminal
  202. -- {
  203. -- "numToStr/FTerm.nvim",
  204. -- event = "BufWinEnter",
  205. -- config = function()
  206. -- require("core.floatterm").setup()
  207. -- end,
  208. -- disable = not O.plugin.floatterm.active,
  209. -- },
  210. {
  211. "akinsho/nvim-toggleterm.lua",
  212. event = "BufWinEnter",
  213. config = function()
  214. require("core.terminal").setup()
  215. if O.plugin.terminal.on_config_done then
  216. O.plugin.terminal.on_config_done(require "toggleterm")
  217. end
  218. end,
  219. disable = not O.plugin.terminal.active,
  220. },
  221. -- Zen Mode
  222. {
  223. "folke/zen-mode.nvim",
  224. cmd = "ZenMode",
  225. event = "BufRead",
  226. config = function()
  227. require("core.zen").setup()
  228. if O.plugin.zen.on_config_done then
  229. O.plugin.zen.on_config_done(require "zen-mode")
  230. end
  231. end,
  232. disable = not O.plugin.zen.active,
  233. },
  234. ---------------------------------------------------------------------------------
  235. -- LANGUAGE SPECIFIC GOES HERE
  236. {
  237. "lervag/vimtex",
  238. ft = "tex",
  239. },
  240. -- Rust tools
  241. -- TODO: use lazy loading maybe?
  242. {
  243. "simrat39/rust-tools.nvim",
  244. disable = not O.lang.rust.rust_tools.active,
  245. },
  246. -- Elixir
  247. { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } },
  248. -- Javascript / Typescript
  249. {
  250. "jose-elias-alvarez/nvim-lsp-ts-utils",
  251. ft = {
  252. "javascript",
  253. "javascriptreact",
  254. "javascript.jsx",
  255. "typescript",
  256. "typescriptreact",
  257. "typescript.tsx",
  258. },
  259. },
  260. -- Java
  261. {
  262. "mfussenegger/nvim-jdtls",
  263. -- ft = { "java" },
  264. disable = not O.lang.java.java_tools.active,
  265. },
  266. -- Scala
  267. {
  268. "scalameta/nvim-metals",
  269. disable = not O.lang.scala.metals.active,
  270. },
  271. }