frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Undo in Vi and Its Successors

https://utcc.utoronto.ca/~cks/space/blog/unix/ViUndoMyViews
23•todsacerdoti•1h ago

Comments

comrade1234•1h ago
:q! !! ;-)
loloquwowndueo•1h ago
Ah, I see you’re a man of culture as well.
bregma•1h ago
Do you mean

    :e!
by any chance?
Lio•1h ago
It's not mentioned in the article but Vim (and NeoVim) keep undo/redo history in a tree rather than a simple linear timeline[1].

The practical usage is it's aways possible to get back to a previous state you were in, which is pretty neat.

e.g. You can undo 5 changes, try something else and decide that you prefered the text before you started undoing things. In most programs with a linear undo history you've wiped out your previous changes but not in Vim.

You can hop about the branches of the undo tree using the g+ and g- commands but it's much easier to add an undo tree visualiser plugin such as the venerable old Gundo[2].

1. https://neovim.io/doc/user/undo.html

2. https://docs.stevelosh.com/gundo.vim/

bradrn•1h ago
Emacs has this too, with ‘undo-tree-mode’.

(Incidentally, the documentation is wonderful: ‘The only downside to this more advanced yet simpler undo system is that it was inspired by Vim. But, after all, most successful religions steal the best ideas from their competitors!’)

nothrabannosir•53m ago
undo-tree-visualize is easily one of the biggest wow factors for unfamiliar users. Cannot unsee, cannot go back.
ghosty141•33m ago
I had occasional problems with undo-tree (the tree broke occasionally), I've been using vundo for a while now and I'm a lot more happy with that.
boltzmann64•1h ago
If you are going to need this, then you should use git instead of relying on the editor's undo tree.
sodapopcan•1h ago
They are both useful. I'm a frequent committer but find myself using this, I wanna say, 0 - 3 times per month. It's one of those things that when you want it, you're really glad it exists.
Waterluvian•1h ago
Consider this capability being used over the span of seconds as just another text editing tool. It would be like saying we don’t need undo/redo at all, just use git.
Lio•58m ago
You could if you remembered to make commits between every small, low value text edit. :P

Meanwhile the undo/redo tree is always there, ready to use and has no overhead. You can ignore it completely until you need it to save your arse.

sodapopcan•1h ago
I figured that this was what this article was going to be about.
Sharlin•1h ago
I had almost forgotten that single-level undo was ever a thing. I'm sure there are some applications still in production use that don't support multi-level undo/redo though.
gpvos•1h ago
Its inscrutable undo and redo behaviour is probably the main reason why I never really tried to get further into Emacs. And that's when I had just access to original vi, not vim.
iberator•1h ago
All I need is a classic bad VI. Only thing lacking is syntax colours and multiple undo. I hate when people using ViM claim that they are vi users or experts...

I miss elVis also. ViM should be banned from all distros because it is literally nag-ware and charity ware (Uganda 's children thing). 30 years later we still can't edit files bigger than RAM size unless you want to use swap file ...

Even commodore 64 had editors which could edit files bigger than RAM and WITHOUT ANY kind of swapping to the disk.

/rant

zabzonk•35m ago
> WITHOUT ANY kind of swapping to the disk

how?

ale•52m ago
I've always remapped ctrl+r to U as u (undo) and U (redo) feel more consistent with other shortcuts. I suspect this already is very common.
ryanmcbride•28m ago
I do the same, the ctrl+r always seemed strange to me for this
linsomniac•29m ago
Don't forget time-travel undo. If you get into a weird state with the undo tree, and g+/g- aren't helping, you can do ":earlier 5m" to go back to where you were 5 minutes ago, and ":later 30s" to step forward.

Unfortunately, when you're at "now" you can't do ":later 30m" to see the future.

Etheryte•27m ago
I was gonna make a quip that someone should really get on the ":later" feature, but then I realized that the modern LLM craze more or less is that feature.

macOS Tahoe 26.4 Beta 1 Adds Charging Limits to MacBook – Appleosophy

https://appleosophy.com/2026/02/16/macos-tahoe-26-4-beta-1-adds-charging-limits-to-macbook/
1•janandonly•26s ago•0 comments

A fluid can store solar energy and then release it as heat months later

https://arstechnica.com/science/2026/02/dna-inspired-molecule-breaks-records-for-storing-solar-heat/
1•Brajeshwar•31s ago•0 comments

Universal Commerce Protocol (UCP)

https://developers.googleblog.com/under-the-hood-universal-commerce-protocol-ucp/
1•Brajeshwar•37s ago•0 comments

A Comparative Security Analysis of Three Cloud-Based Password Managers [pdf]

https://eprint.iacr.org/2026/058.pdf
1•Brajeshwar•46s ago•0 comments

Anthropic's 500 vulns are the tip of the iceberg

https://martinalderson.com/posts/anthropic-found-500-zero-days/
1•martinald•1m ago•0 comments

Show HN: ccclub – See which of your friends is burning the most on Claude Code

https://ccclub.dev/
1•mazzystar•2m ago•0 comments

A Left Defense of Pure Tolerance

https://isonomiaquarterly.com/archive/volume-3-issue-4/a-left-defense-of-pure-tolerance/
1•brandonlc•2m ago•0 comments

Multi System Agent to validate your idea

https://www.founderspace.work
1•VladCovaci•3m ago•1 comments

Show HN: Claude Terminal – Desktop app for managing Claude Code projects

https://github.com/Sterll/claude-terminal
1•yanisbny•3m ago•1 comments

AI Agents? Not on my host

https://blog.cloudkernels.net/posts/urunc_agent/
2•_ananos_•3m ago•0 comments

The AI Panic Attack

https://www.arguingwithalgorithms.com/posts/the-ai-panic-attack.html
1•tomyedwab•4m ago•0 comments

The Impossible Backhand

https://philippdubach.com/posts/the-impossible-backhand/
1•7777777phil•4m ago•0 comments

tldraw

https://www.tldraw.com/
1•bookofjoe•6m ago•0 comments

OpenStreetMap Contributors per Country

https://osmstats.neis-one.org/?item=countries
1•RicoElectrico•6m ago•0 comments

are we ready?

https://positive.substack.com/p/are-we-ready
1•jpatel3•7m ago•0 comments

Proprietary (Closed Source)

https://en.wikipedia.org/wiki/Proprietary_software
1•barrister•8m ago•1 comments

Something is rotten in the state of Economics

https://www.nominalnews.com/p/jon-stewart-thaler-economics-debate
2•NomNew•9m ago•0 comments

An Increasingly Dangerous World

https://werd.io/an-increasingly-dangerous-world/
1•benwerd•9m ago•0 comments

Tailscale Aperture: Your team's private AI gateway

https://aperture.tailscale.com/
2•AdamGibbins•10m ago•0 comments

Why optimization slowly breaks the systems it improves

https://www.slideshare.net/slideshow/reality-drift-mechanics-and-taxonomy-of-systemic-misalignmen...
1•realitydrift•11m ago•0 comments

How AI Finds Fuzzy Duplicates in Large Datasets

https://futuresearch.ai/semantic-deduplication/
10•nbosse•13m ago•1 comments

AI Safety and Corporate Power – Remarks Given – United Nations Security Council

https://jack-clark.net/2023/07/18/ai-safety-and-corporate-power-remarks-given-at-the-un-security-...
1•totetsu•15m ago•0 comments

EU also investigating as Grok generated 23,000 CSAM images in 11 days

https://9to5mac.com/2026/02/17/eu-also-investigating-as-grok-generated-23000-csam-images-in-11-days/
2•MBCook•15m ago•0 comments

Open Source Is Getting Used to Death

https://julien.danjou.info/blog/open-source-is-getting-used-to-death/
3•seyz•16m ago•0 comments

Show HN: cc-costline – See your Claude Code spend right in the statusline

https://github.com/Ventuss-OvO/cc-costline
2•ventuss_ovo•19m ago•0 comments

Convert to it – universal online file converter

https://github.com/p2r3/convert
1•exploraz•20m ago•1 comments

Mautic open source marketing automation platform faces a $50K funding shortfall

https://mautic.org/blog/urgent-call-for-community-support-to-secure-mautics-financial-future/
2•sdoering•20m ago•1 comments

Show HN: Relay – I built a modern web-based IRC/Discord replacement

https://relay.moltic.dev/
2•redmageinc•20m ago•0 comments

Former 'Morning Edition' host accuses Google of stealing his voice

https://www.npr.org/2026/02/17/nx-s1-5716055/former-morning-edition-host-accuses-google-of-steali...
1•tantalor•21m ago•0 comments

Importing ChatGPT Chats to Gemini

https://uk.pcmag.com/ai/162915/google-gemini-tests-a-tool-to-help-you-switch-from-chatgpt-other-a...
1•PrincessEe•21m ago•0 comments