/ cli / neovim / nvim / lua / config / lazy.lua
lazy.lua
 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  
17  require("lazy").setup({
18    spec = {
19      -- add LazyVim and import its plugins
20      { "LazyVim/LazyVim", import = "lazyvim.plugins" },
21      -- import/override with your plugins
22      { import = "plugins" },
23    },
24    defaults = {
25      -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
26      -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
27      lazy = false,
28      -- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
29      -- have outdated releases, which may break your Neovim install.
30      version = false, -- always use the latest git commit
31      -- version = "*", -- try installing the latest stable version for plugins that support semver
32    },
33    install = { colorscheme = { "tokyonight", "habamax" } },
34    checker = {
35      enabled = true, -- check for plugin updates periodically
36      notify = false, -- notify on update
37    }, -- automatically check for plugin updates
38    performance = {
39      rtp = {
40        -- disable some rtp plugins
41        disabled_plugins = {
42          "gzip",
43          -- "matchit",
44          -- "matchparen",
45          -- "netrwPlugin",
46          "tarPlugin",
47          "tohtml",
48          "tutor",
49          "zipPlugin",
50        },
51      },
52    },
53  })