plugins.lua 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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. -- vim.cmd "autocmd BufWritePost lv-config.lua PackerCompile" -- Auto compile when there are changes in plugins.lua
  27. return require("packer").startup(function(use)
  28. -- Packer can manage itself as an optional plugin
  29. use "wbthomason/packer.nvim"
  30. -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function)
  31. use {"neovim/nvim-lspconfig"}
  32. use {"glepnir/lspsaga.nvim"}
  33. use {"kabouzeid/nvim-lspinstall"}
  34. -- Telescope
  35. use {"nvim-lua/popup.nvim"}
  36. use {"nvim-lua/plenary.nvim"}
  37. use {"nvim-telescope/telescope.nvim"}
  38. -- Autocomplete
  39. use {
  40. "hrsh7th/nvim-compe",
  41. config = function()
  42. require("lv-compe").config()
  43. end,
  44. event = "InsertEnter"
  45. }
  46. -- Treesitter
  47. use {"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}
  48. use {
  49. "kyazdani42/nvim-tree.lua",
  50. cmd = "NvimTreeToggle",
  51. config = function()
  52. require("lv-nvimtree").config()
  53. end
  54. }
  55. -- use {'lukas-reineke/indent-blankline.nvim', opt=true, branch = 'lua'}
  56. use {
  57. "lewis6991/gitsigns.nvim",
  58. config = function()
  59. require("lv-gitsigns").config()
  60. end,
  61. event = "BufRead"
  62. }
  63. use {"folke/which-key.nvim"}
  64. use {"windwp/nvim-autopairs"}
  65. -- Comments
  66. use {
  67. "terrortylor/nvim-comment",
  68. cmd = "CommentToggle",
  69. config = function()
  70. require('nvim_comment').setup()
  71. end
  72. }
  73. -- Color
  74. use {"christianchiarulli/nvcode-color-schemes.vim", opt = true}
  75. -- Icons
  76. use {"kyazdani42/nvim-web-devicons"}
  77. -- Status Line and Bufferline
  78. use {"glepnir/galaxyline.nvim"}
  79. use {
  80. "romgrk/barbar.nvim",
  81. config = function()
  82. vim.api.nvim_set_keymap('n', '<TAB>', ':BufferNext<CR>',
  83. {noremap = true, silent = true})
  84. vim.api.nvim_set_keymap('n', '<S-TAB>', ':BufferPrevious<CR>',
  85. {noremap = true, silent = true})
  86. vim.api.nvim_set_keymap('n', '<S-x>', ':BufferClose<CR>',
  87. {noremap = true, silent = true})
  88. end
  89. }
  90. use {"hrsh7th/vim-vsnip"}
  91. -- extras, these do not load by default
  92. -- Better motions
  93. use {
  94. 'phaazon/hop.nvim',
  95. event = 'BufRead',
  96. config = function()
  97. require('lv-hop').config()
  98. end,
  99. disable = not O.plugin.hop.active,
  100. opt = true
  101. }
  102. -- Enhanced increment/decrement
  103. use {
  104. 'monaqa/dial.nvim',
  105. event = 'BufRead',
  106. config = function()
  107. require('lv-dial').config()
  108. end,
  109. disable = not O.plugin.dial.active,
  110. opt = true
  111. }
  112. -- Dashboard
  113. use {
  114. "ChristianChiarulli/dashboard-nvim",
  115. event = 'BufWinEnter',
  116. cmd = {"Dashboard", "DashboardNewFile", "DashboardJumpMarks"},
  117. config = function()
  118. require('lv-dashboard').config()
  119. end,
  120. disable = not O.plugin.dashboard.active,
  121. opt = true
  122. }
  123. -- Zen Mode
  124. -- use {
  125. -- "Pocco81/TrueZen.nvim",
  126. -- cmd = {"TZAtaraxis", "TZMinimalist"},
  127. -- config = function()
  128. -- require('lv-zen').config()
  129. -- end,
  130. -- disable = not O.plugin.zen.active,
  131. -- opt = true
  132. -- }
  133. -- -- matchup
  134. -- use {'andymass/vim-matchup', opt = true}
  135. -- require_plugin('vim-matchup')
  136. -- -- Snippets
  137. -- use {"rafamadriz/friendly-snippets", opt = true}
  138. -- require_plugin("friendly-snippets")
  139. -- -- Colorizer
  140. -- use {'norcalli/nvim-colorizer.lua', opt = true}
  141. -- require_plugin('nvim-colorizer.lua')
  142. -- -- Peek lines
  143. -- use {'nacro90/numb.nvim', opt = true}
  144. -- require_plugin('numb.nvim')
  145. --
  146. -- -- Treesitter playground
  147. -- use {'nvim-treesitter/playground', opt = true}
  148. -- require_plugin('playground')
  149. --
  150. --
  151. --
  152. -- -- Latex
  153. -- use {"lervag/vimtex", opt = true}
  154. -- require_plugin("vimtex")
  155. --
  156. -- -- comments in context
  157. -- use {'JoosepAlviste/nvim-ts-context-commentstring', opt = true}
  158. -- require_plugin("nvim-ts-context-commentstring")
  159. --
  160. --
  161. -- -- Git extras
  162. -- use {'f-person/git-blame.nvim', opt = true}
  163. -- require_plugin("git-blame.nvim")
  164. --
  165. --
  166. -- -- diagnostics
  167. -- use {"folke/trouble.nvim", opt = true}
  168. -- require_plugin('trouble.nvim')
  169. --
  170. -- -- Debugging
  171. -- use {"mfussenegger/nvim-dap", opt = true}
  172. -- require_plugin("nvim-dap")
  173. --
  174. --
  175. -- -- Better quickfix
  176. -- use {"kevinhwang91/nvim-bqf", opt = true}
  177. -- require_plugin("nvim-bqf")
  178. --
  179. -- -- Search & Replace
  180. -- use {'windwp/nvim-spectre', opt = true}
  181. -- require_plugin('nvim-spectre')
  182. --
  183. -- -- Symbol Outline
  184. -- use {'simrat39/symbols-outline.nvim', opt = true}
  185. -- require_plugin('symbols-outline.nvim')
  186. --
  187. -- -- Interactive scratchpad
  188. -- use {'metakirby5/codi.vim', opt = true}
  189. -- require_plugin('codi.vim')
  190. --
  191. -- -- Markdown preview
  192. -- use {
  193. -- 'iamcco/markdown-preview.nvim',
  194. -- run = 'cd app && npm install',
  195. -- opt = true
  196. -- }
  197. -- require_plugin('markdown-preview.nvim')
  198. --
  199. -- -- Floating terminal
  200. -- use {'numToStr/FTerm.nvim', opt = true}
  201. -- require_plugin('FTerm.nvim')
  202. --
  203. -- -- Sane gx for netrw_gx bug
  204. -- use {"felipec/vim-sanegx", opt = true}
  205. -- lsp root
  206. -- use {"ahmedkhalf/lsp-rooter.nvim", opt = true} -- with this nvim-tree will follow you
  207. -- require_plugin('lsp-rooter.nvim')
  208. -- Extras
  209. if O.extras then
  210. -- HTML preview
  211. use {
  212. 'turbio/bracey.vim',
  213. run = 'npm install --prefix server',
  214. opt = true
  215. }
  216. require_plugin('bracey.vim')
  217. use {"nvim-telescope/telescope-fzy-native.nvim", opt = true}
  218. use {"nvim-telescope/telescope-project.nvim", opt = true}
  219. require_plugin('telescope-project.nvim')
  220. -- Autotag
  221. -- use {"windwp/nvim-ts-autotag", opt = true}
  222. -- require_plugin("nvim-ts-autotag")
  223. -- folke/todo-comments.nvim
  224. -- gennaro-tedesco/nvim-jqx
  225. -- TimUntersberger/neogit
  226. -- folke/lsp-colors.nvim
  227. -- simrat39/symbols-outline.nvim
  228. -- Git
  229. -- use {'tpope/vim-fugitive', opt = true}
  230. -- use {'tpope/vim-rhubarb', opt = true}
  231. -- pwntester/octo.nvim
  232. -- Easily Create Gists
  233. -- use {'mattn/vim-gist', opt = true}
  234. -- use {'mattn/webapi-vim', opt = true}
  235. end
  236. end)