init.lua 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. local fn = vim.fn
  2. local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
  3. local compile_path = fn.stdpath('config') .. '/lua/plugin/packer_compiled.lua'
  4. -- initialize packer on demand <<<
  5. function initPacker(compile)
  6. if fn.empty(fn.glob(install_path)) > 0 then
  7. packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
  8. vim.cmd [[packadd packer.nvim]]
  9. end
  10. packer = require('packer')
  11. packer.reset()
  12. packer.init({
  13. compile_path = compile_path,
  14. compile_on_sync = true,
  15. })
  16. use = packer.use
  17. -- plugins list <<<
  18. use 'wbthomason/packer.nvim'
  19. use 'lewis6991/impatient.nvim'
  20. use 'gentoo/gentoo-syntax'
  21. use 'vifm/vifm.vim'
  22. use 'lukas-reineke/indent-blankline.nvim'
  23. use 'preservim/tagbar'
  24. use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }
  25. use 'lewis6991/gitsigns.nvim'
  26. use { 'norcalli/nvim-colorizer.lua', config = function() require'colorizer'.setup() end }
  27. use { 'numToStr/Comment.nvim', config = function() require('Comment').setup() end }
  28. use 'tommcdo/vim-lion'
  29. use 'L3MON4D3/LuaSnip'
  30. use 'rafamadriz/friendly-snippets'
  31. use 'neovim/nvim-lspconfig'
  32. use 'hrsh7th/cmp-nvim-lsp'
  33. use 'hrsh7th/cmp-nvim-lua'
  34. use 'hrsh7th/cmp-nvim-lsp-signature-help'
  35. use 'hrsh7th/cmp-buffer'
  36. use 'hrsh7th/cmp-path'
  37. use 'hrsh7th/nvim-cmp'
  38. use 'saadparwaiz1/cmp_luasnip'
  39. use 'rebelot/kanagawa.nvim'
  40. use { 'windwp/nvim-autopairs', config = function() require('nvim-autopairs').setup({}) end }
  41. -- >>>
  42. -- Sync and compile if required
  43. if packer_bootstrap then
  44. packer.sync()
  45. end
  46. if compile then
  47. packer.compile()
  48. end
  49. -- Remove PackerInit cmd after initializtion
  50. vim.api.nvim_del_user_command('PackerInit')
  51. end
  52. -- >>>
  53. -- load impatient.nvim before loading other plugins
  54. pcall(require, 'impatient')
  55. -- Load packer on-demand using PackerInit command; :PackerInit
  56. if fn.empty(fn.glob(compile_path)) > 0 then
  57. initPacker(1)
  58. else
  59. vim.api.nvim_create_user_command('PackerInit', 'lua initPacker()', {})
  60. end
  61. require('plugin/packer_compiled')
  62. require('plugin/setup')