improve slides.vim: concealing nbsp?

17 views
Skip to first unread message

Marc Chantreux

unread,
Jan 9, 2022, 11:11:27 AMJan 9
to vim_use
hello people,

In slides.vim (an ftplugin to transform vim to a presentation system),
I use nbsp to emphase things

https://github.com/eiro/slides.vim/blob/master/syntax/slides.vim#L1

syn match emphasize "\v \zs[^ ]+\ze "

Which works fine when I want to quote words (or parts of the sentence)
like.

« What if we use vim as presentation system ?»

But... In the case of my next Fosdem talk, I need to emphase

fibonnaci.grep(&evens).head(5)
^^^^^^^^^^^^^
THIS

But next code isn't valid

fibonnaci. grep(&evens) .head(5)

So I want the nbsp to be concealed ane "grep(&evens)" to be emphased.

So I tried

:set conceallevel=3
:syn match nbsp " " concealed

It do the opposite as expected:

* no more color
* nbsp still visible

I read the doc and I spent some time trying to use "contained"
(inspiration by "help.vim") but I'm not sure I got the problem
so I don't really know how to fix it.

Does someone have a clue?

Thanks by advance.
regards
marc

ei...@phear.org

unread,
Jan 11, 2022, 4:28:36 AMJan 11
to vim_use
hello people,

i got some help from #vim channel:

syn region emphasize matchgroup=emphasizeConceal start=" " end=" " oneline concealends

Reply all
Reply to author
Forward
0 new messages