[vim/vim] Support for conceal string - cstr in addition to cchar (#4687)

124 views
Skip to first unread message

Anton Kochkov

unread,
Jul 16, 2019, 11:25:20 AM7/16/19
to vim/vim, Subscribed

To show the string instead of the concealed text fragment, without various additional hacks. So, for example in addition to

 syntax keyword int int conceal cchar=

you would be able to write something like this:

syntax keyword int int conceal cstr='ℤ64'


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Marco Trosi

unread,
Jul 20, 2019, 12:43:33 AM7/20/19
to vim/vim, Subscribed

I have a list of feature requests and this is one of them. thank you.
In my Vim user group we also discussed recently why conceal is limited to single characters.
cstr seems to make sense. I'm very interested to hear what @brammool thinks about it.

Bram Moolenaar

unread,
Jul 20, 2019, 3:26:10 PM7/20/19
to vim/vim, Subscribed

> I have a list of feature requests and this is one of them. thank you.
> In my Vim user group we also discussed recently why conceal is limited to single characters.
> cstr seems to make sense. I'm very interested to hear what @brammool thinks about it.

There is no other reason than that it's a bit of work to implement.
At the time there didn't seem to be much use for adding more complicated
code, a single character should cover most use cases.

--
NEIL INNES PLAYED: THE FIRST SELF-DESTRUCTIVE MONK, ROBIN'S LEAST FAVORITE
MINSTREL, THE PAGE CRUSHED BY A RABBIT, THE OWNER OF A DUCK
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Marco Trosi

unread,
Jul 20, 2019, 5:36:32 PM7/20/19
to vim/vim, Subscribed

Thanks @brammool for the insight.
I could ask around and collect useful use cases to see if it is worth the effort someday in the future.

ngenisis

unread,
Jul 30, 2019, 5:33:34 PM7/30/19
to vim/vim, Subscribed

Here's a use case I've run up against: when editing Mathematica code, I would like to conceal things like \[FormalQ] to (as in the Mathematica front-end), but cchar does not seem to support combining characters.

Yohann Bearzi

unread,
Aug 7, 2019, 10:59:03 AM8/7/19
to vim/vim, Subscribed

Here's another use case. When spaces are used instead of tabs, I don't find a way of displaying tabs as "| " for example if tabs are 2 spaces, to better see alignment (especially in xml files).

Keshav Chand

unread,
Sep 7, 2019, 7:45:40 AM9/7/19
to vim/vim, Subscribed

It would be better if cstr could include regex such as:

syntax keyword int 'i(\d)' conceal cstr='\vℤ$1'

Pim Snel

unread,
Sep 9, 2019, 8:40:24 AM9/9/19
to vim/vim, Subscribed

I could ask around and collect useful use cases to see if it is worth the effort someday in the future.

Forgive me if this is a stupid suggestion. I may have a use case for this feature, but I can not oversee if this features makes it possible. I would like to create a character based image previewer for markdown. E.g. using dotmatrix. It should conceal a markdown image link and show a dynamically created and cached image representation.

Marco Trosi

unread,
Sep 9, 2019, 4:56:12 PM9/9/19
to vim/vim, Subscribed

I don't know why, and it's not a feature request or so, but my brain is now always thinking "SIXEL graphics support in Vim"
https://en.wikipedia.org/wiki/Sixel

Pim Snel

unread,
Sep 9, 2019, 5:10:38 PM9/9/19
to vim/vim, Subscribed

I would love this, but it seems far away.

Mark Manning

unread,
Sep 9, 2019, 5:16:42 PM9/9/19
to vim...@googlegroups.com
So of course - the moment I send an e-mail - I remember.

Freebasic.vim file has been updated at vim.org. :-)

Mark Manning

fritzophrenic

unread,
Sep 18, 2019, 8:47:39 PM9/18/19
to vim/vim, Subscribed

@ybearzi:

Here's another use case. When spaces are used instead of tabs, I don't find a way of displaying tabs as "| " for example if tabs are 2 spaces, to better see alignment (especially in xml files).

You don't need conceal for this. Take a look at:

:help 'list'
:help 'listchars'

BertrandSim

unread,
May 21, 2021, 2:28:11 AM5/21/21
to vim/vim, Subscribed

Here's another use case: concealing \frac{a}{b} to {a}/{b}

If cstr supports back-referencing, one could do something like

syn match '\\frac{\([^}]*\)}{\([^}]*\)}' conceal cstr='{\1}/{\2}'


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe.

Marco Trosi

unread,
May 21, 2021, 10:19:58 AM5/21/21
to vim/vim, Subscribed

@brammool I have the feeling cstr is the next big thing that many users seem to need and are waiting for. I saw quite some users work around this "missing" feature but never really successful, and the solutions are more dirty than good. I tried it myself and gave up. The best thing would be to get cstr.


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe.

Reply all
Reply to author
Forward
0 new messages