On Mon, May 8, 2017 at 2:35 PM, Dominique Pellé <dominique.pe...@gmail.com> wrote: > Bram Moolenaar <b...@moolenaar.net> wrote: > >> Tony Mechelynck wrote: >> >>> I notice that at the moment, the soft-hyphen (U+00AD) is displayed as >>> a blank character cell. I suggest to add an entry in 'listchars' (e.g. >>> shy:c) to display it as a glyph of the user's choice, so that e.g. >>> >>> :set lcs=eol:¶,tab:\|_,extends:>,precedes:<,conceal:*,nbsp:·,shy:↔ >>> >>> (assuming UTF-8 'encoding') would, in addition to what it already >>> does, display a soft-hyphen as a double-arrow in SpecialKey >>> highlighting. (I suppose that the added code would be similar to what >>> already exists for the no-break space.) >>> >>> A different default (a hyphen in SpecialKey, maybe?) might be felt >>> more useful: Bram (and other coders), what do you think? >> >> Adding an item in 'lcs' sounds like a good idea. >> >> Doing this with a conceal item is more complex, and there are some side >> effects (perhaps desirable though). > > Perhaps we can have a more generic approach for any kind of characters > by specifying its code point. For example, to show a regular dash for U+00AD: > > :set lcs=U+00AD:- > > Although doing this can become dangerous: if 'lcs' is in a mode line, > it can change any character! > > Dominique
Modelines are best for setting local options; but 'listchars' is global. At the moment, and even with the proposed addition, 'listchars' applies only to a very limited set of characters, all of them "special" one way or another, and IMHO this is a GoodThing™; OTOH, the notion of allowing it for any character (other than colon and comma, as documented; or maybe unless backslash-escaped, but by how many backslashes?) has its advantages, but in that case it might be better to restrict that option to non-sandboxed (and non-modeline) operations, since setting it from a modeline will change the display of every present and future buffer in possibly surprising ways. (For instance, with just 26 custom items, namely a:n,b:o,c:p,d:q,e:r,f:s,g:t,h:u,i:v,j:w,k:x,l:y,m:z,n:a,o:b,p:c,q:d,r:e,s:f,t:g,u:h,v:i,w:j,x:k,y:l,z:m, or the equivalent in terms of whatever syntax would be settled upon, a modeline might ROT13 the display of _every_ present or future buffer in the present instance of Vim: imagine the newbie user's reaction!) Best regards, Tony. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.