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

Re: g?vim and bizarre font request.

Expand Messages
  • Tim Chase
    ... Well, when coming in over a SSH connection, there s not much you can do to make the font itself change. However, you can colorize ... which seems to
    Message 1 of 6 , Jan 4, 2007
    • 0 Attachment
      > (* n (factorial (- n 1)))))
      >
      > should mean it takes about 650ms for someone to see there are 5
      > close parentheses at the end. It takes me about 3 seconds of
      > concious effort to reach that number. Moving the cursor over them
      > is one option, but it is slower. I think another might be if I can
      > find a font and a means of displaying it which slightly disturbs the
      > spacing, position or shape of successive parentheses, so the pattern is
      > irregular. Then when the characters appear to "move about" for me I
      > won't mix them up and come to a wrong count. I'm thinking of the
      > way text used to be just a bit wobbly with the line printers of the
      > 1980's.
      >
      > Given my preferred editor is Vim, and I'm using it on Windows, mostly
      > with PuTTY talking to a Unix box, does anyone know if I can do this?
      > Maybe there's another solution?

      Well, when coming in over a SSH connection, there's not much you
      can do to make the font itself change. However, you can colorize
      differently. Toying around, I came up with this:

      :match Error /)\zs)/

      which seems to correctly highlight alternating adjacent parents
      (using the "Error" group, which I tend to use, but adjust
      according to taste). My original though was to try and do
      something of the form "\%1c(\|%3c(\|%5c(\|..." for alternating
      screen columns, but I like the compactness of the actual solution
      I gave, as well as its ability to work regardless of the number
      of columns in your terminal window.

      -tim
    • Charles E Campbell Jr
      ... You can also simply try putting ... in your . The lisp highlighting syntax file (syntax/lisp.vim) already supports colorizing ()s based on
      Message 2 of 6 , Jan 4, 2007
      • 0 Attachment
        Hugh Sasse wrote:

        >I am interested in exploring Lisp before too long. However, I
        >have a physical problem with the parentheses. My nystagmus
        >means that just outside the subitizing range my time to count
        >parentheses increases dramatically. According to wikipedia
        >it should increase at roughly 100ms below 4 and 250 milliseconds for
        >every item above 4. So this code from Wikipedia:
        >
        >(defun factorial (n)
        > (if (<= n 1)
        > 1
        > (* n (factorial (- n 1)))))
        >
        >should mean it takes about 650ms for someone to see there are 5
        >close parentheses at the end.
        >
        You can also simply try putting

        :let g:lisp_rainbow= 1

        in your <.vimrc> . The lisp highlighting syntax file (syntax/lisp.vim)
        already supports colorizing
        ()s based on nesting level.

        Regards,
        Chip Campbell
      • Hugh Sasse
        ... that looks interesting. Done the vimball bit then I try to install rainbow.vba (having gunzipped it); vim rainbow.vba gives: ***vimball*** Source this
        Message 3 of 6 , Jan 4, 2007
        • 0 Attachment
          On Thu, 4 Jan 2007, Charles E Campbell Jr wrote:

          > Hugh Sasse wrote:
          >
          > > I am interested in exploring Lisp before too long. However, I have a
          > > physical problem with the parentheses.
          > >
          > You may find rainbow.vim helpful; see
          >
          > http://mysite.verizon.net/astronaut/vim/index.html#RAINBOW

          that looks interesting. Done the vimball bit then I try to install
          rainbow.vba (having gunzipped it);

          vim rainbow.vba gives:
          ***vimball*** Source this file to extract it! (:so %)
          Error detected while processing BufEnter Auto commands for "*.vba":
          E119: Not enough arguments for function: vimball#ShowMesg
          Press ENTER or type command to continue

          So I try to extract it anyway:
          Vimball Archive
          extracted <after/syntax/c/rainbow.vim>: 100 lines
          wrote /home/hgs/.vim/after/syntax/c/rainbow.vim

          Press ENTER or type command to continue

          So that means it only applies to C files out of the box?
          I think it would be more useful it it were setup as a plugin
          one could use for Perl, Ruby, (your later message covers lisp), etc
          I don't consider myself fluent in vim internals, so maybe I've
          missed something with this paragraph.

          Your web page has:

          <br><li><a href="vbafiles/RunView.vba.gz">Rndm</a> <a name="RUNVIEW"></a> <!-- {{{2 -->
          <table bgcolor="#005533" border="0" cellspacing="0"><tbody><tr><td><font size="-1"><font color="#aaaaaa"><em>Updated Dec 15, 2005 (v1e)</em>


          I think that should be (written as if this were a patch):
          -<br><li><a href="vbafiles/RunView.vba.gz">Rndm</a> <a name="RUNVIEW"></a> <!-- {{{2 -->
          +<br><li><a href="vbafiles/RunView.vba.gz">RunView</a> <a name="RUNVIEW"></a> <!-- {{{2 -->
          <table bgcolor="#005533" border="0" cellspacing="0"><tbody><tr><td><font size="-1"><font color="#aaaaaa"><em>Updated Dec 15, 2005 (v1e)</em>
          >
          > It colorizes brackets [] {} () based on nesting level.

          Thank you,
          Hugh
        • Charles E Campbell Jr
          ... Its been awhile since I wrote the rainbow stuff; I d forgotten that I d already included it with vim 7.0 s syntax/lisp.vim. Just put let g:lisp_rainbow= 1
          Message 4 of 6 , Jan 4, 2007
          • 0 Attachment
            Hugh Sasse wrote:

            >On Thu, 4 Jan 2007, Charles E Campbell Jr wrote:
            >
            >
            >
            >>Hugh Sasse wrote:
            >>
            >>
            >>
            >>>I am interested in exploring Lisp before too long. However, I have a
            >>>physical problem with the parentheses.
            >>>
            >>>
            >>>
            >>You may find rainbow.vim helpful; see
            >>
            >> http://mysite.verizon.net/astronaut/vim/index.html#RAINBOW
            >>
            >>
            >
            >that looks interesting. Done the vimball bit then I try to install
            >rainbow.vba (having gunzipped it);
            >
            >vim rainbow.vba gives:
            >***vimball*** Source this file to extract it! (:so %)
            >Error detected while processing BufEnter Auto commands for "*.vba":
            >E119: Not enough arguments for function: vimball#ShowMesg
            >Press ENTER or type command to continue
            >
            >So I try to extract it anyway:
            >Vimball Archive
            >extracted <after/syntax/c/rainbow.vim>: 100 lines
            >wrote /home/hgs/.vim/after/syntax/c/rainbow.vim
            >
            >Press ENTER or type command to continue
            >
            >So that means it only applies to C files out of the box?
            >
            >

            Its been awhile since I wrote the rainbow stuff; I'd forgotten that I'd
            already included it with vim 7.0's syntax/lisp.vim.
            Just put

            let g:lisp_rainbow= 1

            in your <.vimrc> and it'll be enabled for Lisp.

            >I think it would be more useful it it were setup as a plugin
            >one could use for Perl, Ruby, (your later message covers lisp), etc
            >
            >
            The rainbow highlighting needs to be attuned to the specific syntax
            highlighting files for each language.
            Its done by assigning a region which begins with ( and ends with ). To
            retain normal highlighting inside
            such syntax highlighting regions, the region must "contain"
            language-specific highlighting regions.

            So, Perl and Ruby would need specialized versions of rainbow.vim. I use
            Perl but seldom, and don't know Ruby,
            and yours is the first request for rainbow highlighting for those
            languages I've received.

            >I don't consider myself fluent in vim internals, so maybe I've
            >missed something with this paragraph.
            >
            >Your web page has:
            >
            ><br><li><a href="vbafiles/RunView.vba.gz">Rndm</a> <a name="RUNVIEW"></a> <!-- {{{2 -->
            > <table bgcolor="#005533" border="0" cellspacing="0"><tbody><tr><td><font size="-1"><font color="#aaaaaa"><em>Updated Dec 15, 2005 (v1e)</em>
            >
            >

            Yep! Definitely a mistake. Thank you for catching it!

            Regards,
            Chip Campbell
          • Hugh Sasse
            ... [Error reports trimmed] ... Thank you. ... Oh, right. I hadn t explored the internals. I ll have a look later... ... I use Ruby much more than Perl these
            Message 5 of 6 , Jan 4, 2007
            • 0 Attachment
              On Thu, 4 Jan 2007, Charles E Campbell Jr wrote:

              > Hugh Sasse wrote:
              >
              > > On Thu, 4 Jan 2007, Charles E Campbell Jr wrote:
              > >
              > >
              > > > Hugh Sasse wrote:
              > > >
              > > >
              > > > > I am interested in exploring Lisp before too long. However, I have a
              > > > > physical problem with the parentheses.
              > > > >
              > > > >
              > > > You may find rainbow.vim helpful; see
              > > >
              > > > http://mysite.verizon.net/astronaut/vim/index.html#RAINBOW
              > > >
              > >
              > > that looks interesting. Done the vimball bit then I try to install
              > > rainbow.vba (having gunzipped it);
              > >
              [Error reports trimmed]
              > >
              > > So that means it only applies to C files out of the box?
              > >
              >
              > Its been awhile since I wrote the rainbow stuff; I'd forgotten that I'd
              > already included it with vim 7.0's syntax/lisp.vim.
              > Just put
              >
              > let g:lisp_rainbow= 1
              >
              > in your <.vimrc> and it'll be enabled for Lisp.

              Thank you.
              >
              > > I think it would be more useful it it were setup as a plugin
              > > one could use for Perl, Ruby, (your later message covers lisp), etc
              > >
              > The rainbow highlighting needs to be attuned to the specific syntax
              > highlighting files for each language.
              > Its done by assigning a region which begins with ( and ends with ). To retain
              > normal highlighting inside
              > such syntax highlighting regions, the region must "contain" language-specific
              > highlighting regions.

              Oh, right. I hadn't explored the internals. I'll have a look later...
              >
              > So, Perl and Ruby would need specialized versions of rainbow.vim. I use Perl
              > but seldom, and don't know Ruby,

              I use Ruby much more than Perl these days, so I'll see if I can do anything
              useful along these lines. I've done small things with the syntax files
              before, so I'll see if I'm biting off more than I can chew here :-)
              It will be useful to learn how you've made this user selectable, rather
              than the default, so I can separate concerns in future.

              > and yours is the first request for rainbow highlighting for those languages
              > I've received.

              I don't know how big the intersect is between the set of vim users and
              the set of people with nystagmus :-) Ruby is light on parentheses in
              the way that Perl is, but sometimes....
              >
              [...]
              > > Your web page has:
              [...]
              > >
              >
              > Yep! Definitely a mistake. Thank you for catching it!

              glad I could help.
              >
              > Regards,
              > Chip Campbell
              >
              Thank you,
              Hugh
            Your message has been successfully submitted and would be delivered to recipients shortly.