summaryrefslogtreecommitdiff
path: root/lua/nvim_settings
diff options
context:
space:
mode:
authorAotrix <[email protected]>2024-10-04 04:29:39 +0200
committerAotrix <[email protected]>2024-10-04 04:29:39 +0200
commit5dcb54c35c00874f81aee267d8412915d99b894d (patch)
tree3d0b40764ea96d1ddf52c8410fe055cee98defa7 /lua/nvim_settings
parent616b153eafec14f39a354fdd7841e960f2ba19c7 (diff)
fixed path bug for undodir on Windows
Diffstat (limited to 'lua/nvim_settings')
-rw-r--r--lua/nvim_settings/set.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/lua/nvim_settings/set.lua b/lua/nvim_settings/set.lua
index 44f703c..e524c58 100644
--- a/lua/nvim_settings/set.lua
+++ b/lua/nvim_settings/set.lua
@@ -14,7 +14,13 @@ vim.opt.wrap = false
vim.opt.swapfile = false
vim.opt.backup = false
-vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
+
+if vim.fn.has('unix') == 1 then
+ vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
+else
+ vim.opt.undodir = os.getenv("USERPROFILE") .. "/AppData/Local/nvim-data"
+end
+
vim.opt.undofile = true
vim.opt.hlsearch = false