plugins.lua 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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. use { "nvim-lua/popup.nvim" }
  28. use { "nvim-lua/plenary.nvim" }
  29. use { "tjdevries/astronauta.nvim" }
  30. -- Telescope
  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. -- NvimTree
  57. use {
  58. "kyazdani42/nvim-tree.lua",
  59. -- event = "BufWinOpen",
  60. -- cmd = "NvimTreeToggle",
  61. commit = "fd7f60e242205ea9efc9649101c81a07d5f458bb",
  62. config = function()
  63. require("lv-nvimtree").config()
  64. end,
  65. }
  66. use {
  67. "lewis6991/gitsigns.nvim",
  68. config = function()
  69. require("lv-gitsigns").config()
  70. end,
  71. event = "BufRead",
  72. }
  73. -- whichkey
  74. use {
  75. "folke/which-key.nvim",
  76. config = function()
  77. require "lv-which-key"
  78. end,
  79. event = "BufWinEnter",
  80. }
  81. -- Autopairs
  82. use {
  83. "windwp/nvim-autopairs",
  84. event = "InsertEnter",
  85. after = { "telescope.nvim" },
  86. config = function()
  87. require "lv-autopairs"
  88. end,
  89. }
  90. -- Comments
  91. use {
  92. "terrortylor/nvim-comment",
  93. event = "BufWinEnter",
  94. config = function()
  95. local status_ok, nvim_comment = pcall(require, "nvim_comment")
  96. if not status_ok then
  97. return
  98. end
  99. nvim_comment.setup()
  100. end,
  101. }
  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 = "BufWinEnter",
  111. disable = not O.plugin.galaxyline.active,
  112. }
  113. use {
  114. "romgrk/barbar.nvim",
  115. config = function()
  116. require "lv-barbar"
  117. end,
  118. event = "BufWinEnter",
  119. }
  120. -- Debugging
  121. use {
  122. "mfussenegger/nvim-dap",
  123. event = "BufWinEnter",
  124. config = function()
  125. require "lv-dap"
  126. end,
  127. disable = not O.plugin.dap.active,
  128. }
  129. -- Debugger management
  130. use {
  131. "Pocco81/DAPInstall.nvim",
  132. event = "BufWinEnter",
  133. -- event = "BufRead",
  134. disable = not O.plugin.dap.active,
  135. }
  136. -- Builtins, these do not load by default
  137. -- Dashboard
  138. use {
  139. "ChristianChiarulli/dashboard-nvim",
  140. event = "BufWinEnter",
  141. config = function()
  142. require("lv-dashboard").config()
  143. end,
  144. disable = not O.plugin.dashboard.active,
  145. }
  146. -- TODO remove in favor of akinsho/nvim-toggleterm.lua
  147. -- Floating terminal
  148. use {
  149. "numToStr/FTerm.nvim",
  150. event = "BufWinEnter",
  151. config = function()
  152. require("lv-floatterm").config()
  153. end,
  154. disable = not O.plugin.floatterm.active,
  155. }
  156. -- Zen Mode
  157. use {
  158. "folke/zen-mode.nvim",
  159. cmd = "ZenMode",
  160. event = "BufRead",
  161. config = function()
  162. require("lv-zen").config()
  163. end,
  164. disable = not O.plugin.zen.active,
  165. }
  166. use {
  167. "lukas-reineke/indent-blankline.nvim",
  168. event = "BufRead",
  169. setup = function()
  170. vim.g.indentLine_enabled = 1
  171. vim.g.indent_blankline_char = "▏"
  172. vim.g.indent_blankline_filetype_exclude = {
  173. "help",
  174. "terminal",
  175. "dashboard",
  176. }
  177. vim.g.indent_blankline_buftype_exclude = { "terminal" }
  178. vim.g.indent_blankline_show_trailing_blankline_indent = false
  179. vim.g.indent_blankline_show_first_indent_level = true
  180. end,
  181. disable = not O.plugin.indent_line.active,
  182. }
  183. -- Diffview
  184. use {
  185. "sindrets/diffview.nvim",
  186. event = "BufRead",
  187. disable = not O.plugin.diffview.active,
  188. }
  189. ---------------------------------------------------------------------------------
  190. -- comments in context
  191. use {
  192. "JoosepAlviste/nvim-ts-context-commentstring",
  193. event = "BufRead",
  194. disable = not O.plugin.ts_context_commentstring.active,
  195. }
  196. -- Use project for telescope
  197. use {
  198. "nvim-telescope/telescope-project.nvim",
  199. event = "BufWinEnter",
  200. setup = function()
  201. vim.cmd [[packadd telescope.nvim]]
  202. end,
  203. disable = not O.plugin.telescope_project.active,
  204. }
  205. -- Lush Create Color Schemes
  206. use {
  207. "rktjmp/lush.nvim",
  208. -- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"},
  209. disable = not O.plugin.lush.active,
  210. }
  211. -- LANGUAGE SPECIFIC GOES HERE
  212. use {
  213. "lervag/vimtex",
  214. ft = "tex",
  215. }
  216. -- Rust tools
  217. -- TODO: use lazy loading maybe?
  218. use {
  219. "simrat39/rust-tools.nvim",
  220. disable = not O.lang.rust.rust_tools.active,
  221. }
  222. -- Elixir
  223. use { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } }
  224. -- Javascript / Typescript
  225. use {
  226. "jose-elias-alvarez/nvim-lsp-ts-utils",
  227. ft = {
  228. "javascript",
  229. "javascriptreact",
  230. "javascript.jsx",
  231. "typescript",
  232. "typescriptreact",
  233. "typescript.tsx",
  234. },
  235. }
  236. use {
  237. "mfussenegger/nvim-jdtls",
  238. ft = { "java" },
  239. disable = not O.lang.java.java_tools.active,
  240. }
  241. -- use {
  242. -- "jose-elias-alvarez/null-ls.nvim",
  243. -- ft = {
  244. -- "javascript",
  245. -- "javascriptreact",
  246. -- "javascript.jsx",
  247. -- "typescript",
  248. -- "typescriptreact",
  249. -- "typescript.tsx",
  250. -- },
  251. -- config = function()
  252. -- require("null-ls").setup()
  253. -- end,
  254. -- }
  255. -- Custom semantic text objects
  256. use {
  257. "nvim-treesitter/nvim-treesitter-textobjects",
  258. disable = not O.plugin.ts_textobjects.active,
  259. }
  260. -- Smart text objects
  261. use {
  262. "RRethy/nvim-treesitter-textsubjects",
  263. disable = not O.plugin.ts_textsubjects.active,
  264. }
  265. -- Text objects using hint labels
  266. use {
  267. "mfussenegger/nvim-ts-hint-textobject",
  268. event = "BufRead",
  269. disable = not O.plugin.ts_hintobjects.active,
  270. }
  271. for _, plugin in pairs(O.user_plugins) do
  272. packer.use(plugin)
  273. end
  274. end)