aboutsummaryrefslogtreecommitdiffhomepage
path: root/.config/nvim/lua/init/06-plugins.lua
blob: 20f472ac0b2e6932fd9e6803ce24ce8533a54342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--- Disable standard plugins. {{{1

vim.g.loaded_gzip             = 1
vim.g.loaded_matchparen       = 1
vim.g.loaded_netrw            = 1
vim.g.loaded_netrwPlugin      = 1
vim.g.loaded_spellfile_plugin = 1
vim.g.loaded_tarPlugin        = 1
vim.g.loaded_zipPlugin        = 1


--- Load and configure third-party plugins. {{{1
local lazy_path = require('vimrc.my_env').data_dir .. '/lazy/lazy.nvim'
if vim.loop.fs_stat(lazy_path) then
   vim.opt.rtp:prepend(lazy_path)
   require('lazy').setup('vimrc.plugins', {
      -- This file is copied to under home directory by Home Manager.
      -- Because Home Manager will make it read-only, I directly modify a file under the "dotfiles" repository.
      lockfile = require('vimrc.my_env').home .. "/dotfiles/.config/nvim/lazy-lock.json",
      -- Overrides ui.icons to avoid using Nerd Font.
      ui = {
         icons = {
            cmd = "⌘",
            config = "🛠",
            event = "📅",
            ft = "📂",
            init = "⚙",
            keys = "🗝",
            plugin = "🔌",
            runtime = "💻",
            require = "🌙",
            source = "📄",
            start = "🚀",
            task = "📌",
            lazy = "💤 ",
         },
      },
      change_detection = {
         enabled = false,
      },
   })
else
   vim.api.nvim_create_user_command(
      'LazySetup',
      function()
         vim.fn.system({
            'git',
            'clone',
            '--filter=blob:none',
            'https://github.com/folke/lazy.nvim.git',
            '--branch=stable',
            lazy_path,
         })
      end,
      {
         desc = '[lazy.nvim] Setup itself',
      }
   )
end