Skip to content
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

single undo of <Leader>ci #7

Open
goodell opened this issue May 4, 2012 · 1 comment
Open

single undo of <Leader>ci #7

goodell opened this issue May 4, 2012 · 1 comment

Comments

@goodell
Copy link

goodell commented May 4, 2012

It would be great if typing <Leader>ci, then some replacement text, then <Esc>, then u would restore the state back to the way things were before the change command. Right now you need to undo twice, once for the actions of the s:ChangeSurrounding function and once for the text added as part of the startinsert that begins at the end of that function.

I tried to hack the script up to use undojoin, especially undojoin | startinsert, but it didn't work. I'm not sure if I'm lacking the vim-fu or if this is a fundamental (and stupid) limitation of vim's undojoin behavior.

@goodell
Copy link
Author

goodell commented May 4, 2012

The way to go might be to use real "object" mappings more like argtextobj.vim. Then xnoremap <silent> ix [...] (and similar) to make cix and friends work. No more <Leader> at all then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant