plugins.lua 7.5 KB

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