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

Slow Syntax Highlighting with Latex

Expand Messages
  • at
    I am having problems with slow speeds when using syntax highlighting in GVim using the native latex syntax highlighting. By slow I mean the response time
    Message 1 of 5 , Jun 27, 2013
    • 0 Attachment
      I am having problems with slow speeds when using syntax highlighting in GVim using the native latex syntax highlighting.

      By slow I mean the response time between keyboard and screen is lagged.

      I can confirm that it is due to syntax highlighting by turning off all highlighting--then the response time is quick as in other applications.

      I have read posts by others on this topic both in this group and elsewhere. Most suggest turning off cursor line (or column) highlighting. I do not have this on.

      The machine I have problems with is fairly new and fast. Moreover, I use the exact same Vim configuration files on two much slower machines and do not observe this problem with the same .tex files.

      Any other suggestions as to how I can fix this?

      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Charles Campbell
      ... Hello! With v79 of syntax/tex.vim (available at my website: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX ), there s a number of ways to speed
      Message 2 of 5 , Jun 28, 2013
      • 0 Attachment
        at wrote:
        > I am having problems with slow speeds when using syntax highlighting in GVim using the native latex syntax highlighting.
        >
        > By slow I mean the response time between keyboard and screen is lagged.
        >
        > I can confirm that it is due to syntax highlighting by turning off all highlighting--then the response time is quick as in other applications.
        >
        > I have read posts by others on this topic both in this group and elsewhere. Most suggest turning off cursor line (or column) highlighting. I do not have this on.
        >
        > The machine I have problems with is fairly new and fast. Moreover, I use the exact same Vim configuration files on two much slower machines and do not observe this problem with the same .tex files.
        >
        > Any other suggestions as to how I can fix this?
        >
        Hello!

        With v79 of syntax/tex.vim (available at my website:
        http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX ), there's a
        number of ways to speed up LaTeX highlighting. From the help (which
        hasn't appeared at Merc yet, but Bram has accepted):

        *tex-slow* *tex-sync*
        Tex: Slow Syntax Highlighting? ~

        If you have a slow computer, you may wish to reduce the values for >
        :syn sync maxlines=200
        :syn sync minlines=50
        (especially the latter). If your computer is fast, you may wish to
        increase them. This primarily affects synchronizing (i.e. just what
        group,
        if any, is the text at the top of the screen supposed to be in?).

        Another cause of slow highlighting is due to syntax-driven folding; see
        |tex-folding| for a way around this.

        *g:tex_fast*

        Finally, if syntax highlighting is still too slow, you may set >

        :let g:tex_fast= ""

        in your .vimrc. Used this way, the g:tex_fast variable causes the syntax
        highlighting script to avoid defining any regions and associated
        synchronization. The result will be much faster syntax highlighting; the
        price: you will no longer have as much highlighting or any syntax-based
        folding, and you will be missing syntax-based error checking.

        You may decide that some syntax is acceptable; you may use the following
        table
        selectively to enable just some syntax highlighting: >

        b : allow bold and italic syntax
        c : allow texComment syntax
        m : allow texMatcher syntax (ie. {...} and [...])
        M : allow texMath syntax
        p : allow parts, chapter, section, etc syntax
        r : allow texRefZone syntax (nocite, bibliography, label, pageref,
        eqref)
        s : allow superscript/subscript regions
        S : allow texStyle syntax
        v : allow verbatim syntax
        V : allow texNewEnv and texNewCmd syntax
        <
        As an example, let g:tex_fast= "M" will allow math-associated highlighting
        but suppress all the other region-based syntax highlighting.

        *tex-folding* *g:tex_fold_enabled*
        Tex: Want Syntax Folding? ~

        As of version 28 of <syntax/tex.vim>, syntax-based folding of parts,
        chapters,
        sections, subsections, etc are supported. Put >
        let g:tex_fold_enabled=1
        in your <.vimrc>, and :set fdm=syntax. I suggest doing the latter via a
        modeline at the end of your LaTeX file: >
        % vim: fdm=syntax
        If your system becomes too slow, then you might wish to look into >
        https://vimhelp.appspot.com/vim_faq.txt.html#faq-29.7

        Regards,
        C Campbell

        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Ben Fritz
        ... What version and patchlevel of Vim? Current work leading up to 7.4 release added and is making faster a NFA-type regex engine. -- -- You received this
        Message 3 of 5 , Jun 28, 2013
        • 0 Attachment
          On Thursday, June 27, 2013 7:07:55 PM UTC-5, at wrote:
          > I am having problems with slow speeds when using syntax highlighting in GVim using the native latex syntax highlighting.
          >

          What version and patchlevel of Vim? Current work leading up to 7.4 release added and is making faster a NFA-type regex engine.

          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • at
          ... The version is from the Mint 13 repositories. Here is the info: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 4 2012 04:22:36) Included patches: 1-429
          Message 4 of 5 , Jun 28, 2013
          • 0 Attachment
            On Friday, June 28, 2013 9:47:18 AM UTC-5, Ben Fritz wrote:
            > On Thursday, June 27, 2013 7:07:55 PM UTC-5, at wrote:
            > > I am having problems with slow speeds when using syntax highlighting in GVim using the native latex syntax highlighting.
            > >
            >
            > What version and patchlevel of Vim? Current work leading up to 7.4 release added and is making faster a NFA-type regex engine.

            The version is from the Mint 13 repositories. Here is the info:

            VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 4 2012 04:22:36)
            Included patches: 1-429

            I will use Charles' code to disable various syntaxing features if necessary. However, I am still confused as to why syntax is so slow only on this one machine and not on my other machines which use the same version and are comparable or less powerful in terms of computing resources.

            --
            --
            You received this message from the "vim_use" 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_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Zulox4
            ... Try to test last version - 7.3.1302 - https://code.google.com/p/vim/source/list Get a local copy of the vim repository with this command: hg clone
            Message 5 of 5 , Jul 3 3:47 PM
            • 0 Attachment
              On Friday, June 28, 2013 6:38:13 PM UTC+2, at wrote:
              > On Friday, June 28, 2013 9:47:18 AM UTC-5, Ben Fritz wrote:
              > > On Thursday, June 27, 2013 7:07:55 PM UTC-5, at wrote:
              > > > I am having problems with slow speeds when using syntax highlighting in GVim using the native latex syntax highlighting.
              > > >
              > >
              > > What version and patchlevel of Vim? Current work leading up to 7.4 release added and is making faster a NFA-type regex engine.
              >
              > The version is from the Mint 13 repositories. Here is the info:
              >
              > VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 4 2012 04:22:36)
              > Included patches: 1-429
              >
              > I will use Charles' code to disable various syntaxing features if necessary. However, I am still confused as to why syntax is so slow only on this one machine and not on my other machines which use the same version and are comparable or less powerful in terms of computing resources.

              Try to test last version - 7.3.1302 - https://code.google.com/p/vim/source/list

              Get a local copy of the vim repository with this command:

              hg clone https://code.google.com/p/vim/

              Hope useful !

              --
              --
              You received this message from the "vim_use" 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_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            Your message has been successfully submitted and would be delivered to recipients shortly.