plugins.lua 5.2 KB

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