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

Does not open closed folds like vim's native commands #22

Open
grr opened this issue May 6, 2017 · 4 comments
Open

Does not open closed folds like vim's native commands #22

grr opened this issue May 6, 2017 · 4 comments

Comments

@grr
Copy link

grr commented May 6, 2017

The native vim '*' command will open any closed fold in which the search term is located. But when I mapped '*' to the asterisk plugin, I see it only navigates to the closed fold which contains the term, but doesn't actually open it.

@qstrahl
Copy link

qstrahl commented Aug 29, 2017

Without weighing in on whether or not this should be the default behaviour, you can solve this by making your own mappings with zv appended.

map gz# <Plug>(asterisk-gz#)zv
map z# <Plug>(asterisk-z#)zv
map g# <Plug>(asterisk-g#)zv
map # <Plug>(asterisk-#)zv
map gz* <Plug>(asterisk-gz*)zv
map z* <Plug>(asterisk-z*)zv
map g* <Plug>(asterisk-g*)zv
map * <Plug>(asterisk-*)zv

@qstrahl
Copy link

qstrahl commented Aug 29, 2017

Or, if you want to get really fancy...

for mapping in [ "gz#", "z#", "g#", "#", "gz*", "z*", "g*", "*" ]
  execute "map" mapping "<Plug>(asterisk-" . mapping . ")zv"
endfor

@grr
Copy link
Author

grr commented Aug 31, 2017

I have done exactly that already, but vim-asterisk bills itself as "improved * motions". The default vim behavior is to open folds, and if vim-asterisk is breaking that, that's the opposite of an improvement.

@qstrahl
Copy link

qstrahl commented Aug 31, 2017

Some people may prefer them closed! :P

Only kidding. I'm inclined to agree that it should not deviate from vim behaviour in this way.

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