summaryrefslogtreecommitdiff
path: root/lua/talha/functions.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/talha/functions.lua')
-rw-r--r--lua/talha/functions.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/lua/talha/functions.lua b/lua/talha/functions.lua
index 2a4570e..b0e8020 100644
--- a/lua/talha/functions.lua
+++ b/lua/talha/functions.lua
@@ -72,3 +72,17 @@ function SetFocusColors(mode)
vim.opt.cursorline = false
vim.cmd("colorscheme vscode")
end
+
+function GetHomeDir()
+ -- for linux/mac
+ local home = os.getenv("HOME")
+ -- for windows
+ local user_profile = os.getenv("UserProfile")
+
+ if home ~= nil then
+ return home
+ elseif user_profile ~= nil then
+ return user_profile
+ end
+ return nil
+end