Code Monkey home page Code Monkey logo

Comments (5)

kiryph avatar kiryph commented on May 31, 2024 1

Thanks for the update. My setup if I have matchup installed is now:

" let g:matchup_matchparen_enabled = 1 "(default) enable on startup and disable it immediately again with autocmd VimeEnter * NoMatchParen
let g:matchup_matchparen_fallback = 0 " never use matchparen.vim
augroup vimenter
  autocmd!
  autocmd VimEnter * NoMatchParen
augroup END
nnoremap [op :DoMatchParen<CR>
nnoremap ]op :NoMatchParen<CR>
" commented matchparen.vim version:
" nnoremap cop :<C-R>=exists("g:loaded_matchparen") ? 'NoMatchParen' : 'DoMatchParen'<CR><CR>
nnoremap cop :<C-R>=exists("g:matchup_matchparen_enabled") ? ( (g:matchup_matchparen_enabled == 1) ? 'NoMatchParen': 'DoMatchParen'): 'DoMatchParen'<CR><CR>

It does what I wanted.

I just want to say that moving by keeping hjkl pressed with matchup enabled is really slow, not better than the original matchparen.vim

from vim-matchup.

andymass avatar andymass commented on May 31, 2024

Are you requesting that commands DoMatchParen and NoMatchParen to affect match-up, or are you requesting similar commands, for example, DoMatchupMatchParen or NoMatchupMatchParen?

Do you know you can freely toggle highlighting globally with g:matchup_matchparen_enabled = 0 and per buffer as let b:matchup_matchparen_enabled=0 and let b:matchup_matchparen_fallback=0? But I am willing to add shortcut commands; should be an easy change.

BTW, are you aware of the pull request..

Funny! I was not aware but I actually already implemented something similar. I have been waiting on releasing it for a few reasons. 1) I find the slight delay annoying personally, and match-up hasn't been too slow for me to warrant it. 2) It adds another option which I don't want to make the default but then people won't be aware of it. 3) has('timers') is pretty new. Tracking progress here: #6.

from vim-matchup.

kiryph avatar kiryph commented on May 31, 2024

Do you know you can freely toggle highlighting globally with g:matchup_matchparen_enabled = 0 and per buffer as let b:matchup_matchparen_enabled=0 and let b:matchup_matchparen_fallback=0?

I am not sure that changing the value of the variable enables dynamically matchup_matchparen.
I mean I have added to my vimrc let g:matchup_matchparen_enabled = 0 so matchup is disabled on startup. However, I want to enable it with cop and switch it off again with cop.

Following toggles the value of the variable but does not enable or disable matchup_matchparen:

vimrc

...
let g:matchup_matchparen_enabled = 0
nnoremap cop :<C-R>=exists("g:matchup_matchparen_enabled") ? (g:matchup_matchparen_enabled == 1? 'let g:matchup_matchparen_enabled = 0': 'let g:matchup_matchparen_enabled = 1'): 'let g:matchup_matchparen_enabled = 0'<CR><CR>
...

from vim-matchup.

andymass avatar andymass commented on May 31, 2024

Ah, I see the issue with g:matchup_matchparen_enabled now.

I've added DoMatchParen and NoMatchParen which should do what you want.

from vim-matchup.

andymass avatar andymass commented on May 31, 2024

with matchup enabled is really slow, not better than the original matchparen.vim

match-up is necessarily going to be slower at highlighting than matchparen since it's looking for many more things. However, I am happy to try to improve the performance as much as possible. What language(s) do you see the slowdown with?

Would you be willing to try out the feature-deferred branch, which enables lazy/deferred/delayed highlighting? If so, you can do let g:matchup_matchparen_deferred = 1 with that branch. Also note that the times in milliseconds are configurable but you must reload for the new values to take effect. Feel free to report comments at #6.

from vim-matchup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.