plugins.lua 5.5 KB

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