Skip to content

Support for conceal string - cstr in addition to cchar #4687

Open

Description

@XVilka

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 int64 int64 conceal cstr='ℤ64'

Activity

  1. marcotrosi commented on Jul 20, 2019

    @marcotrosi

    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.

  2. brammool commented on Jul 20, 2019

    @brammool
    Contributor
  3. marcotrosi commented on Jul 20, 2019

    @marcotrosi

    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.

  4. ybearzi commented on Aug 7, 2019

    @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).

  5. keshavchand commented on Sep 7, 2019

    @keshavchand

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

    syntax keyword int '\vi(\d)' conceal cstr='\vℤ$1'
  6. mipmip commented on Sep 9, 2019

    @mipmip

    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.

  7. marcotrosi commented on Sep 9, 2019

    @marcotrosi

    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

  8. mipmip commented on Sep 9, 2019

    @mipmip

    I would love this, but it seems far away.

  9. fritzophrenic commented on Sep 19, 2019

    @fritzophrenic
    Contributor

    @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'

  10. BertrandSim commented on May 21, 2021

    @BertrandSim

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

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

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

    Idea from this post

  11. marcotrosi commented on May 21, 2021

    @marcotrosi

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions