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

"Unhighlight" match after a few seconds #18

Closed
filipekiss opened this issue Jan 8, 2018 · 2 comments
Closed

"Unhighlight" match after a few seconds #18

filipekiss opened this issue Jan 8, 2018 · 2 comments

Comments

@filipekiss
Copy link

Hey Andy, first of all, thank you so much for the plugin. It really is a life saver, specially regarding the motions!

I have a doubt: Can you add an option to "unhighlight" the matches after a specified timeout? For example, I do have some legacy javascript and matchup perfectly matches the tags inside that strings, like the example below:

image

As you can see, when I'm inside the span, everything is highlighted. So visual selection doesn't work properly (I mean, I can still use visual select and it will yank/change/delete, but I can't see the visual selection itself).

Maybe add an option to remove the highlight after I've been in the tag, so I can set for something like, 2 seconds, and after that it won't highlight that part again until I leave that tag and comeback to it?

(Or if you have any suggestions on how I can circumvent this problem, I'm all ears).

Here's my matchup config, but I don't think that's the cause (running with the default options yields the same result)

" Enable experimental transmute module
" See https://github.com/andymass/vim-matchup#d1-parallel-transmutation
let g:matchup_transmute_enabled = 1

" Deferred highlight for performance reasons
let g:matchup_matchparen_deferred = 1

" Adjust highlight timeouts
let g:matchup_matchparen_timeout = 150
let g:matchup_matchparen_insert_timeout = 30

Thank you for your time :)

@andymass
Copy link
Owner

andymass commented Jan 8, 2018

Thanks, I think this should be relatively easy to accomplish since you're using the "deferred" style of highlighting which uses already timers. I will look into it.

But first.. I will quickly mention that you may want to adjust your highlighting so that visual and matching are distinct regardless. For instance (these colors are ugly, you will want to adjust them to your tastes),

highlight Visual guifg=white guibg=black ctermfg=white ctermbg=black
highlight MatchParen guifg=yellow guibg=blue ctermfg=yellow ctermbg=blue 

Which color scheme are you using? Different schemes set these colors differently.

@filipekiss
Copy link
Author

filipekiss commented Jan 8, 2018

@andymass Thank you for the quick response!

I'm currently using gruvbox, that's my go to theme, but I do have my moments where I change to something else just to look to some different colors.

The highlight groups worked great for now! (I'll just need to adjust the colors, I'll look into how I should do that to use my current theme colors).

Thanks for the help!


Edit: Just found out about hi! link <highlightGroup> <highlightGroup> and I guess I'm going to use that to make it work with more themes out of the box!

andymass added a commit that referenced this issue Apr 2, 2018
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