Loading ...
Sorry, an error occurred while loading the content.

Display characters and text differently

Expand Messages
  • Wallace Babb
    Hello, (not sure if this should be in Vim_use instead, but anyway) I seem unable to find any resources pertaining to making text or characters being displayed
    Message 1 of 4 , Feb 3 11:14 AM
    • 0 Attachment
      Hello,

      (not sure if this should be in Vim_use instead, but anyway)
      I seem unable to find any resources pertaining to making text or
      characters being displayed as _other_ characters.
      For example, say I want the form feed (^L) character to be displayed
      as a row of dashes (-----). I _could_ use :imap to substitute it, but
      I want the actual ^L to remain in the file, and for it to just
      _appear_ as a row of dashes.
      Is this possible (without modifying the actual VIM source)?

      Thanks

      --
      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
    • Christian J. Robinson
      ... It might be a good idea to post this there, as well. ... [...] ... As far as I know it is not possible to do exactly what you want without modifying the
      Message 2 of 4 , Feb 3 2:30 PM
      • 0 Attachment
        On Fri, 3 Feb 2012, Wallace Babb wrote:

        > (not sure if this should be in Vim_use instead, but anyway)

        It might be a good idea to post this there, as well.

        > say I want the form feed (^L) character to be displayed as a row of
        > dashes (-----).
        [...]
        > Is this possible (without modifying the actual VIM source)?

        As far as I know it is not possible to do exactly what you want
        without modifying the source, but if you're willing to visually
        replace it with a *single* character, you could use the conceal syntax
        feature. For example:

        :syntax match FormFeed "^L" conceal cchar=-
        :set conceallevel=1

        In the above example, ^L is a literal control-l inserted by typing
        control-v then control-l.

        - Christian

        --
        As for me, all I know is that I know nothing.
        Christian J. Robinson <heptite@...> http://christianrobinson.name/

        --
        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
      • Ingo Karkat
        ... Probably, but never mind. ... Vim 7.3 has introduced the conceal feature, related to syntax highlighting. It allows replacing a stretch of text by a
        Message 3 of 4 , Feb 3 2:32 PM
        • 0 Attachment
          On 03-Feb-2012 11:14:54 -0800 (PST), Wallace Babb wrote:

          > (not sure if this should be in Vim_use instead, but anyway)

          Probably, but never mind.

          > I seem unable to find any resources pertaining to making text or
          > characters being displayed as _other_ characters.
          > For example, say I want the form feed (^L) character to be displayed
          > as a row of dashes (-----). I _could_ use :imap to substitute it, but
          > I want the actual ^L to remain in the file, and for it to just
          > _appear_ as a row of dashes.
          > Is this possible (without modifying the actual VIM source)?

          Vim 7.3 has introduced the "conceal" feature, related to syntax highlighting. It
          allows replacing a stretch of text by a character, but not the other way around,
          so you could only replace each individual ^L with a single dash.

          See :help conceal for more information, and have a look at syntax files that
          already use the feature (e.g. $VIMRUNTIME/syntax/tex.vim). (Or ask around on
          vim_use.)

          -- regards, ingo

          --
          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
        • Wallace Babb
          The concealment feature looks good, like a good place for me to start, even though I m sure it won t suffice. I think I ll poke around the source, see if
          Message 4 of 4 , Feb 3 9:05 PM
          • 0 Attachment
            The concealment feature looks good, like a good place for me to start,
            even though I'm sure it won't suffice.
            I think I'll poke around the source, see if adding this is a realistic
            possibility.

            Thanks for the input.

            --
            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
          Your message has been successfully submitted and would be delivered to recipients shortly.