From 3f61b7c994797d6b434079a16ebe17e429acf406 Mon Sep 17 00:00:00 2001 From: Fabian Schmidt Date: Tue, 16 Dec 2025 13:50:00 +0100 Subject: [PATCH] Platform independent undodir --- init.lua | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index 9e9175d..19ea3aa 100644 --- a/init.lua +++ b/init.lua @@ -1,14 +1,14 @@ -- init.lua local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end vim.opt.rtp:prepend(lazypath) vim.g.mapleader = " " @@ -16,7 +16,7 @@ require("lazy").setup("plugins") require("commands") vim.opt.backup = false -vim.opt.undodir = os.getenv("HOME") .. '/.cache/nvim/undodir' +vim.opt.undodir = vim.fn.stdpath('cache') .. '/undodir' vim.opt.swapfile = false vim.opt.undofile = true vim.opt.smartcase = true @@ -32,12 +32,12 @@ vim.opt.autochdir = false vim.opt.clipboard = 'unnamed,unnamedplus' in_wsl = os.getenv('WSL_DISTRO_NAME') ~= nil if in_wsl then - vim.g.clipboard = { - name = 'wsl clipboard', - copy = { ["+"] = { "clip.exe" }, ["*"] = { "clip.exe" } }, - paste = { ["+"] = { "win32yank.exe" }, ["*"] = { "win32yank.exe" } }, - cache_enabled = true - } + vim.g.clipboard = { + name = 'wsl clipboard', + copy = { ["+"] = { "clip.exe" }, ["*"] = { "clip.exe" } }, + paste = { ["+"] = { "win32yank.exe" }, ["*"] = { "win32yank.exe" } }, + cache_enabled = true + } end vim.opt.number = true vim.opt.wrap = false