question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Would be great to have this in VS Code.

I enjoy in plain (neo)vim when I’ve set my undo path and have and

      if has('persistent_undo')
        set undofile	" keep an undo file (undo changes after closing)
      endif

so that every time I re-open a file any time in the future (even after closing vim/neovim) the undo history persists.

I have that setting in my init.vim, but looks like it doesn’t work in VS Code Neo Vim.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
trusktrcommented, Dec 30, 2020

The problem is that the vscode undo stack isn’t loaded back into the neovim buffer, so unless you use the vscode undo functionality, it won’t work.

Can we arbitrarily replace a neovim buffer’s undo history? (basically the other way around).

If so, then that may be a way to rely on VS Code’s semi-persistent undo (and eventually its fully-persistent undo), although in this case we would lose the history tree. But it could still be a worthy option for those that are okay with not having the tree.

EDIT: Oh, but we would need to read VS Code’s history stack, which may not be possible.

1reaction
theol0403commented, Dec 30, 2020

The problem is that the vscode undo stack isn’t loaded back into the neovim buffer, so unless you use the vscode undo functionality, it won’t work.

On Wed., Dec. 30, 2020, 1:40 a.m. David, notifications@github.com wrote:

VS Code recently added persistent undo, your wish should have already been granted!

I turn it off as it really annoys me, when I close I file I want that to be the final undo: “files.restoreUndoStack”: false. I thought it was true by default, check it out.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/asvetliakov/vscode-neovim/issues/474#issuecomment-752392653, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6HT5N2RUDOLDH3DFBHOFLSXLYP5ANCNFSM4VNWVG3Q .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Vim's persistent undo? - Stack Overflow
One of the new features in Vim 7.3 is 'persistent undo', which allows for the undotree to be saved to a file when...
Read more >
Persistent Undo in Vim - - Jovica Ilic
Vim supports persistent undo, which means that you can run undo/redo even from your previous sessions. Persistent Unto in Vim.
Read more >
Use Persistent Undo in Vim for maximum comfort
Intro to the benefits of persistent undo functionality for Vim-centered development workflows. ... From version 7.3, Vim supports persistent undo.
Read more >
Persistent undo and repeat | Mastering Vim - Packt Subscription
Persistent undo and repeat. Like any editor, Vim keeps track of every operation. Press u to undo a last operation, and Ctrl +...
Read more >
Learn how to use vim undo to time travel - DEV Community ‍ ‍
Persistent undo. When you close a text editor, normally you lose all your undo history. This means when you open that file again,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found