plugins.lua 5.9 KB

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