plugins.lua 7.1 KB

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