plugins.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  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 " ..
  6. install_path)
  7. execute "packadd packer.nvim"
  8. end
  9. local packer_ok, packer = pcall(require, "packer")
  10. if not packer_ok then return end
  11. packer.init {
  12. -- compile_path = vim.fn.stdpath('data')..'/site/pack/loader/start/packer.nvim/plugin/packer_compiled.vim',
  13. compile_path = require("packer.util").join_paths(vim.fn.stdpath('config'),
  14. 'plugin',
  15. 'packer_compiled.vim'),
  16. git = {clone_timeout = 300},
  17. display = {
  18. open_fn = function()
  19. return require("packer.util").float {border = "single"}
  20. end
  21. }
  22. }
  23. vim.cmd "autocmd BufWritePost plugins.lua PackerCompile" -- Auto compile when there are changes in plugins.lua
  24. return require("packer").startup(function(use)
  25. -- Packer can manage itself as an optional plugin
  26. use "wbthomason/packer.nvim"
  27. -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function)
  28. use {"neovim/nvim-lspconfig"}
  29. use {"glepnir/lspsaga.nvim", cmd = "Lspsaga"}
  30. use {"kabouzeid/nvim-lspinstall", cmd = "LspInstall"}
  31. -- Telescope
  32. use {"nvim-lua/popup.nvim"}
  33. use {"nvim-lua/plenary.nvim"}
  34. use {"tjdevries/astronauta.nvim"}
  35. use {
  36. "nvim-telescope/telescope.nvim",
  37. config = [[require('lv-telescope')]],
  38. cmd = "Telescope"
  39. }
  40. -- Snap TODO disable for now, need to only install fzy when user specifies they want to use snap
  41. -- use {
  42. -- "camspiers/snap",
  43. -- rocks = "fzy",
  44. -- config = function()
  45. -- require("lv-snap").config()
  46. -- end,
  47. -- disable = not O.plugin.snap.active
  48. -- }
  49. -- Autocomplete
  50. use {
  51. "hrsh7th/nvim-compe",
  52. event = "InsertEnter",
  53. config = function()
  54. require("lv-compe").config()
  55. end
  56. }
  57. use {"hrsh7th/vim-vsnip", event = "InsertEnter"}
  58. use {"rafamadriz/friendly-snippets", event = "InsertEnter"}
  59. -- Treesitter
  60. use {"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}
  61. use {
  62. "kyazdani42/nvim-tree.lua",
  63. -- cmd = "NvimTreeToggle",
  64. config = function()
  65. require("lv-nvimtree").config()
  66. end
  67. }
  68. use {
  69. "lewis6991/gitsigns.nvim",
  70. config = function()
  71. require("lv-gitsigns").config()
  72. end,
  73. event = "BufRead"
  74. }
  75. -- whichkey
  76. use {"folke/which-key.nvim"}
  77. -- Autopairs
  78. use {
  79. -- event = "InsertEnter",
  80. "windwp/nvim-autopairs",
  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 =
  199. {"help", "terminal", "dashboard"}
  200. vim.g.indent_blankline_buftype_exclude = {"terminal"}
  201. vim.g.indent_blankline_show_trailing_blankline_indent = false
  202. vim.g.indent_blankline_show_first_indent_level = true
  203. end,
  204. disable = not O.plugin.indent_line.active
  205. }
  206. -- comments in context
  207. use {
  208. 'JoosepAlviste/nvim-ts-context-commentstring',
  209. event = "BufRead",
  210. disable = not O.plugin.ts_context_commentstring.active
  211. }
  212. -- Symbol Outline
  213. use {
  214. 'simrat39/symbols-outline.nvim',
  215. cmd = 'SymbolsOutline',
  216. disable = not O.plugin.symbol_outline.active
  217. }
  218. -- diagnostics
  219. use {
  220. "folke/trouble.nvim",
  221. cmd = 'TroubleToggle',
  222. disable = not O.plugin.trouble.active
  223. }
  224. -- Debugging
  225. use {
  226. "mfussenegger/nvim-dap",
  227. event = "BufRead",
  228. disable = not O.plugin.debug.active
  229. }
  230. -- Better quickfix
  231. use {
  232. "kevinhwang91/nvim-bqf",
  233. event = "BufRead",
  234. disable = not O.plugin.bqf.active
  235. }
  236. -- Floating terminal
  237. use {
  238. 'numToStr/FTerm.nvim',
  239. event = "BufRead",
  240. config = function()
  241. require'FTerm'.setup({
  242. dimensions = {height = 0.8, width = 0.8, x = 0.5, y = 0.5},
  243. border = 'single' -- or 'double'
  244. })
  245. end,
  246. disable = not O.plugin.floatterm.active
  247. }
  248. -- Search & Replace
  249. use {
  250. 'windwp/nvim-spectre',
  251. event = "BufRead",
  252. config = function()
  253. require('spectre').setup()
  254. end,
  255. disable = not O.plugin.spectre.active
  256. }
  257. -- lsp root with this nvim-tree will follow you
  258. use {
  259. "ahmedkhalf/lsp-rooter.nvim",
  260. event = "BufRead",
  261. config = function()
  262. require("lsp-rooter").setup()
  263. end,
  264. disable = not O.plugin.lsp_rooter.active
  265. }
  266. -- Markdown preview
  267. use {
  268. 'iamcco/markdown-preview.nvim',
  269. run = 'cd app && npm install',
  270. ft = 'markdown',
  271. disable = not O.plugin.markdown_preview.active
  272. }
  273. -- Interactive scratchpad
  274. use {
  275. 'metakirby5/codi.vim',
  276. cmd = 'Codi',
  277. disable = not O.plugin.codi.active
  278. }
  279. -- Use fzy for telescope
  280. use {
  281. "nvim-telescope/telescope-fzy-native.nvim",
  282. event = "BufRead",
  283. disable = not O.plugin.telescope_fzy.active
  284. }
  285. -- Use project for telescope
  286. use {
  287. "nvim-telescope/telescope-project.nvim",
  288. event = "BufRead",
  289. after = "telescope.nvim",
  290. disable = not O.plugin.telescope_project.active
  291. }
  292. -- Sane gx for netrw_gx bug
  293. use {
  294. "felipec/vim-sanegx",
  295. event = "BufRead",
  296. disable = not O.plugin.sanegx.active
  297. }
  298. -- Sane gx for netrw_gx bug
  299. use {
  300. "folke/todo-comments.nvim",
  301. event = "BufRead",
  302. disable = not O.plugin.todo_comments.active
  303. }
  304. -- LSP Colors
  305. use {
  306. "folke/lsp-colors.nvim",
  307. event = "BufRead",
  308. disable = not O.plugin.lsp_colors.active
  309. }
  310. -- Git Blame
  311. use {
  312. "f-person/git-blame.nvim",
  313. event = "BufRead",
  314. disable = not O.plugin.git_blame.active
  315. }
  316. use {
  317. 'ruifm/gitlinker.nvim',
  318. event = "BufRead",
  319. config = function()
  320. require"gitlinker".setup({
  321. opts = {
  322. -- remote = 'github', -- force the use of a specific remote
  323. -- adds current line nr in the url for normal mode
  324. add_current_line_on_normal_mode = true,
  325. -- callback for what to do with the url
  326. action_callback = require"gitlinker.actions".open_in_browser,
  327. -- print the url after performing the action
  328. print_url = false,
  329. -- mapping to call url generation
  330. mappings = "<leader>gy"
  331. }
  332. })
  333. end,
  334. disable = not O.plugin.gitlinker.active,
  335. requires = 'nvim-lua/plenary.nvim'
  336. }
  337. -- Lazygit
  338. use {
  339. "kdheepak/lazygit.nvim",
  340. cmd = "LazyGit",
  341. disable = not O.plugin.lazygit.active
  342. }
  343. -- Octo
  344. use {
  345. "pwntester/octo.nvim",
  346. event = "BufRead",
  347. disable = not O.plugin.octo.active
  348. }
  349. -- Diffview
  350. use {
  351. "sindrets/diffview.nvim",
  352. event = "BufRead",
  353. disable = not O.plugin.diffview.active
  354. }
  355. -- Easily Create Gists
  356. use {
  357. "mattn/vim-gist",
  358. event = "BufRead",
  359. disable = not O.plugin.gist.active,
  360. requires = 'mattn/webapi-vim'
  361. }
  362. -- Lush Create Color Schemes
  363. use {
  364. "rktjmp/lush.nvim",
  365. -- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"},
  366. disable = not O.plugin.lush.active
  367. }
  368. -- HTML preview
  369. use {
  370. 'turbio/bracey.vim',
  371. event = "BufRead",
  372. run = 'npm install --prefix server',
  373. disable = not O.plugin.bracey.active
  374. }
  375. -- Debugger management
  376. use {
  377. 'Pocco81/DAPInstall.nvim',
  378. event = "BufRead",
  379. disable = not O.plugin.dap_install.active
  380. }
  381. -- LANGUAGE SPECIFIC GOES HERE
  382. -- Latex TODO what filetypes should this be active for?
  383. use {"lervag/vimtex", ft = "latex"}
  384. -- Rust tools
  385. -- TODO: use lazy loading maybe?
  386. use {
  387. "simrat39/rust-tools.nvim",
  388. disable = not O.lang.rust.rust_tools.active
  389. }
  390. -- Elixir
  391. use {"elixir-editors/vim-elixir", ft = {"elixir", "eelixir", "euphoria3"}}
  392. -- Tabnine
  393. use {
  394. "tzachar/compe-tabnine",
  395. run = "./install.sh",
  396. requires = "hrsh7th/nvim-compe",
  397. disable = not O.plugin.tabnine.active
  398. }
  399. end)