plugins.lua 5.8 KB

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