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

vim repeat sets could include insert-mode text #26

Open
SevereOverfl0w opened this issue Jun 30, 2018 · 3 comments
Open

vim repeat sets could include insert-mode text #26

SevereOverfl0w opened this issue Jun 30, 2018 · 3 comments

Comments

@SevereOverfl0w
Copy link

e.g.

<localleader>wdefn should be the repeat#set text instead of <localleaderw alone. This makes it easier to repeat that kind of change, and would align the behavior with a and i for example.

@justinmk
Copy link

Based on tpope/vim-repeat#63 (comment) it seems like the best option is to avoid using repeat.vim and use an operatorfunc (g@) instead.

Vim's b:changedtick behavior is too unpredictable for repeat.vim to be reliable.

@SevereOverfl0w
Copy link
Author

I tried to do the easiest solution with:

func! Foo(...)
  call sexp#wrap('e', '(', ')', 0, g:sexp_insert_after_wrap)
endf

set opfunc=Foo

Then doing g@iwfoo. When doing ., the text "foo" was inserted, but not the wrapping parens, so I guess there's limitations to how far opfunc can repeat something.

This limitation might be overcome with the right change to vim-sexp however.

@SevereOverfl0w
Copy link
Author

I can't quite figure out how to do this, I stumbled upon vim/vim#202 which suggests that this is possible. The linked commit doesn't seem related though.

I've opened vim/vim#3126 in the hopes of getting some information. I don't think it's currently possible to implement c in user-code though. Maybe you will have some insight into that though @justinmk?

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

2 participants