plugins.lua 7.8 KB

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