plugins.lua 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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 = "BufRead" }
  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 = "BufEnter",
  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", run = ":TSUpdate" }
  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 = "BufRead",
  92. -- cmd = "CommentToggle",
  93. config = function()
  94. local status_ok, nvim_comment = pcall(require, "nvim_comment")
  95. if not status_ok then
  96. return
  97. end
  98. nvim_comment.setup()
  99. end,
  100. }
  101. -- Color
  102. use { "christianchiarulli/nvcode-color-schemes.vim", opt = true }
  103. -- Icons
  104. use { "kyazdani42/nvim-web-devicons" }
  105. -- Status Line and Bufferline
  106. use {
  107. "glepnir/galaxyline.nvim",
  108. config = function()
  109. require "lv-galaxyline"
  110. end,
  111. -- event = "VimEnter",
  112. }
  113. use {
  114. "romgrk/barbar.nvim",
  115. config = function()
  116. require "lv-barbar"
  117. end,
  118. event = "BufWinEnter",
  119. }
  120. -- Builtins, these do not load by default
  121. -- Dashboard
  122. use {
  123. "ChristianChiarulli/dashboard-nvim",
  124. event = "BufWinEnter",
  125. -- cmd = { "Dashboard", "DashboardNewFile", "DashboardJumpMarks" },
  126. -- config = function()
  127. -- require("lv-dashboard").config()
  128. -- end,
  129. disable = not O.plugin.dashboard.active,
  130. -- opt = true,
  131. }
  132. -- Zen Mode
  133. use {
  134. "folke/zen-mode.nvim",
  135. cmd = "ZenMode",
  136. -- event = "BufRead",
  137. config = function()
  138. require("lv-zen").config()
  139. end,
  140. disable = not O.plugin.zen.active,
  141. }
  142. use {
  143. "norcalli/nvim-colorizer.lua",
  144. event = "BufWinEnter",
  145. config = function()
  146. require "lv-colorizer"
  147. -- vim.cmd "ColorizerReloadAllBuffers"
  148. end,
  149. disable = not O.plugin.colorizer.active,
  150. }
  151. -- Treesitter playground
  152. use {
  153. "nvim-treesitter/playground",
  154. event = "BufRead",
  155. disable = not O.plugin.ts_playground.active,
  156. }
  157. use {
  158. "lukas-reineke/indent-blankline.nvim",
  159. event = "BufRead",
  160. setup = function()
  161. vim.g.indentLine_enabled = 1
  162. vim.g.indent_blankline_char = "▏"
  163. vim.g.indent_blankline_filetype_exclude = {
  164. "help",
  165. "terminal",
  166. "dashboard",
  167. }
  168. vim.g.indent_blankline_buftype_exclude = { "terminal" }
  169. vim.g.indent_blankline_show_trailing_blankline_indent = false
  170. vim.g.indent_blankline_show_first_indent_level = true
  171. end,
  172. disable = not O.plugin.indent_line.active,
  173. }
  174. -- comments in context
  175. use {
  176. "JoosepAlviste/nvim-ts-context-commentstring",
  177. event = "BufRead",
  178. disable = not O.plugin.ts_context_commentstring.active,
  179. }
  180. -- Symbol Outline
  181. use {
  182. "simrat39/symbols-outline.nvim",
  183. cmd = "SymbolsOutline",
  184. disable = not O.plugin.symbol_outline.active,
  185. }
  186. -- diagnostics
  187. use {
  188. "folke/trouble.nvim",
  189. cmd = "TroubleToggle",
  190. disable = not O.plugin.trouble.active,
  191. }
  192. -- Debugging
  193. use {
  194. "mfussenegger/nvim-dap",
  195. config = function()
  196. require "lv-dap"
  197. end,
  198. disable = not O.plugin.debug.active,
  199. }
  200. -- Floating terminal
  201. use {
  202. "numToStr/FTerm.nvim",
  203. event = "BufRead",
  204. config = function()
  205. require("lv-floatterm").config()
  206. end,
  207. disable = not O.plugin.floatterm.active,
  208. }
  209. -- Use fzy for telescope
  210. use {
  211. "nvim-telescope/telescope-fzy-native.nvim",
  212. event = "BufRead",
  213. disable = not O.plugin.telescope_fzy.active,
  214. }
  215. -- Use project for telescope
  216. use {
  217. "nvim-telescope/telescope-project.nvim",
  218. event = "BufRead",
  219. setup = function()
  220. vim.cmd [[packadd telescope.nvim]]
  221. end,
  222. disable = not O.plugin.telescope_project.active,
  223. }
  224. -- Sane gx for netrw_gx bug
  225. use {
  226. "felipec/vim-sanegx",
  227. event = "BufRead",
  228. disable = not O.plugin.sanegx.active,
  229. }
  230. -- Diffview
  231. use {
  232. "sindrets/diffview.nvim",
  233. event = "BufRead",
  234. disable = not O.plugin.diffview.active,
  235. }
  236. -- Lush Create Color Schemes
  237. use {
  238. "rktjmp/lush.nvim",
  239. -- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"},
  240. disable = not O.plugin.lush.active,
  241. }
  242. -- Debugger management
  243. use {
  244. "Pocco81/DAPInstall.nvim",
  245. -- event = "BufRead",
  246. disable = not O.plugin.dap_install.active,
  247. }
  248. -- LANGUAGE SPECIFIC GOES HERE
  249. use {
  250. "lervag/vimtex",
  251. ft = "tex",
  252. config = function()
  253. require "lv-vimtex"
  254. end,
  255. }
  256. -- Rust tools
  257. -- TODO: use lazy loading maybe?
  258. use {
  259. "simrat39/rust-tools.nvim",
  260. disable = not O.lang.rust.rust_tools.active,
  261. }
  262. -- Elixir
  263. use { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } }
  264. -- Javascript / Typescript
  265. use {
  266. "jose-elias-alvarez/nvim-lsp-ts-utils",
  267. ft = {
  268. "javascript",
  269. "javascriptreact",
  270. "javascript.jsx",
  271. "typescript",
  272. "typescriptreact",
  273. "typescript.tsx",
  274. },
  275. }
  276. -- use {
  277. -- "jose-elias-alvarez/null-ls.nvim",
  278. -- ft = {
  279. -- "javascript",
  280. -- "javascriptreact",
  281. -- "javascript.jsx",
  282. -- "typescript",
  283. -- "typescriptreact",
  284. -- "typescript.tsx",
  285. -- },
  286. -- config = function()
  287. -- require("null-ls").setup()
  288. -- end,
  289. -- }
  290. -- Pretty parentheses
  291. use {
  292. "p00f/nvim-ts-rainbow",
  293. disable = not O.plugin.ts_rainbow.active,
  294. }
  295. -- Autotags <div>|</div>
  296. use {
  297. "windwp/nvim-ts-autotag",
  298. event = "InsertEnter",
  299. disable = not O.plugin.ts_autotag.active,
  300. }
  301. -- Custom semantic text objects
  302. use {
  303. "nvim-treesitter/nvim-treesitter-textobjects",
  304. disable = not O.plugin.ts_textobjects.active,
  305. }
  306. -- Smart text objects
  307. use {
  308. "RRethy/nvim-treesitter-textsubjects",
  309. disable = not O.plugin.ts_textsubjects.active,
  310. }
  311. -- Text objects using hint labels
  312. use {
  313. "mfussenegger/nvim-ts-hint-textobject",
  314. event = "BufRead",
  315. disable = not O.plugin.ts_hintobjects.active,
  316. }
  317. for _, plugin in pairs(O.user_plugins) do
  318. packer.use(plugin)
  319. end
  320. end)