plugins.lua 7.0 KB

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