• Stars
    star
    284
  • Rank 145,616 (Top 3 %)
  • Language
    Emacs Lisp
  • Created almost 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Visualize the undo tree.
Vundo is now available on ELPA!

Vundo (visual undo) displays the undo history as a tree and lets you
move in the tree to go back to previous buffer states. To use vundo,
type M-x vundo RET in the buffer you want to undo. An undo tree buffer
should pop up. To move around, type:

  f   to go forward
  b   to go backward

  n   to go to the node below when you at a branching point
  p   to go to the node above

  a   to go back to the last branching point
  e   to go forward to the end/tip of the branch

  q   to quit, you can also type C-g

  C-c C-s (or whatever binding you used for save-buffer)
      to save the buffer at the current undo state

n/p may need some more explanation. In the following tree, n/p can
move between A and B because they share a parent (thus at a branching
point), but not C and D. To make it clear, branches you can switch
between are highlighted with bold face.

         A  C
    โ”€โ”€โ—‹โ”โ”โ—‹โ”€โ”€โ—‹โ”€โ”€โ—‹โ”€โ”€โ—‹
      โ”ƒ  โ†•๏ธŽ
      โ”—โ”โ”โ—‹โ”€โ”€โ—‹โ”€โ”€โ—‹
         B  D

By default, you need to press RET to โ€œcommitโ€ your change and if you
quit with q or C-g, the changes made by vundo are rolled back. You can
set โ€˜vundo-roll-back-on-quitโ€™ to nil to disable rolling back.

You might see some green nodes in the tree, those are the buffer
states that have been saved to disk; the last saved node is emphasized
in bold. You can type "l" to jump to the last saved node.

Note: vundo.el requires Emacs 28.

Customizable faces:

- vundo-default
- vundo-node
- vundo-stem
- vundo-highlight
- vundo-saved
- vundo-last-saved

If you want to use prettier Unicode characters to draw the tree like
this:

    โ—‹โ”€โ”€โ—‹โ”€โ”€โ—‹
    โ”‚  โ””โ”€โ”€โ—
    โ”œโ”€โ”€โ—‹
    โ””โ”€โ”€โ—‹

set vundo-glyph-alist by

    (setq vundo-glyph-alist vundo-unicode-symbols)

Your default font needs to contain these Unicode characters, otherwise
they look terrible and donโ€™t align. You can find a font that covers
these characters (eg, Symbola, Unifont), and set โ€˜vundo-defaultโ€™ face
to use that font:

    (set-face-attribute 'vundo-default nil :family "Symbola")

Comparing to undo-tree:

Vundo doesnโ€™t need to be turned on all the time nor replace the undo
commands like undo-tree does. Vundo displays the tree horizontally,
whereas undo-tree displays a tree vertically. Vundo doesnโ€™t have many
advanced features that undo-tree does (like showing diff), and most
probably will not add those features in the future.

Tests:

You can run tests by loading test/vundo-test.el and M-x ert RET t RET
to run those tests interactively, or use the following batch command:

     emacs --batch \
           -l vundo.el \
           -l test/vundo-test.el \
           -f ert-run-tests-batch-and-exit


Changelog (full changelog in NEWS.txt):

<2022-04-04 Mon>: Version 1.0.0

<2022-03-29 Tue>: vundo--mode and vundo--mode-map are now vundo-mode
and vundo-mode-map. A new custom option vundo-compact-display is added.

<2022-03-23 Wed>: UI now defaults to ASCII mode. ASCII mode also draws
differently now, it now draws

    o--o--o     instead of      o--o--o
    |  `--x                     |  +--*
    |--o                        |--o
    `--o                        +--o

<2021-11-26 Fri>: Variable vundo-translate-alist changed to
vundo-glyph-alist and has different value now.

More Repositories

1

valign

Pixel-perfect visual alignment for Org and Markdown tables.
Emacs Lisp
386
star
2

lunarymacs

Moon-based Emacs configuration.
Emacs Lisp
220
star
3

eldoc-box

childframe doc for eglot and anything that uses eldoc
Emacs Lisp
210
star
4

tree-sitter-module

Building script for tree-sitter language definitions
Shell
106
star
5

OrgMark

Insert and edit drawing in Org mode with iPad.
Swift
94
star
6

xeft

Fast, interactive Emacs note searching
Emacs Lisp
62
star
7

undo-hl

Highlight undo operations so you never get lost
Emacs Lisp
57
star
8

iscroll

Smooth scrolling over images in Emacs
Emacs Lisp
52
star
9

isolate

Surrounding magics, extensible
Emacs Lisp
49
star
10

ftable

Fill (auto-layout) tables
Emacs Lisp
44
star
11

ghelp

Emacs generic Help
Emacs Lisp
36
star
12

collab-mode

Cross-editor collaboration (WIP)
Rust
36
star
13

emacs-mission-control

Mac mission-control-like buffer switch
Emacs Lisp
34
star
14

ivy-filthy-rich

Richer information for ivy candidates, fully customizable
Emacs Lisp
19
star
15

casouri.github.io

My blog
HTML
16
star
16

trivial-copy

Copy, paste and move files like you do in Finder in Dired.
Emacs Lisp
14
star
17

awesome-himawari8

A collection of a bunch of implementations of himawari8 live earth desktop in many languages
12
star
18

nerdtab

Keyboard oriented tabs for Emacs
Emacs Lisp
9
star
19

expreg

Your friendly neighborhood expand-region clone
Emacs Lisp
6
star
20

quick-mathlive

Quick mathlive from commandline
JavaScript
6
star
21

weibo2mast

ๅพฎๅš่ฝฌๅ‘ๆฏ›่ฑก๏ผˆmastodon๏ผ‰bot
Python
5
star
22

highres-tab-line

High-res tab-line icons
4
star
23

config

my configurations
Python
4
star
24

zeft

Yet another Deft
Emacs Lisp
4
star
25

lunarySpoon

Sequential key binding for hammerspoon
Lua
4
star
26

find-char

A taste of the `f` operator of vim in Emacs.
Emacs Lisp
4
star
27

xapian-lite

Xapian dynamic module for Emacs
C
4
star
28

emacs-module-prelude

Convenient functions for Emacs dynamic modules.
C
3
star
29

emacs-file-icon

icons for emacs openable files
Python
3
star
30

nyan-lite

Nyan Mode Lite
Emacs Lisp
3
star
31

lunarymacs-stars

Default (my own) stars of lunarymacs
Emacs Lisp
3
star
32

pbcopyf

copy/paste/move files from command line for macOS
Swift
2
star
33

cq-80

Splatoon 2 Octo Expansion CQ-80 terminal replica
C++
2
star
34

lunaryline

A minimum alternative of spaceline.
Emacs Lisp
2
star
35

camelsnake-mode

Type camelCase and get snake_case
Emacs Lisp
2
star
36

fshell

M-x shell improved
Emacs Lisp
1
star
37

monovault

CSE 223B class project
TeX
1
star
38

mac-greek-substitution

macOS substitution for greek
1
star
39

launchdman

launchd parser and manager for Python
Python
1
star
40

hmx

Haskell
1
star
41

grade-analyzer

Fetch grade from Canvas and analyze it.
Python
1
star