plugins.lua 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  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("core.gitsigns").setup()
  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. -- whichkey
  109. use {
  110. "airblade/vim-rooter",
  111. config = function()
  112. vim.g.rooter_silent_chdir = 1
  113. end,
  114. }
  115. -- Icons
  116. use { "kyazdani42/nvim-web-devicons" }
  117. -- Status Line and Bufferline
  118. use {
  119. "glepnir/galaxyline.nvim",
  120. config = function()
  121. require "lv-galaxyline"
  122. end,
  123. event = "BufWinEnter",
  124. disable = not O.plugin.galaxyline.active,
  125. }
  126. use {
  127. "romgrk/barbar.nvim",
  128. config = function()
  129. require "lv-barbar"
  130. end,
  131. event = "BufWinEnter",
  132. }
  133. -- Debugging
  134. use {
  135. "mfussenegger/nvim-dap",
  136. -- event = "BufWinEnter",
  137. config = function()
  138. require "lv-dap"
  139. end,
  140. disable = not O.plugin.dap.active,
  141. }
  142. -- Debugger management
  143. use {
  144. "Pocco81/DAPInstall.nvim",
  145. -- event = "BufWinEnter",
  146. -- event = "BufRead",
  147. disable = not O.plugin.dap.active,
  148. }
  149. -- Builtins, these do not load by default
  150. -- Dashboard
  151. use {
  152. "ChristianChiarulli/dashboard-nvim",
  153. event = "BufWinEnter",
  154. config = function()
  155. require("lv-dashboard").config()
  156. end,
  157. disable = not O.plugin.dashboard.active,
  158. }
  159. -- TODO: remove in favor of akinsho/nvim-toggleterm.lua
  160. -- Floating terminal
  161. use {
  162. "numToStr/FTerm.nvim",
  163. event = "BufWinEnter",
  164. config = function()
  165. require("lv-floatterm").config()
  166. end,
  167. disable = not O.plugin.floatterm.active,
  168. }
  169. -- Zen Mode
  170. use {
  171. "folke/zen-mode.nvim",
  172. cmd = "ZenMode",
  173. event = "BufRead",
  174. config = function()
  175. require("lv-zen").config()
  176. end,
  177. disable = not O.plugin.zen.active,
  178. }
  179. use {
  180. "lukas-reineke/indent-blankline.nvim",
  181. event = "BufRead",
  182. setup = function()
  183. vim.g.indentLine_enabled = 1
  184. vim.g.indent_blankline_char = "▏"
  185. vim.g.indent_blankline_filetype_exclude = {
  186. "help",
  187. "terminal",
  188. "dashboard",
  189. }
  190. vim.g.indent_blankline_buftype_exclude = { "terminal" }
  191. vim.g.indent_blankline_show_trailing_blankline_indent = false
  192. vim.g.indent_blankline_show_first_indent_level = true
  193. end,
  194. disable = not O.plugin.indent_line.active,
  195. }
  196. ---------------------------------------------------------------------------------
  197. -- LANGUAGE SPECIFIC GOES HERE
  198. use {
  199. "lervag/vimtex",
  200. ft = "tex",
  201. }
  202. -- Rust tools
  203. -- TODO: use lazy loading maybe?
  204. use {
  205. "simrat39/rust-tools.nvim",
  206. disable = not O.lang.rust.rust_tools.active,
  207. }
  208. -- Elixir
  209. use { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } }
  210. -- Javascript / Typescript
  211. use {
  212. "jose-elias-alvarez/nvim-lsp-ts-utils",
  213. ft = {
  214. "javascript",
  215. "javascriptreact",
  216. "javascript.jsx",
  217. "typescript",
  218. "typescriptreact",
  219. "typescript.tsx",
  220. },
  221. }
  222. use {
  223. "mfussenegger/nvim-jdtls",
  224. -- ft = { "java" },
  225. disable = not O.lang.java.java_tools.active,
  226. }
  227. -- Custom semantic text objects
  228. use {
  229. "nvim-treesitter/nvim-treesitter-textobjects",
  230. disable = not O.plugin.ts_textobjects.active,
  231. }
  232. -- Smart text objects
  233. use {
  234. "RRethy/nvim-treesitter-textsubjects",
  235. disable = not O.plugin.ts_textsubjects.active,
  236. }
  237. -- Text objects using hint labels
  238. use {
  239. "mfussenegger/nvim-ts-hint-textobject",
  240. event = "BufRead",
  241. disable = not O.plugin.ts_hintobjects.active,
  242. }
  243. for _, plugin in pairs(O.user_plugins) do
  244. packer.use(plugin)
  245. end
  246. end)