lazy.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
  2. if not (vim.uv or vim.loop).fs_stat(lazypath) then
  3. local lazyrepo = "https://github.com/folke/lazy.nvim.git"
  4. local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
  5. if vim.v.shell_error ~= 0 then
  6. vim.api.nvim_echo({
  7. { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
  8. { out, "WarningMsg" },
  9. { "\nPress any key to exit..." },
  10. }, true, {})
  11. vim.fn.getchar()
  12. os.exit(1)
  13. end
  14. end
  15. vim.opt.rtp:prepend(lazypath)
  16. require("lazy").setup({
  17. spec = {
  18. -- add LazyVim and import its plugins
  19. { "LazyVim/LazyVim", import = "lazyvim.plugins" },
  20. -- import/override with your plugins
  21. { import = "plugins" },
  22. },
  23. defaults = {
  24. -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
  25. -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
  26. lazy = false,
  27. -- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
  28. -- have outdated releases, which may break your Neovim install.
  29. version = false, -- always use the latest git commit
  30. -- version = "*", -- try installing the latest stable version for plugins that support semver
  31. },
  32. install = { colorscheme = { "tokyonight", "habamax" } },
  33. checker = {
  34. enabled = true, -- check for plugin updates periodically
  35. notify = false, -- notify on update
  36. }, -- automatically check for plugin updates
  37. performance = {
  38. rtp = {
  39. -- disable some rtp plugins
  40. disabled_plugins = {
  41. "gzip",
  42. -- "matchit",
  43. -- "matchparen",
  44. -- "netrwPlugin",
  45. "tarPlugin",
  46. "tohtml",
  47. "tutor",
  48. "zipPlugin",
  49. },
  50. },
  51. },
  52. })
  53. -- 使用默认的tokyonight主题(LazyVim默认主题)
  54. -- 不需要手动设置,LazyVim会自动加载