plugins.lua 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. --- Check if a file or directory exists in this path
  9. local function require_plugin(plugin)
  10. local plugin_prefix = fn.stdpath("data") .. "/site/pack/packer/opt/"
  11. local plugin_path = plugin_prefix .. plugin .. "/"
  12. -- print('test '..plugin_path)
  13. local ok, err, code = os.rename(plugin_path, plugin_path)
  14. if not ok then
  15. if code == 13 then
  16. -- Permission denied, but it exists
  17. return true
  18. end
  19. end
  20. -- print(ok, err, code)
  21. if ok then vim.cmd("packadd " .. plugin) end
  22. return ok, err, code
  23. end
  24. vim.cmd "autocmd BufWritePost plugins.lua PackerCompile" -- Auto compile when there are changes in plugins.lua
  25. return require("packer").startup(function(use)
  26. -- Packer can manage itself as an optional plugin
  27. use "wbthomason/packer.nvim"
  28. -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function)
  29. use {"neovim/nvim-lspconfig", event = "BufRead", opt = true}
  30. use {"kabouzeid/nvim-lspinstall", opt = true}
  31. -- Telescope
  32. use {"nvim-lua/popup.nvim", opt = true}
  33. use {"nvim-lua/plenary.nvim", opt = true}
  34. use {"nvim-telescope/telescope.nvim", opt = true}
  35. -- Autocomplete
  36. use {"hrsh7th/nvim-compe", event = "InsertEnter", opt = true}
  37. -- Treesitter
  38. use {
  39. "nvim-treesitter/nvim-treesitter",
  40. event = "BufRead"
  41. -- run = ":TSUpdate"
  42. }
  43. -- Explorer
  44. -- use {"kyazdani42/nvim-tree.lua", opt = true}
  45. use {
  46. "kyazdani42/nvim-tree.lua",
  47. opt = true,
  48. cmd = "NvimTreeToggle",
  49. config = function()
  50. require("nvimTree").config()
  51. end
  52. }
  53. -- use {'lukas-reineke/indent-blankline.nvim', opt=true, branch = 'lua'}
  54. use {"lewis6991/gitsigns.nvim", event = "BufRead", opt = true}
  55. use {"folke/which-key.nvim", opt = true}
  56. use {"windwp/nvim-autopairs", event = "InsertEnter", opt = true}
  57. -- Comments
  58. use {"terrortylor/nvim-comment", opt = true}
  59. -- Color
  60. use {"christianchiarulli/nvcode-color-schemes.vim", opt = true}
  61. -- Icons
  62. use {"kyazdani42/nvim-web-devicons", opt = true}
  63. -- Status Line and Bufferline
  64. use {"glepnir/galaxyline.nvim", opt = true}
  65. use {"romgrk/barbar.nvim", opt = true}
  66. use {"hrsh7th/vim-vsnip", opt = true}
  67. require_plugin("vim-vsnip")
  68. require_plugin("nvim-lspconfig")
  69. require_plugin("nvim-lspinstall")
  70. require_plugin("popup.nvim")
  71. require_plugin("plenary.nvim")
  72. require_plugin("telescope.nvim")
  73. require_plugin("nvim-compe")
  74. require_plugin("nvim-treesitter")
  75. require_plugin("nvim-tree.lua")
  76. require_plugin("gitsigns.nvim")
  77. require_plugin("which-key.nvim")
  78. require_plugin("nvim-autopairs")
  79. require_plugin("nvim-comment")
  80. require_plugin("nvcode-color-schemes.vim")
  81. require_plugin("nvim-web-devicons")
  82. require_plugin("galaxyline.nvim")
  83. require_plugin("barbar.nvim")
  84. -- Extras
  85. if O.extras then
  86. -- Interactive scratchpad
  87. use {'metakirby5/codi.vim', opt = true}
  88. require_plugin('codi.vim')
  89. -- Markdown preview
  90. use {'iamcco/markdown-preview.nvim', run = 'cd app && npm install', opt = true}
  91. require_plugin('markdown-preview.nvim')
  92. -- Floating terminal
  93. use {'numToStr/FTerm.nvim', opt = true}
  94. require_plugin('FTerm.nvim')
  95. -- Enhanced increment/decrement
  96. use {'monaqa/dial.nvim', opt = true}
  97. require_plugin('dial.nvim')
  98. -- Peek lines
  99. use {'nacro90/numb.nvim', opt = true}
  100. require_plugin('numb.nvim')
  101. -- HTML preview
  102. use {'turbio/bracey.vim', run = 'npm install --prefix server', opt = true}
  103. require_plugin('bracey.vim')
  104. -- Better motions
  105. use {'phaazon/hop.nvim', opt = true}
  106. require_plugin('hop.nvim')
  107. -- Colorizer
  108. use {'norcalli/nvim-colorizer.lua', opt = true}
  109. require_plugin('nvim-colorizer.lua')
  110. -- Search & Replace
  111. use {'windwp/nvim-spectre', opt = true}
  112. require_plugin('nvim-spectre')
  113. use {'simrat39/symbols-outline.nvim', opt = true}
  114. require_plugin('symbols-outline.nvim')
  115. -- Treesitter playground
  116. use {'nvim-treesitter/playground', opt = true}
  117. require_plugin('playground')
  118. -- Latex
  119. use {"lervag/vimtex", opt = true}
  120. require_plugin("vimtex")
  121. -- matchup
  122. use {'andymass/vim-matchup', opt = true}
  123. require_plugin('vim-matchup')
  124. -- comments in context
  125. use {'JoosepAlviste/nvim-ts-context-commentstring', opt = true}
  126. require_plugin("nvim-ts-context-commentstring")
  127. -- Zen Mode
  128. use {"Pocco81/TrueZen.nvim", opt = true}
  129. require_plugin("TrueZen.nvim")
  130. -- Git extras
  131. use {'f-person/git-blame.nvim', opt = true}
  132. require_plugin("git-blame.nvim")
  133. -- TODO remove when open on dir is supported by nvimtree
  134. -- use "kevinhwang91/rnvimr"
  135. use {"nvim-telescope/telescope-fzy-native.nvim", opt = true}
  136. use {"nvim-telescope/telescope-project.nvim", opt = true}
  137. require_plugin('telescope-project.nvim')
  138. -- Debugging
  139. use {"mfussenegger/nvim-dap", opt = true}
  140. require_plugin("nvim-dap")
  141. use {"rafamadriz/friendly-snippets", opt = true}
  142. require_plugin("friendly-snippets")
  143. use {"kevinhwang91/nvim-bqf", opt = true}
  144. require_plugin("nvim-bqf")
  145. use {"ahmedkhalf/lsp-rooter.nvim", opt = true} -- with this nvim-tree will follow you
  146. require_plugin('lsp-rooter.nvim')
  147. use {"glepnir/lspsaga.nvim", opt = true}
  148. require_plugin("lspsaga.nvim")
  149. use {"ChristianChiarulli/dashboard-nvim", opt = true}
  150. require_plugin("dashboard-nvim")
  151. use {"folke/trouble.nvim", opt = true}
  152. require_plugin('trouble.nvim')
  153. -- Sane gx for netrw_gx bug
  154. use {"felipec/vim-sanegx", opt = true}
  155. -- Autotag
  156. -- use {"windwp/nvim-ts-autotag", opt = true}
  157. -- require_plugin("nvim-ts-autotag")
  158. -- folke/todo-comments.nvim
  159. -- gennaro-tedesco/nvim-jqx
  160. -- TimUntersberger/neogit
  161. -- folke/lsp-colors.nvim
  162. -- simrat39/symbols-outline.nvim
  163. -- Git
  164. -- use {'tpope/vim-fugitive', opt = true}
  165. -- use {'tpope/vim-rhubarb', opt = true}
  166. -- pwntester/octo.nvim
  167. -- Easily Create Gists
  168. -- use {'mattn/vim-gist', opt = true}
  169. -- use {'mattn/webapi-vim', opt = true}
  170. end
  171. end)