plugins.lua 7.3 KB

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