plugins.lua 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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 {"folke/which-key.nvim"}
  49. -- Autopairs
  50. use {"windwp/nvim-autopairs"}
  51. -- Comments
  52. use {
  53. "terrortylor/nvim-comment",
  54. cmd = "CommentToggle",
  55. config = function()
  56. require('nvim_comment').setup()
  57. end
  58. }
  59. -- Color
  60. use {"christianchiarulli/nvcode-color-schemes.vim", opt = true}
  61. -- Icons
  62. use {"kyazdani42/nvim-web-devicons"}
  63. -- Status Line and Bufferline
  64. use {"glepnir/galaxyline.nvim"}
  65. use {
  66. "romgrk/barbar.nvim",
  67. config = function()
  68. vim.api.nvim_set_keymap('n', '<TAB>', ':BufferNext<CR>',
  69. {noremap = true, silent = true})
  70. vim.api.nvim_set_keymap('n', '<S-TAB>', ':BufferPrevious<CR>',
  71. {noremap = true, silent = true})
  72. vim.api.nvim_set_keymap('n', '<S-x>', ':BufferClose<CR>',
  73. {noremap = true, silent = true})
  74. end,
  75. event = "BufRead"
  76. }
  77. -- Extras, these do not load by default
  78. -- Better motions
  79. use {
  80. 'phaazon/hop.nvim',
  81. event = 'BufRead',
  82. config = function()
  83. require('lv-hop').config()
  84. end,
  85. disable = not O.plugin.hop.active,
  86. opt = true
  87. }
  88. -- Enhanced increment/decrement
  89. use {
  90. 'monaqa/dial.nvim',
  91. event = 'BufRead',
  92. config = function()
  93. require('lv-dial').config()
  94. end,
  95. disable = not O.plugin.dial.active,
  96. opt = true
  97. }
  98. -- Dashboard
  99. use {
  100. "ChristianChiarulli/dashboard-nvim",
  101. event = 'BufWinEnter',
  102. cmd = {"Dashboard", "DashboardNewFile", "DashboardJumpMarks"},
  103. config = function()
  104. require('lv-dashboard').config()
  105. end,
  106. disable = not O.plugin.dashboard.active,
  107. opt = true
  108. }
  109. -- Zen Mode TODO this don't work with whichkey might gave to make this built in, may have to replace with folke zen
  110. use {
  111. "folke/zen-mode.nvim",
  112. cmd = "ZenMode",
  113. config = function()
  114. require("zen-mode").setup {
  115. -- your configuration comes here
  116. -- or leave it empty to use the default settings
  117. -- refer to the configuration section below
  118. }
  119. end,
  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. }
  131. use {
  132. "norcalli/nvim-colorizer.lua",
  133. event = "BufRead",
  134. config = function()
  135. require("colorizer").setup()
  136. vim.cmd("ColorizerReloadAllBuffers")
  137. end,
  138. disable = not O.plugin.colorizer.active
  139. }
  140. use {
  141. "nacro90/numb.nvim",
  142. event = "BufRead",
  143. config = function()
  144. require('numb').setup {
  145. show_numbers = true, -- Enable 'number' for the window while peeking
  146. show_cursorline = true -- Enable 'cursorline' for the window while peeking
  147. }
  148. end,
  149. disable = not O.plugin.numb.active
  150. }
  151. -- Treesitter playground
  152. use {
  153. 'nvim-treesitter/playground',
  154. event = "BufRead",
  155. disable = not O.plugin.ts_playground.active
  156. }
  157. use {
  158. "lukas-reineke/indent-blankline.nvim",
  159. branch = "lua",
  160. event = "BufRead",
  161. setup = function()
  162. vim.g.indentLine_enabled = 1
  163. vim.g.indent_blankline_char = "▏"
  164. vim.g.indent_blankline_filetype_exclude = {
  165. "help", "terminal", "dashboard"
  166. }
  167. vim.g.indent_blankline_buftype_exclude = {"terminal"}
  168. vim.g.indent_blankline_show_trailing_blankline_indent = false
  169. vim.g.indent_blankline_show_first_indent_level = true
  170. end,
  171. disable = not O.plugin.indent_line.active
  172. }
  173. -- comments in context
  174. use {
  175. 'JoosepAlviste/nvim-ts-context-commentstring',
  176. event = "BufRead",
  177. disable = not O.plugin.ts_context_commentstring.active
  178. }
  179. -- Symbol Outline
  180. use {
  181. 'simrat39/symbols-outline.nvim',
  182. cmd = 'SymbolsOutline',
  183. disable = not O.plugin.symbol_outline.active
  184. }
  185. -- diagnostics
  186. use {
  187. "folke/trouble.nvim",
  188. cmd = 'TroubleToggle',
  189. disable = not O.plugin.trouble.active
  190. }
  191. -- Debugging
  192. use {
  193. "mfussenegger/nvim-dap",
  194. event = "BufRead",
  195. disable = not O.plugin.debug.active
  196. }
  197. -- Better quickfix
  198. use {
  199. "kevinhwang91/nvim-bqf",
  200. event = "BufRead",
  201. disable = not O.plugin.bqf.active
  202. }
  203. -- Floating terminal
  204. use {
  205. 'numToStr/FTerm.nvim',
  206. event = "BufRead",
  207. config = function()
  208. require'FTerm'.setup({
  209. dimensions = {height = 0.8, width = 0.8, x = 0.5, y = 0.5},
  210. border = 'single' -- or 'double'
  211. })
  212. end,
  213. disable = not O.plugin.floatterm.active
  214. }
  215. -- Search & Replace
  216. use {
  217. 'windwp/nvim-spectre',
  218. event = "BufRead",
  219. config = function()
  220. require('spectre').setup()
  221. end,
  222. disable = not O.plugin.spectre.active
  223. }
  224. -- lsp root with this nvim-tree will follow you
  225. use {
  226. "ahmedkhalf/lsp-rooter.nvim",
  227. event = "BufRead",
  228. config = function()
  229. require("lsp-rooter").setup()
  230. end,
  231. disable = not O.plugin.lsp_rooter.active
  232. }
  233. -- Markdown preview
  234. use {
  235. 'iamcco/markdown-preview.nvim',
  236. run = 'cd app && npm install',
  237. ft = 'markdown',
  238. disable = not O.plugin.markdown_preview.active
  239. }
  240. -- Interactive scratchpad
  241. use {
  242. 'metakirby5/codi.vim',
  243. cmd = 'Codi',
  244. disable = not O.plugin.codi.active
  245. }
  246. -- Use fzy for telescope
  247. use {
  248. "nvim-telescope/telescope-fzy-native.nvim",
  249. event = "BufRead",
  250. disable = not O.plugin.telescope_fzy.active
  251. }
  252. -- Use project for telescope
  253. use {
  254. "nvim-telescope/telescope-project.nvim",
  255. event = "BufRead",
  256. disable = not O.plugin.telescope_project.active
  257. }
  258. -- Sane gx for netrw_gx bug
  259. use {
  260. "felipec/vim-sanegx",
  261. event = "BufRead",
  262. disable = not O.plugin.sanegx.active
  263. }
  264. -- Sane gx for netrw_gx bug
  265. use {
  266. "folke/todo-comments.nvim",
  267. event = "BufRead",
  268. disable = not O.plugin.todo_comments.active
  269. }
  270. -- LSP Colors
  271. use {
  272. "folke/lsp-colors.nvim",
  273. event = "BufRead",
  274. disable = not O.plugin.lsp_colors.active
  275. }
  276. -- Git Blame
  277. use {
  278. "f-person/git-blame.nvim",
  279. event = "BufRead",
  280. disable = not O.plugin.git_blame.active
  281. }
  282. use {
  283. 'ruifm/gitlinker.nvim',
  284. event = "BufRead",
  285. config = function()
  286. require"gitlinker".setup({
  287. opts = {
  288. -- remote = 'github', -- force the use of a specific remote
  289. -- adds current line nr in the url for normal mode
  290. add_current_line_on_normal_mode = true,
  291. -- callback for what to do with the url
  292. action_callback = require"gitlinker.actions".open_in_browser,
  293. -- print the url after performing the action
  294. print_url = false,
  295. -- mapping to call url generation
  296. mappings = "<leader>gy"
  297. }
  298. })
  299. end,
  300. disable = not O.plugin.gitlinker.active,
  301. requires = 'nvim-lua/plenary.nvim'
  302. }
  303. -- Git
  304. -- https://github.com/kdheepak/lazygit.nvim
  305. -- pwntester/octo.nvim
  306. -- use 'sindrets/diffview.nvim'
  307. -- Easily Create Gists
  308. -- use {'mattn/vim-gist', opt = true}
  309. -- use {'mattn/webapi-vim', opt = true}
  310. -- Not sure yet
  311. -- HTML preview
  312. -- use {
  313. -- 'turbio/bracey.vim',
  314. -- run = 'npm install --prefix server',
  315. -- opt = true
  316. -- }
  317. -- Latex TODO what filetypes should this be active for?
  318. -- use {"lervag/vimtex", opt = true}
  319. end)