plugins.lua 5.2 KB

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