plugins.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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. -- compile_path = vim.fn.stdpath('data')..'/site/pack/loader/start/packer.nvim/plugin/packer_compiled.vim',
  14. compile_path = require("packer.util").join_paths(vim.fn.stdpath "config", "plugin", "packer_compiled.vim"),
  15. git = { clone_timeout = 300 },
  16. display = {
  17. open_fn = function()
  18. return require("packer.util").float { border = "single" }
  19. end,
  20. },
  21. }
  22. vim.cmd "autocmd BufWritePost plugins.lua PackerCompile"
  23. return require("packer").startup(function(use)
  24. -- Packer can manage itself as an optional plugin
  25. use "wbthomason/packer.nvim"
  26. -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function)
  27. use { "neovim/nvim-lspconfig" }
  28. use { "glepnir/lspsaga.nvim", cmd = "Lspsaga" }
  29. use { "kabouzeid/nvim-lspinstall", cmd = "LspInstall" }
  30. -- Telescope
  31. use { "nvim-lua/popup.nvim" }
  32. use { "nvim-lua/plenary.nvim" }
  33. use { "tjdevries/astronauta.nvim" }
  34. use {
  35. "nvim-telescope/telescope.nvim",
  36. config = [[require('lv-telescope')]],
  37. cmd = "Telescope",
  38. }
  39. -- Snap TODO disable for now, need to only install fzy when user specifies they want to use snap
  40. -- use {
  41. -- "camspiers/snap",
  42. -- rocks = "fzy",
  43. -- config = function()
  44. -- require("lv-snap").config()
  45. -- end,
  46. -- disable = not O.plugin.snap.active
  47. -- }
  48. -- Autocomplete
  49. use {
  50. "hrsh7th/nvim-compe",
  51. event = "InsertEnter",
  52. config = function()
  53. require("lv-compe").config()
  54. end,
  55. }
  56. use { "hrsh7th/vim-vsnip", event = "InsertEnter" }
  57. use { "rafamadriz/friendly-snippets", event = "InsertEnter" }
  58. -- Treesitter
  59. use { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }
  60. use {
  61. "kyazdani42/nvim-tree.lua",
  62. -- cmd = "NvimTreeToggle",
  63. config = function()
  64. require("lv-nvimtree").config()
  65. end,
  66. }
  67. use {
  68. "lewis6991/gitsigns.nvim",
  69. config = function()
  70. require("lv-gitsigns").config()
  71. end,
  72. event = "BufRead",
  73. }
  74. -- whichkey
  75. use { "folke/which-key.nvim" }
  76. -- Autopairs
  77. use {
  78. "windwp/nvim-autopairs",
  79. event = "InsertEnter",
  80. after = { "telescope.nvim", "nvim-compe" },
  81. config = function()
  82. require "lv-autopairs"
  83. end,
  84. }
  85. -- Comments
  86. use {
  87. "terrortylor/nvim-comment",
  88. cmd = "CommentToggle",
  89. config = function()
  90. require("nvim_comment").setup()
  91. end,
  92. }
  93. -- Color
  94. use { "christianchiarulli/nvcode-color-schemes.vim", opt = true }
  95. -- Icons
  96. use { "kyazdani42/nvim-web-devicons" }
  97. -- Status Line and Bufferline
  98. use { "glepnir/galaxyline.nvim" }
  99. use {
  100. "akinsho/nvim-bufferline.lua",
  101. config = function()
  102. require("lv-bufferline").config()
  103. end,
  104. event = "BufRead",
  105. }
  106. -- Extras, these do not load by default
  107. -- Better motions
  108. use {
  109. "phaazon/hop.nvim",
  110. event = "BufRead",
  111. config = function()
  112. require("lv-hop").config()
  113. end,
  114. disable = not O.plugin.hop.active,
  115. opt = true,
  116. }
  117. -- Enhanced increment/decrement
  118. use {
  119. "monaqa/dial.nvim",
  120. event = "BufRead",
  121. config = function()
  122. require("lv-dial").config()
  123. end,
  124. disable = not O.plugin.dial.active,
  125. opt = true,
  126. }
  127. -- Dashboard
  128. use {
  129. "ChristianChiarulli/dashboard-nvim",
  130. event = "BufWinEnter",
  131. cmd = { "Dashboard", "DashboardNewFile", "DashboardJumpMarks" },
  132. config = function()
  133. require("lv-dashboard").config()
  134. end,
  135. disable = not O.plugin.dashboard.active,
  136. opt = true,
  137. }
  138. -- Zen Mode
  139. use {
  140. "folke/zen-mode.nvim",
  141. cmd = "ZenMode",
  142. -- event = "BufRead",
  143. config = function()
  144. require("lv-zen").config()
  145. end,
  146. disable = not O.plugin.zen.active,
  147. }
  148. -- Ranger
  149. use {
  150. "kevinhwang91/rnvimr",
  151. cmd = "Rnvimr",
  152. config = function()
  153. require("lv-rnvimr").config()
  154. end,
  155. disable = not O.plugin.ranger.active,
  156. }
  157. -- matchup
  158. use {
  159. "andymass/vim-matchup",
  160. event = "CursorMoved",
  161. config = function()
  162. require("lv-matchup").config()
  163. end,
  164. disable = not O.plugin.matchup.active,
  165. }
  166. use {
  167. "norcalli/nvim-colorizer.lua",
  168. event = "BufRead",
  169. config = function()
  170. require("colorizer").setup()
  171. vim.cmd "ColorizerReloadAllBuffers"
  172. end,
  173. disable = not O.plugin.colorizer.active,
  174. }
  175. use {
  176. "nacro90/numb.nvim",
  177. event = "BufRead",
  178. config = function()
  179. require("numb").setup {
  180. show_numbers = true, -- Enable 'number' for the window while peeking
  181. show_cursorline = true, -- Enable 'cursorline' for the window while peeking
  182. }
  183. end,
  184. disable = not O.plugin.numb.active,
  185. }
  186. -- Treesitter playground
  187. use {
  188. "nvim-treesitter/playground",
  189. event = "BufRead",
  190. disable = not O.plugin.ts_playground.active,
  191. }
  192. use {
  193. "lukas-reineke/indent-blankline.nvim",
  194. event = "BufRead",
  195. setup = function()
  196. vim.g.indentLine_enabled = 1
  197. vim.g.indent_blankline_char = "▏"
  198. vim.g.indent_blankline_filetype_exclude = { "help", "terminal", "dashboard" }
  199. vim.g.indent_blankline_buftype_exclude = { "terminal" }
  200. vim.g.indent_blankline_show_trailing_blankline_indent = false
  201. vim.g.indent_blankline_show_first_indent_level = true
  202. end,
  203. disable = not O.plugin.indent_line.active,
  204. }
  205. -- comments in context
  206. use {
  207. "JoosepAlviste/nvim-ts-context-commentstring",
  208. event = "BufRead",
  209. disable = not O.plugin.ts_context_commentstring.active,
  210. }
  211. -- Symbol Outline
  212. use {
  213. "simrat39/symbols-outline.nvim",
  214. cmd = "SymbolsOutline",
  215. disable = not O.plugin.symbol_outline.active,
  216. }
  217. -- diagnostics
  218. use {
  219. "folke/trouble.nvim",
  220. cmd = "TroubleToggle",
  221. disable = not O.plugin.trouble.active,
  222. }
  223. -- Debugging
  224. use {
  225. "mfussenegger/nvim-dap",
  226. event = "BufRead",
  227. disable = not O.plugin.debug.active,
  228. }
  229. -- Better quickfix
  230. use {
  231. "kevinhwang91/nvim-bqf",
  232. event = "BufRead",
  233. disable = not O.plugin.bqf.active,
  234. }
  235. -- Floating terminal
  236. use {
  237. "numToStr/FTerm.nvim",
  238. event = "BufRead",
  239. config = function()
  240. require("FTerm").setup {
  241. dimensions = { height = 0.8, width = 0.8, x = 0.5, y = 0.5 },
  242. border = "single", -- or 'double'
  243. }
  244. end,
  245. disable = not O.plugin.floatterm.active,
  246. }
  247. -- Search & Replace
  248. use {
  249. "windwp/nvim-spectre",
  250. event = "BufRead",
  251. config = function()
  252. require("spectre").setup()
  253. end,
  254. disable = not O.plugin.spectre.active,
  255. }
  256. -- lsp root with this nvim-tree will follow you
  257. use {
  258. "ahmedkhalf/lsp-rooter.nvim",
  259. event = "BufRead",
  260. config = function()
  261. require("lsp-rooter").setup()
  262. end,
  263. disable = not O.plugin.lsp_rooter.active,
  264. }
  265. -- Markdown preview
  266. use {
  267. "iamcco/markdown-preview.nvim",
  268. run = "cd app && npm install",
  269. ft = "markdown",
  270. disable = not O.plugin.markdown_preview.active,
  271. }
  272. -- Interactive scratchpad
  273. use {
  274. "metakirby5/codi.vim",
  275. cmd = "Codi",
  276. disable = not O.plugin.codi.active,
  277. }
  278. -- Use fzy for telescope
  279. use {
  280. "nvim-telescope/telescope-fzy-native.nvim",
  281. event = "BufRead",
  282. disable = not O.plugin.telescope_fzy.active,
  283. }
  284. -- Use project for telescope
  285. use {
  286. "nvim-telescope/telescope-project.nvim",
  287. event = "BufRead",
  288. after = "telescope.nvim",
  289. disable = not O.plugin.telescope_project.active,
  290. }
  291. -- Sane gx for netrw_gx bug
  292. use {
  293. "felipec/vim-sanegx",
  294. event = "BufRead",
  295. disable = not O.plugin.sanegx.active,
  296. }
  297. -- Sane gx for netrw_gx bug
  298. use {
  299. "folke/todo-comments.nvim",
  300. event = "BufRead",
  301. disable = not O.plugin.todo_comments.active,
  302. }
  303. -- LSP Colors
  304. use {
  305. "folke/lsp-colors.nvim",
  306. event = "BufRead",
  307. disable = not O.plugin.lsp_colors.active,
  308. }
  309. -- Git Blame
  310. use {
  311. "f-person/git-blame.nvim",
  312. event = "BufRead",
  313. disable = not O.plugin.git_blame.active,
  314. }
  315. use {
  316. "ruifm/gitlinker.nvim",
  317. event = "BufRead",
  318. config = function()
  319. require("gitlinker").setup {
  320. opts = {
  321. -- remote = 'github', -- force the use of a specific remote
  322. -- adds current line nr in the url for normal mode
  323. add_current_line_on_normal_mode = true,
  324. -- callback for what to do with the url
  325. action_callback = require("gitlinker.actions").open_in_browser,
  326. -- print the url after performing the action
  327. print_url = false,
  328. -- mapping to call url generation
  329. mappings = "<leader>gy",
  330. },
  331. }
  332. end,
  333. disable = not O.plugin.gitlinker.active,
  334. requires = "nvim-lua/plenary.nvim",
  335. }
  336. -- Lazygit
  337. use {
  338. "kdheepak/lazygit.nvim",
  339. cmd = "LazyGit",
  340. disable = not O.plugin.lazygit.active,
  341. }
  342. -- Octo
  343. use {
  344. "pwntester/octo.nvim",
  345. event = "BufRead",
  346. disable = not O.plugin.octo.active,
  347. }
  348. -- Diffview
  349. use {
  350. "sindrets/diffview.nvim",
  351. event = "BufRead",
  352. disable = not O.plugin.diffview.active,
  353. }
  354. -- Easily Create Gists
  355. use {
  356. "mattn/vim-gist",
  357. event = "BufRead",
  358. disable = not O.plugin.gist.active,
  359. requires = "mattn/webapi-vim",
  360. }
  361. -- Lush Create Color Schemes
  362. use {
  363. "rktjmp/lush.nvim",
  364. -- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"},
  365. disable = not O.plugin.lush.active,
  366. }
  367. -- HTML preview
  368. use {
  369. "turbio/bracey.vim",
  370. event = "BufRead",
  371. run = "npm install --prefix server",
  372. disable = not O.plugin.bracey.active,
  373. }
  374. -- Debugger management
  375. use {
  376. "Pocco81/DAPInstall.nvim",
  377. event = "BufRead",
  378. disable = not O.plugin.dap_install.active,
  379. }
  380. -- LANGUAGE SPECIFIC GOES HERE
  381. use { "lervag/vimtex", ft = "tex" }
  382. -- Rust tools
  383. -- TODO: use lazy loading maybe?
  384. use {
  385. "simrat39/rust-tools.nvim",
  386. disable = not O.lang.rust.rust_tools.active,
  387. }
  388. -- Elixir
  389. use { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } }
  390. -- Javascript / Typescript
  391. use {
  392. "jose-elias-alvarez/nvim-lsp-ts-utils",
  393. ft = {
  394. "javascript",
  395. "javascriptreact",
  396. "javascript.jsx",
  397. "typescript",
  398. "typescriptreact",
  399. "typescript.tsx",
  400. },
  401. }
  402. use {
  403. "jose-elias-alvarez/null-ls.nvim",
  404. ft = {
  405. "javascript",
  406. "javascriptreact",
  407. "javascript.jsx",
  408. "typescript",
  409. "typescriptreact",
  410. "typescript.tsx",
  411. },
  412. config = function()
  413. require("null-ls").setup()
  414. end,
  415. }
  416. -- Tabnine
  417. use {
  418. "tzachar/compe-tabnine",
  419. run = "./install.sh",
  420. requires = "hrsh7th/nvim-compe",
  421. disable = not O.plugin.tabnine.active,
  422. }
  423. end)