plugins.lua 6.9 KB

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