You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I want to be able to enable "delimitMate_expand_cr" only for curly braces {} but not parentheses (), while keeping other functions the same for the two.
Is this possible?
The text was updated successfully, but these errors were encountered:
demon386
changed the title
selective enable delimitMate_expand_cr?
Selectively enable delimitMate_expand_cr?
Feb 22, 2018
Similarly, I wanted to enable it for >:< so HTML tags are automatically expanded when I press Return inside an empty tag. But of course I didn't want to have the other delimitMate features for the >:< pair.
I hacked the following together:
imap<silent><expr><CR><SID>delimitMateCR()imap<silent><expr><BS><SID>delimitMateBS()imap<silent><expr><C-h><SID>delimitMateBS()function!s:delimitMateCR()
calls:temporary_matchpairs()
return"\<Plug>delimitMateCR"endfunctionfunction!s:delimitMateBS()
calls:temporary_matchpairs()
return"\<Plug>delimitMateBS"endfunction" Hack: Temporarily change delimitMate_matchpairs to make delimitMateCR and" delimitMateBS work with more charactersfunction!s:temporary_matchpairs()
ifexists('s:matchpairs_timer')
calltimer_stop(s:matchpairs_timer)
endifif!exists('b:delimitMate_matchpairs')
letb:delimitMate_matchpairs=g:delimitMate_matchpairs . ',>:<'silent DelimitMateReload
endiflets:matchpairs_timer=timer_start(100, {-> execute(['unlet! b:delimitMate_matchpairs', 'DelimitMateReload'])})
endfunction
This temporarily adds >:< to b:delimitMate_matchpairs when you press Return or Backspace.
Although this works, it would be nice if delimitMate had an option to specify the characters for delimitMateCR and delimitMateBS.
Hi, I want to be able to enable "delimitMate_expand_cr" only for curly braces {} but not parentheses (), while keeping other functions the same for the two.
Is this possible?
The text was updated successfully, but these errors were encountered: