Vim icon indicating copy to clipboard operation
Vim copied to clipboard

How to Clear Vim's Undo History?

Open bgeels opened this issue 3 years ago • 0 comments

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"
            ]
        }
    ],
    ...,

bgeels avatar Sep 06 '22 19:09 bgeels