How to Clear Vim's Undo History?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Hi, I'm trying to see if a can remap shift+ZZ to just clear vim's history, save the file, and keep the tab open. This all works except for clearing the undo history, i.e. vim.vimState.historyTracker.removeMarks ( just a shot in the dark looking at the plugin code not sure how / if this is exposed to the editor in a way you could execute like what's seen below ). Is there anyway to reset the undo history?
settings.json
...,
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["Z", "Z"],
"commands": [
"vim.vimState.historyTracker.removeMarks",
"workbench.action.files.save"
]
}
],
...,
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the VSCodeVim keybinding handling and the vim.vimState.historyTracker.removeMarks reference shown in the issue. Check whether undo-history reset is exposed as an executable command for settings.json mappings; done means a Shift+ZZ mapping can clear the history, save the file, and keep the tab open.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vim, vscode
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100