From 395d8d895b0b122221bfecaa9602e87012216112 Mon Sep 17 00:00:00 2001
From: Micah Halter <micah@mehalter.com>
Date: Tue, 13 Feb 2024 13:42:17 -0500
Subject: [PATCH] refactor: move `mapleader` and `icons_enabled` to AstroNvim
 `opts`

---
 init.lua | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/init.lua b/init.lua
index 76e845e..7193536 100644
--- a/init.lua
+++ b/init.lua
@@ -14,16 +14,18 @@ if not lazy_loaded then
   vim.cmd.quit()
 end
 
--- must configure leader key before Lazy is set up
-vim.g.mapleader = " "
-
--- Set to false to disable icons (if no Nerd Font is available)
-vim.g.icons_enabled = true
-
 ---@type LazyConfig
 lazy.setup({
-  -- TODO: change `branch="v4"` to `version="^4"` on release
-  { "AstroNvim/AstroNvim", branch = "v4", import = "astronvim.plugins" },
+  {
+    "AstroNvim/AstroNvim",
+    branch = "v4", -- TODO: change `branch="v4"` to `version="^4"` on release
+    import = "astronvim.plugins",
+    opts = { -- AstroNvim options must be set with the `import` key
+      mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up
+      icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available)
+      pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override
+    },
+  },
   -- AstroCommunity: import any community modules here
   -- TODO: Remove branch v4 on release
   -- { "AstroNvim/astrocommunity", branch = "v4" },