-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tags and tags switch commands #100
Comments
To add tag support, we'll need to store the tag information somewhere. Does vim undotree have such feature? Currently, vim-mundo is just a fancy frontend for vim's undotree feature, it doesn't have any external storage or something. |
Why not? You could make multiple branches with different experiments. That would allow you to quickly switch between them (including groups of files instead of individual ones), diff them, and build upon them. And when you're done, delete the branches. All without pushing that experimental code anywhere. However, maybe mundo can better communicate what the numbers in the undotree mean. Given the graph:
You can use However, if you really want to use undo instead of git, you can whip something up like so: function! s:GetMarkList()
let b:undomarks = get(b:, 'undomarks', {})
return b:undomarks
endf
function! s:SetMarkList(key, val)
let marks = s:GetMarkList()
let marks[a:key] = a:val
endf
function! s:UndoComplete(...)
return keys(s:GetMarkList())
endf
" These commands only apply to the current buffer, not the mundo
" buffer. (This code doesn't integrate with mundo at all.)
command! -nargs=+ UndoMark call s:SetMarkList(<q-args>, undotree().seq_cur)
command! -nargs=+ -complete=customlist,s:UndoComplete UndoJump exec 'undo' get(s:GetMarkList(), <q-args>, 'invalid mark') Then you can |
It would be useful to have a command to tag versions (similarly to git tags) and a command to switch to a certain tag version.
For instance, when you're debugging code, you often need to observe the program behavior with different strategies, but you don't want to put wrong code on git...
The text was updated successfully, but these errors were encountered: