plugins.lua 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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 {
  27. "kabouzeid/nvim-lspinstall",
  28. event = "VimEnter",
  29. config = function()
  30. require("lspinstall").setup()
  31. end,
  32. }
  33. use { "nvim-lua/popup.nvim" }
  34. use { "nvim-lua/plenary.nvim" }
  35. use { "tjdevries/astronauta.nvim" }
  36. -- Telescope
  37. use {
  38. "nvim-telescope/telescope.nvim",
  39. config = [[require('lv-telescope')]],
  40. }
  41. -- Autocomplete
  42. use {
  43. "hrsh7th/nvim-compe",
  44. -- event = "InsertEnter",
  45. config = function()
  46. require("lv-compe").config()
  47. end,
  48. }
  49. -- Autopairs
  50. use {
  51. "windwp/nvim-autopairs",
  52. -- event = "InsertEnter",
  53. after = { "telescope.nvim" },
  54. config = function()
  55. require "lv-autopairs"
  56. end,
  57. }
  58. -- Snippets
  59. use { "hrsh7th/vim-vsnip", event = "InsertEnter" }
  60. use { "rafamadriz/friendly-snippets", event = "InsertEnter" }
  61. -- Treesitter
  62. use { "nvim-treesitter/nvim-treesitter" }
  63. -- Formatter.nvim
  64. use {
  65. "mhartington/formatter.nvim",
  66. config = function()
  67. require "lv-formatter"
  68. end,
  69. event = "BufRead",
  70. }
  71. -- NvimTree
  72. use {
  73. "kyazdani42/nvim-tree.lua",
  74. -- event = "BufWinOpen",
  75. -- cmd = "NvimTreeToggle",
  76. commit = "fd7f60e242205ea9efc9649101c81a07d5f458bb",
  77. config = function()
  78. require("lv-nvimtree").config()
  79. end,
  80. }
  81. use {
  82. "lewis6991/gitsigns.nvim",
  83. config = function()
  84. require("lv-gitsigns").config()
  85. end,
  86. event = "BufRead",
  87. }
  88. -- whichkey
  89. use {
  90. "folke/which-key.nvim",
  91. config = function()
  92. require "lv-which-key"
  93. end,
  94. event = "BufWinEnter",
  95. }
  96. -- Comments
  97. use {
  98. "terrortylor/nvim-comment",
  99. event = "BufRead",
  100. config = function()
  101. local status_ok, nvim_comment = pcall(require, "nvim_comment")
  102. if not status_ok then
  103. return
  104. end
  105. nvim_comment.setup()
  106. end,
  107. }
  108. -- Icons
  109. use { "kyazdani42/nvim-web-devicons" }
  110. -- Status Line and Bufferline
  111. use {
  112. "glepnir/galaxyline.nvim",
  113. config = function()
  114. require "lv-galaxyline"
  115. end,
  116. event = "BufWinEnter",
  117. disable = not O.plugin.galaxyline.active,
  118. }
  119. use {
  120. "romgrk/barbar.nvim",
  121. config = function()
  122. require "lv-barbar"
  123. end,
  124. event = "BufWinEnter",
  125. }
  126. -- Debugging
  127. use {
  128. "mfussenegger/nvim-dap",
  129. -- event = "BufWinEnter",
  130. config = function()
  131. require "lv-dap"
  132. end,
  133. disable = not O.plugin.dap.active,
  134. }
  135. -- Debugger management
  136. use {
  137. "Pocco81/DAPInstall.nvim",
  138. -- event = "BufWinEnter",
  139. -- event = "BufRead",
  140. disable = not O.plugin.dap.active,
  141. }
  142. -- Builtins, these do not load by default
  143. -- Dashboard
  144. use {
  145. "ChristianChiarulli/dashboard-nvim",
  146. event = "BufWinEnter",
  147. config = function()
  148. require("lv-dashboard").config()
  149. end,
  150. disable = not O.plugin.dashboard.active,
  151. }
  152. -- TODO: remove in favor of akinsho/nvim-toggleterm.lua
  153. -- Floating terminal
  154. use {
  155. "numToStr/FTerm.nvim",
  156. event = "BufWinEnter",
  157. config = function()
  158. require("lv-floatterm").config()
  159. end,
  160. disable = not O.plugin.floatterm.active,
  161. }
  162. -- Zen Mode
  163. use {
  164. "folke/zen-mode.nvim",
  165. cmd = "ZenMode",
  166. event = "BufRead",
  167. config = function()
  168. require("lv-zen").config()
  169. end,
  170. disable = not O.plugin.zen.active,
  171. }
  172. use {
  173. "lukas-reineke/indent-blankline.nvim",
  174. event = "BufRead",
  175. setup = function()
  176. vim.g.indentLine_enabled = 1
  177. vim.g.indent_blankline_char = "▏"
  178. vim.g.indent_blankline_filetype_exclude = {
  179. "help",
  180. "terminal",
  181. "dashboard",
  182. }
  183. vim.g.indent_blankline_buftype_exclude = { "terminal" }
  184. vim.g.indent_blankline_show_trailing_blankline_indent = false
  185. vim.g.indent_blankline_show_first_indent_level = true
  186. end,
  187. disable = not O.plugin.indent_line.active,
  188. }
  189. ---------------------------------------------------------------------------------
  190. -- LANGUAGE SPECIFIC GOES HERE
  191. use {
  192. "lervag/vimtex",
  193. ft = "tex",
  194. }
  195. -- Rust tools
  196. -- TODO: use lazy loading maybe?
  197. use {
  198. "simrat39/rust-tools.nvim",
  199. disable = not O.lang.rust.rust_tools.active,
  200. }
  201. -- Elixir
  202. use { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } }
  203. -- Javascript / Typescript
  204. use {
  205. "jose-elias-alvarez/nvim-lsp-ts-utils",
  206. ft = {
  207. "javascript",
  208. "javascriptreact",
  209. "javascript.jsx",
  210. "typescript",
  211. "typescriptreact",
  212. "typescript.tsx",
  213. },
  214. }
  215. use {
  216. "mfussenegger/nvim-jdtls",
  217. -- ft = { "java" },
  218. disable = not O.lang.java.java_tools.active,
  219. }
  220. -- Custom semantic text objects
  221. use {
  222. "nvim-treesitter/nvim-treesitter-textobjects",
  223. disable = not O.plugin.ts_textobjects.active,
  224. }
  225. -- Smart text objects
  226. use {
  227. "RRethy/nvim-treesitter-textsubjects",
  228. disable = not O.plugin.ts_textsubjects.active,
  229. }
  230. -- Text objects using hint labels
  231. use {
  232. "mfussenegger/nvim-ts-hint-textobject",
  233. event = "BufRead",
  234. disable = not O.plugin.ts_hintobjects.active,
  235. }
  236. for _, plugin in pairs(O.user_plugins) do
  237. packer.use(plugin)
  238. end
  239. end)