From 17862877792db104d48c3260aec0ace92d55f863 Mon Sep 17 00:00:00 2001 From: Null Chilly Date: Sun, 3 Sep 2023 03:23:44 +0700 Subject: [PATCH] fix(vim): add vim.env index --- lua/catppuccin/lib/vim/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/catppuccin/lib/vim/init.lua b/lua/catppuccin/lib/vim/init.lua index 2d6a39fb..3ea1a1b7 100644 --- a/lua/catppuccin/lib/vim/init.lua +++ b/lua/catppuccin/lib/vim/init.lua @@ -16,6 +16,10 @@ vim.fn.stdpath = function(what) end end +vim.env = setmetatable({}, { + __index = function(_, k) return os.getenv(k) end, +}) + -- Reference: https://github.com/neovim/neovim/blob/master/runtime/lua/vim/shared.lua local function tbl_isempty(t) assert(type(t) == "table", string.format("Expected table, got %s", type(t)))