sponsor Vim development Vim logo Vim Book Ad

histwin.vim : Browse the undo tree

 script karma  Rating 87/30, Downloaded by 475  Comments, bugs, improvements  Vim wiki

created by
Christian Brabandt
 
script type
utility
 
description
PLEASE RATE THIS PLUGIN, IF YOU LIKE IT!

Feedback is always welcome. See :h histwin-feedback.

You can now follow development of this plugin via github: http://github.com/chrisbra/histwin.vim

Vim 7 has an amazing feature that is called undo-branches. See :h undo-tree. Unfortunalley it is a little bit clumsy to use.

Therefore this plugin allows for easy navigation between the different undo-branches for a file.
See this screenshot: http://www.256bit.org/~chrisbra/vim_undotree.png
This plugin was inspired by the undo_branches plugin (http://www.vim.org/scripts/script.php?script_id=1997).

This plugin allows you to
- see all available undo-branches (Timestamps and Keywords)
- tag certain states
- switching to different states (including the first state (before any changes were made)
- allow to diff the selected undo-branch with the current version
- replay the changes (ok, this is just for fun ;)

Open the UndoBrowse window by issuing :UB
A new window will appear, which contains the name of the file you are watching a small help
banner that contains the most important mappings for this window and a list of all available
undo-branches (which shows the time when this change was made and your tags for that state, if there are any). On each entry you can press Enter or T to jump to that state or tag that state.

This plugin maps the following keys:
- 'Enter' on an entry jump to that state in time of the file
- 'T' tags a state with a phrase.
- 'R' lets you replay a change
- 'I' opens/closes the help banner
- 'Q' closes the window
- CTRL-L reload view
- D diff selected version
 
install details
edit the file histwin.vba with vim. From within vim simply load this file:
:so %

Vim will automatically install this plugin.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
histwin-0.12.vba 0.12 2010-05-04 7.0 Christian Brabandt - Small extension to the help file
- generate help file with 'et' set, so the README at github looks better
- Highlight the key binding using |hl-SpecialKey|
- The help tag for the color configuration was wrong.
histwin.vba 0.11 2010-04-21 7.0 Christian Brabandt - Set old buffers read only (disable the setting via the g:undo_tree_nomod variable
- Make sure, Warning Messages are really displayed using :unsilent
histwin.vba 0.10 2010-04-20 7.0 Christian Brabandt - Fixed annoying Resizing bug
- linebreak tags, if they are too long
- dynamically grow the histwin window, for longer tags (up
   to a maximum)
- Bugfix: Always indicate the correct branch
- Added a few try/catch statements and some error handling
histwin.vba 0.9 2010-01-27 7.0 Christian Brabandt BF: Error handling for Replaying (it may not work always)
NF: Finally added Documentation (see :h histwin.txt)
BF: Use syntax highlighting
BF: Tagging finally works (you can now tag additional states)
histwin.vba 0.8 2010-01-21 7.0 Christian Brabandt - NF: make speed of the replay adjustable. Use g:undo_tree_speed to set time in milliseconds
- BF: code cleanup
- BF: highlighting should work better now.
histwin.vba 0.7.2. 2010-01-20 7.0 Christian Brabandt - BF: Check undolevel Settings
- BF: make sure when switching to a different undo branch, that the undo-tree will be updated
histwin.vba 0.7.1 2010-01-20 7.0 Christian Brabandt BF: fixed a problem with mapping the keys which broke the Undo-Tree keys (I guess I don't fully understand, when to use s: and <sid>)
histwin.vba 0.7 2010-01-20 7.0 Christian Brabandt - NF: created autoloadPlugin (patch by Charles Campbell) Thanks!
- NF: enabled GLVS (patch by Charles Campbell) Thanks!
- NF: made Plugin available as histwin.vba
- NF: Check for availability of :UB before defining it
- BF: cleaned up old comments
- BF: deleted :noautocmd which could cause trouble with other plugins
- BF: small changes in coding style (<sid> to s:, fun instead of fu)
histwin.vim 0.6 2010-01-20 7.0 Christian Brabandt BF: fix missing bufname() when creating the undo_tree window
NF: make undo_tree window a little bit smaller (size is adjustable via g:undo_tree_wdth variable)
histwin.vim 0.5 2010-01-20 7.0 Christian Brabandt NF: Allow diffing with selected branch
NF: highlight current version
NF: Use changenr() to determine undobranch
NF: <C-L> updates view
NF: allow switching to initial load state, before buffer was edited
BF: Fix annoying bug, that displays --No lines in buffer--
BF: fix several small annoying bugs
histwin.vim 0.2 2010-01-19 7.2 Christian Brabandt Initial upload

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo