[vim/vim] Add listchars option to customize all control characters (#8517)

112 views
Skip to first unread message

defdefred

unread,
Jul 5, 2021, 5:27:45 PM7/5/21
to vim/vim, Subscribed

Vim is perfectly able to display control characters with ^A to ^Z and more appearance, but it could be fun to customize these "not really printable" characters with unicode glyphe.

The set listchars command seems the good candidate to handle this using the common name of control characters: https://en.wikipedia.org/wiki/C0_and_C1_control_codes#Basic_ASCII_control_codes


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,
Jul 15, 2021, 7:15:57 AM7/15/21
to vim/vim, Subscribed

I would be interested in the use case you had that made you write this issue. (but I generally like the idea, but I would like to understand it more if possible and if you don't mind)

Christian Brabandt

unread,
Jul 15, 2021, 7:35:35 AM7/15/21
to vim/vim, Subscribed

you might be able to use concealing for that.

Marco Trosi

unread,
Jul 15, 2021, 8:34:52 AM7/15/21
to vim/vim, Subscribed

@defdefred I tried as @chrisbra suggested
works nicely.

ccc

defdefred

unread,
Aug 9, 2021, 10:50:10 AM8/9/21
to vim/vim, Subscribed

I would be interested in the use case you had that made you write this issue. (but I generally like the idea, but I would like to understand it more if possible and if you don't mind)

It will be a wonderfull way to re-use these abandoned characters as field separator in binary files what will be friendly readable with vim.


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

Triage notifications on the go with GitHub Mobile for iOS or Android.

defdefred

unread,
Aug 9, 2021, 10:50:37 AM8/9/21
to vim/vim, Subscribed

you might be able to use concealing for that.

Thanks!


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

defdefred

unread,
Aug 9, 2021, 10:51:15 AM8/9/21
to vim/vim, Subscribed

@defdefred I tried as @chrisbra suggested
works nicely.

ccc

Thanks! will try :-)


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

Christian Brabandt

unread,
Aug 9, 2021, 3:21:09 PM8/9/21
to vim/vim, Subscribed

But why two method to change how character are displayed? listchar vs conceal ?

Those are somehow overlapping features. Initially, there was only the possibility to display certain characters differently, most notably, the tab and the end-of-line character. Later it has been improved to allow additional characters, like spaces and others. At the same time, the conceal feature was introduced, that allows some more flexibility on what parts of the text (so not just single characters) to show differently. This is much more flexible (e.g. by allowing syntax files to configure it per language and window), but also introduced several new bugs and may slow down vim a bit. So we now have both methods. Use whatever works for you.

So I assume we can close this.


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

Christian Brabandt

unread,
Aug 9, 2021, 3:21:12 PM8/9/21
to vim/vim, Subscribed

Closed #8517.


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

defdefred

unread,
Aug 10, 2021, 3:36:56 AM8/10/21
to vim/vim, Subscribed

Thanks!
I saw also that behavior is not the same.
listchar => permanent display
conceal => only when not editing

This is already fine

Maybe listchar will also permit permanent display of alternate glyphe for control charactère sometime, in a distant future :-)


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

Christian Brabandt

unread,
Aug 10, 2021, 7:03:18 AM8/10/21
to vim/vim, Subscribed

conceal => only when not editing

:h concealcursor


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

defdefred

unread,
Aug 11, 2021, 3:17:18 AM8/11/21
to vim/vim, Subscribed

You are a boss, Thanks!

I tried all control character and 2 are not working:

  • nul 0 (I may have found a bug!)
  • eol (understandable and working with listchars)


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