ThePrimeagen / ThePrimeagen/init.lua

Undo doesn't work in Windows

Open
#31 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
4k
Forks
680
PR merge metrics
No merged PRs in 30d

Description

There is no environment variable HOME in windows. So, this fails vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir".

This is the solution:

local home = os.getenv("HOME")
if (home == nil) then
    home = os.getenv("UserProfile")
end
opt.undodir = home .. "/.vim/undodir"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the undodir assignment shown in the issue and inspect how the HOME value is read on Windows. Done means the undodir path also resolves when HOME is unavailable, using the Windows user profile value described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.