plugins.lua 7.5 KB

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