plugins.lua 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. -- Linter
  75. use {
  76. "mfussenegger/nvim-lint",
  77. config = require("core.linter").setup,
  78. }
  79. -- NvimTree
  80. use {
  81. "kyazdani42/nvim-tree.lua",
  82. -- event = "BufWinOpen",
  83. -- cmd = "NvimTreeToggle",
  84. commit = "fd7f60e242205ea9efc9649101c81a07d5f458bb",
  85. config = function()
  86. require("core.nvimtree").setup()
  87. end,
  88. }
  89. use {
  90. "lewis6991/gitsigns.nvim",
  91. config = function()
  92. require("core.gitsigns").setup()
  93. end,
  94. event = "BufRead",
  95. }
  96. -- whichkey
  97. use {
  98. "folke/which-key.nvim",
  99. config = function()
  100. require("core.which-key").setup()
  101. end,
  102. event = "BufWinEnter",
  103. }
  104. -- Comments
  105. use {
  106. "terrortylor/nvim-comment",
  107. event = "BufRead",
  108. config = function()
  109. local status_ok, nvim_comment = pcall(require, "nvim_comment")
  110. if not status_ok then
  111. return
  112. end
  113. nvim_comment.setup()
  114. end,
  115. }
  116. -- vim-rooter
  117. use {
  118. "airblade/vim-rooter",
  119. config = function()
  120. vim.g.rooter_silent_chdir = 1
  121. end,
  122. }
  123. -- Icons
  124. use { "kyazdani42/nvim-web-devicons" }
  125. -- Status Line and Bufferline
  126. use {
  127. "glepnir/galaxyline.nvim",
  128. config = function()
  129. require "core.galaxyline"
  130. end,
  131. event = "BufWinEnter",
  132. disable = not O.plugin.galaxyline.active,
  133. }
  134. use {
  135. "romgrk/barbar.nvim",
  136. config = function()
  137. require "core.bufferline"
  138. end,
  139. event = "BufWinEnter",
  140. }
  141. -- Debugging
  142. use {
  143. "mfussenegger/nvim-dap",
  144. -- event = "BufWinEnter",
  145. config = function()
  146. require("core.dap").setup()
  147. end,
  148. disable = not O.plugin.dap.active,
  149. }
  150. -- Debugger management
  151. use {
  152. "Pocco81/DAPInstall.nvim",
  153. -- event = "BufWinEnter",
  154. -- event = "BufRead",
  155. disable = not O.plugin.dap.active,
  156. }
  157. -- Builtins, these do not load by default
  158. -- Dashboard
  159. use {
  160. "ChristianChiarulli/dashboard-nvim",
  161. event = "BufWinEnter",
  162. config = function()
  163. require("core.dashboard").setup()
  164. end,
  165. disable = not O.plugin.dashboard.active,
  166. }
  167. -- TODO: remove in favor of akinsho/nvim-toggleterm.lua
  168. -- Floating terminal
  169. -- use {
  170. -- "numToStr/FTerm.nvim",
  171. -- event = "BufWinEnter",
  172. -- config = function()
  173. -- require("core.floatterm").setup()
  174. -- end,
  175. -- disable = not O.plugin.floatterm.active,
  176. -- }
  177. use {
  178. "akinsho/nvim-toggleterm.lua",
  179. event = "BufWinEnter",
  180. config = function()
  181. require("core.terminal").setup()
  182. end,
  183. disable = not O.plugin.terminal.active,
  184. }
  185. -- Zen Mode
  186. use {
  187. "folke/zen-mode.nvim",
  188. cmd = "ZenMode",
  189. event = "BufRead",
  190. config = function()
  191. require("core.zen").setup()
  192. end,
  193. disable = not O.plugin.zen.active,
  194. }
  195. ---------------------------------------------------------------------------------
  196. -- LANGUAGE SPECIFIC GOES HERE
  197. use {
  198. "lervag/vimtex",
  199. ft = "tex",
  200. }
  201. -- Rust tools
  202. -- TODO: use lazy loading maybe?
  203. use {
  204. "simrat39/rust-tools.nvim",
  205. disable = not O.lang.rust.rust_tools.active,
  206. }
  207. -- Elixir
  208. use { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } }
  209. -- Javascript / Typescript
  210. use {
  211. "jose-elias-alvarez/nvim-lsp-ts-utils",
  212. ft = {
  213. "javascript",
  214. "javascriptreact",
  215. "javascript.jsx",
  216. "typescript",
  217. "typescriptreact",
  218. "typescript.tsx",
  219. },
  220. }
  221. -- Java
  222. use {
  223. "mfussenegger/nvim-jdtls",
  224. -- ft = { "java" },
  225. disable = not O.lang.java.java_tools.active,
  226. }
  227. -- Scala
  228. use {
  229. "scalameta/nvim-metals",
  230. disable = not O.lang.scala.metals.active,
  231. }
  232. -- Install user plugins
  233. for _, plugin in pairs(O.user_plugins) do
  234. packer.use(plugin)
  235. end
  236. end)