plugins.lua 7.2 KB

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