plugins.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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. config = function()
  227. require('dap')
  228. vim.fn.sign_define('DapBreakpoint', {text='🛑', texthl='', linehl='', numhl=''})
  229. require('dap').defaults.fallback.terminal_win_cmd = '50vsplit new'
  230. end,
  231. disable = not O.plugin.debug.active,
  232. }
  233. -- Better quickfix
  234. use {
  235. "kevinhwang91/nvim-bqf",
  236. event = "BufRead",
  237. disable = not O.plugin.bqf.active,
  238. }
  239. -- Floating terminal
  240. use {
  241. "numToStr/FTerm.nvim",
  242. event = "BufRead",
  243. config = function()
  244. require("FTerm").setup {
  245. dimensions = { height = 0.8, width = 0.8, x = 0.5, y = 0.5 },
  246. border = "single", -- or 'double'
  247. }
  248. end,
  249. disable = not O.plugin.floatterm.active,
  250. }
  251. -- Search & Replace
  252. use {
  253. "windwp/nvim-spectre",
  254. event = "BufRead",
  255. config = function()
  256. require("spectre").setup()
  257. end,
  258. disable = not O.plugin.spectre.active,
  259. }
  260. -- lsp root with this nvim-tree will follow you
  261. use {
  262. "ahmedkhalf/lsp-rooter.nvim",
  263. event = "BufRead",
  264. config = function()
  265. require("lsp-rooter").setup()
  266. end,
  267. disable = not O.plugin.lsp_rooter.active,
  268. }
  269. -- Markdown preview
  270. use {
  271. "iamcco/markdown-preview.nvim",
  272. run = "cd app && npm install",
  273. ft = "markdown",
  274. disable = not O.plugin.markdown_preview.active,
  275. }
  276. -- Interactive scratchpad
  277. use {
  278. "metakirby5/codi.vim",
  279. cmd = "Codi",
  280. disable = not O.plugin.codi.active,
  281. }
  282. -- Use fzy for telescope
  283. use {
  284. "nvim-telescope/telescope-fzy-native.nvim",
  285. event = "BufRead",
  286. disable = not O.plugin.telescope_fzy.active,
  287. }
  288. -- Use project for telescope
  289. use {
  290. "nvim-telescope/telescope-project.nvim",
  291. event = "BufRead",
  292. after = "telescope.nvim",
  293. disable = not O.plugin.telescope_project.active,
  294. }
  295. -- Sane gx for netrw_gx bug
  296. use {
  297. "felipec/vim-sanegx",
  298. event = "BufRead",
  299. disable = not O.plugin.sanegx.active,
  300. }
  301. -- Sane gx for netrw_gx bug
  302. use {
  303. "folke/todo-comments.nvim",
  304. event = "BufRead",
  305. disable = not O.plugin.todo_comments.active,
  306. }
  307. -- LSP Colors
  308. use {
  309. "folke/lsp-colors.nvim",
  310. event = "BufRead",
  311. disable = not O.plugin.lsp_colors.active,
  312. }
  313. -- Git Blame
  314. use {
  315. "f-person/git-blame.nvim",
  316. event = "BufRead",
  317. disable = not O.plugin.git_blame.active,
  318. }
  319. use {
  320. "ruifm/gitlinker.nvim",
  321. event = "BufRead",
  322. config = function()
  323. require("gitlinker").setup {
  324. opts = {
  325. -- remote = 'github', -- force the use of a specific remote
  326. -- adds current line nr in the url for normal mode
  327. add_current_line_on_normal_mode = true,
  328. -- callback for what to do with the url
  329. action_callback = require("gitlinker.actions").open_in_browser,
  330. -- print the url after performing the action
  331. print_url = false,
  332. -- mapping to call url generation
  333. mappings = "<leader>gy",
  334. },
  335. }
  336. end,
  337. disable = not O.plugin.gitlinker.active,
  338. requires = "nvim-lua/plenary.nvim",
  339. }
  340. -- Lazygit
  341. use {
  342. "kdheepak/lazygit.nvim",
  343. cmd = "LazyGit",
  344. disable = not O.plugin.lazygit.active,
  345. }
  346. -- Octo
  347. use {
  348. "pwntester/octo.nvim",
  349. event = "BufRead",
  350. disable = not O.plugin.octo.active,
  351. }
  352. -- Diffview
  353. use {
  354. "sindrets/diffview.nvim",
  355. event = "BufRead",
  356. disable = not O.plugin.diffview.active,
  357. }
  358. -- Easily Create Gists
  359. use {
  360. "mattn/vim-gist",
  361. event = "BufRead",
  362. disable = not O.plugin.gist.active,
  363. requires = "mattn/webapi-vim",
  364. }
  365. -- Lush Create Color Schemes
  366. use {
  367. "rktjmp/lush.nvim",
  368. -- cmd = {"LushRunQuickstart", "LushRunTutorial", "Lushify"},
  369. disable = not O.plugin.lush.active,
  370. }
  371. -- HTML preview
  372. use {
  373. "turbio/bracey.vim",
  374. event = "BufRead",
  375. run = "npm install --prefix server",
  376. disable = not O.plugin.bracey.active,
  377. }
  378. -- Debugger management
  379. use {
  380. "Pocco81/DAPInstall.nvim",
  381. -- event = "BufRead",
  382. disable = not O.plugin.dap_install.active,
  383. }
  384. -- LANGUAGE SPECIFIC GOES HERE
  385. use { "lervag/vimtex", ft = "tex" }
  386. -- Rust tools
  387. -- TODO: use lazy loading maybe?
  388. use {
  389. "simrat39/rust-tools.nvim",
  390. disable = not O.lang.rust.rust_tools.active,
  391. }
  392. -- Elixir
  393. use { "elixir-editors/vim-elixir", ft = { "elixir", "eelixir", "euphoria3" } }
  394. -- Javascript / Typescript
  395. use {
  396. "jose-elias-alvarez/nvim-lsp-ts-utils",
  397. ft = {
  398. "javascript",
  399. "javascriptreact",
  400. "javascript.jsx",
  401. "typescript",
  402. "typescriptreact",
  403. "typescript.tsx",
  404. }
  405. }
  406. -- use {
  407. -- "jose-elias-alvarez/null-ls.nvim",
  408. -- ft = {
  409. -- "javascript",
  410. -- "javascriptreact",
  411. -- "javascript.jsx",
  412. -- "typescript",
  413. -- "typescriptreact",
  414. -- "typescript.tsx",
  415. -- },
  416. -- config = function()
  417. -- require("null-ls").setup()
  418. -- end,
  419. -- }
  420. -- Tabnine
  421. use {
  422. "tzachar/compe-tabnine",
  423. run = "./install.sh",
  424. requires = "hrsh7th/nvim-compe",
  425. disable = not O.plugin.tabnine.active,
  426. }
  427. end)