plugins.lua 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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. git = { clone_timeout = 300 },
  14. display = {
  15. open_fn = function()
  16. return require("packer.util").float { border = "single" }
  17. end,
  18. },
  19. }
  20. return require("packer").startup(function(use)
  21. -- Packer can manage itself as an optional plugin
  22. use "wbthomason/packer.nvim"
  23. -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function)
  24. use { "neovim/nvim-lspconfig" }
  25. use { "kabouzeid/nvim-lspinstall", event = "VimEnter" }
  26. -- Telescope
  27. use { "nvim-lua/popup.nvim" }
  28. use { "nvim-lua/plenary.nvim" }
  29. use { "tjdevries/astronauta.nvim" }
  30. use {
  31. "nvim-telescope/telescope.nvim",
  32. config = [[require('lv-telescope')]],
  33. event = "BufWinEnter",
  34. }
  35. -- Autocomplete
  36. use {
  37. "hrsh7th/nvim-compe",
  38. event = "InsertEnter",
  39. config = function()
  40. require("lv-compe").config()
  41. end,
  42. }
  43. use { "hrsh7th/vim-vsnip", event = "InsertEnter" }
  44. use { "rafamadriz/friendly-snippets", event = "InsertEnter" }
  45. -- Treesitter
  46. use { "nvim-treesitter/nvim-treesitter" }
  47. -- Neoformat
  48. use {
  49. "sbdchd/neoformat",
  50. config = function()
  51. require "lv-neoformat"
  52. end,
  53. event = "BufRead",
  54. }
  55. use {
  56. "kyazdani42/nvim-tree.lua",
  57. -- event = "BufEnter",
  58. -- cmd = "NvimTreeToggle",
  59. commit = "fd7f60e242205ea9efc9649101c81a07d5f458bb",
  60. config = function()
  61. require("lv-nvimtree").config()
  62. end,
  63. }
  64. use {
  65. "lewis6991/gitsigns.nvim",
  66. config = function()
  67. require("lv-gitsigns").config()
  68. end,
  69. event = "BufRead",
  70. }
  71. -- whichkey
  72. use {
  73. "folke/which-key.nvim",
  74. config = function()
  75. require "lv-which-key"
  76. end,
  77. event = "BufWinEnter",
  78. }
  79. -- Autopairs
  80. use {
  81. "windwp/nvim-autopairs",
  82. event = "InsertEnter",
  83. after = { "telescope.nvim" },
  84. config = function()
  85. require "lv-autopairs"
  86. end,
  87. }
  88. -- Comments
  89. use {
  90. "terrortylor/nvim-comment",
  91. event = "BufWinEnter",
  92. config = function()
  93. local status_ok, nvim_comment = pcall(require, "nvim_comment")
  94. if not status_ok then
  95. return
  96. end
  97. nvim_comment.setup()
  98. end,
  99. }
  100. -- Icons
  101. use { "kyazdani42/nvim-web-devicons" }
  102. -- Status Line and Bufferline
  103. use {
  104. "glepnir/galaxyline.nvim",
  105. config = function()
  106. require "lv-galaxyline"
  107. end,
  108. -- event = "VimEnter",
  109. }
  110. use {
  111. "romgrk/barbar.nvim",
  112. config = function()
  113. require "lv-barbar"
  114. end,
  115. event = "BufWinEnter",
  116. }
  117. -- Builtins, these do not load by default
  118. -- Dashboard
  119. use {
  120. "ChristianChiarulli/dashboard-nvim",
  121. event = "BufWinEnter",
  122. config = function()
  123. require("lv-dashboard").config()
  124. end,
  125. disable = not O.plugin.dashboard.active,
  126. -- opt = true,
  127. }
  128. -- Zen Mode
  129. use {
  130. "folke/zen-mode.nvim",
  131. cmd = "ZenMode",
  132. -- event = "BufRead",
  133. config = function()
  134. require("lv-zen").config()
  135. end,
  136. disable = not O.plugin.zen.active,
  137. }
  138. use {
  139. "lukas-reineke/indent-blankline.nvim",
  140. event = "BufRead",
  141. setup = function()
  142. vim.g.indentLine_enabled = 1
  143. vim.g.indent_blankline_char = "▏"
  144. vim.g.indent_blankline_filetype_exclude = {
  145. "help",
  146. "terminal",
  147. "dashboard",
  148. }
  149. vim.g.indent_blankline_buftype_exclude = { "terminal" }
  150. vim.g.indent_blankline_show_trailing_blankline_indent = false
  151. vim.g.indent_blankline_show_first_indent_level = true
  152. end,
  153. disable = not O.plugin.indent_line.active,
  154. }
  155. -- comments in context
  156. use {
  157. "JoosepAlviste/nvim-ts-context-commentstring",
  158. event = "BufRead",
  159. disable = not O.plugin.ts_context_commentstring.active,
  160. }
  161. -- Debugging
  162. use {
  163. "mfussenegger/nvim-dap",
  164. config = function()
  165. require "lv-dap"
  166. end,
  167. disable = not O.plugin.dap.active,
  168. }
  169. -- Floating terminal
  170. use {
  171. "numToStr/FTerm.nvim",
  172. event = "BufWinEnter",
  173. config = function()
  174. require("lv-floatterm").config()
  175. end,
  176. disable = not O.plugin.floatterm.active,
  177. }
  178. -- Use fzy for telescope
  179. use {
  180. "nvim-telescope/telescope-fzy-native.nvim",
  181. event = "BufRead",
  182. disable = not O.plugin.telescope_fzy.active,
  183. }
  184. -- Use project for telescope
  185. use {
  186. "nvim-telescope/telescope-project.nvim",
  187. event = "BufWinEnter",
  188. setup = function()
  189. vim.cmd [[packadd telescope.nvim]]
  190. end,
  191. disable = not O.plugin.telescope_project.active,
  192. }
  193. -- Diffview
  194. use {
  195. "sindrets/diffview.nvim",
  196. event = "BufRead",
  197. disable = not O.plugin.diffview.active,
  198. }
  199. -- Lush Create Color Schemes
  200. use {
  201. "rktjmp/lush.nvim",
  202. -- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"},
  203. disable = not O.plugin.lush.active,
  204. }
  205. -- Debugger management
  206. use {
  207. "Pocco81/DAPInstall.nvim",
  208. -- event = "BufRead",
  209. disable = not O.plugin.dap.active,
  210. }
  211. -- LANGUAGE SPECIFIC GOES HERE
  212. use {
  213. "lervag/vimtex",
  214. ft = "tex",
  215. config = function()
  216. require "lv-vimtex"
  217. end,
  218. }
  219. -- Rust tools
  220. -- TODO: use lazy loading maybe?
  221. use {
  222. "simrat39/rust-tools.nvim",
  223. disable = not O.lang.rust.rust_tools.active,
  224. }
  225. -- Elixir
  226. use { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } }
  227. -- Javascript / Typescript
  228. use {
  229. "jose-elias-alvarez/nvim-lsp-ts-utils",
  230. ft = {
  231. "javascript",
  232. "javascriptreact",
  233. "javascript.jsx",
  234. "typescript",
  235. "typescriptreact",
  236. "typescript.tsx",
  237. },
  238. }
  239. use {
  240. "mfussenegger/nvim-jdtls",
  241. disable = not O.lang.java.java_tools.active,
  242. }
  243. -- use {
  244. -- "jose-elias-alvarez/null-ls.nvim",
  245. -- ft = {
  246. -- "javascript",
  247. -- "javascriptreact",
  248. -- "javascript.jsx",
  249. -- "typescript",
  250. -- "typescriptreact",
  251. -- "typescript.tsx",
  252. -- },
  253. -- config = function()
  254. -- require("null-ls").setup()
  255. -- end,
  256. -- }
  257. -- Pretty parentheses
  258. use {
  259. "p00f/nvim-ts-rainbow",
  260. disable = not O.plugin.ts_rainbow.active,
  261. }
  262. -- Autotags <div>|</div>
  263. use {
  264. "windwp/nvim-ts-autotag",
  265. event = "InsertEnter",
  266. disable = not O.plugin.ts_autotag.active,
  267. }
  268. -- Custom semantic text objects
  269. use {
  270. "nvim-treesitter/nvim-treesitter-textobjects",
  271. disable = not O.plugin.ts_textobjects.active,
  272. }
  273. -- Smart text objects
  274. use {
  275. "RRethy/nvim-treesitter-textsubjects",
  276. disable = not O.plugin.ts_textsubjects.active,
  277. }
  278. -- Text objects using hint labels
  279. use {
  280. "mfussenegger/nvim-ts-hint-textobject",
  281. event = "BufRead",
  282. disable = not O.plugin.ts_hintobjects.active,
  283. }
  284. for _, plugin in pairs(O.user_plugins) do
  285. packer.use(plugin)
  286. end
  287. end)