plugins.lua 7.2 KB

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