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.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/lua/talha/functions.lua b/lua/talha/functions.lua
index 946bfd8..e17cada 100644
--- a/lua/talha/functions.lua
+++ b/lua/talha/functions.lua
@@ -60,3 +60,18 @@ function ToggleSpellCheck()
vim.opt.spell = not(vim.opt.spell:get())
vim.opt.spelllang = 'en_us'
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