plugins.lua 5.6 KB

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