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

I'm not getting highlighting syntax for .twig files..

Expand Messages
  • Javier Garcia
    Hi, I have installed .vim/syntax/htmljinja.vim and wrote this in my .vimrc: au BufRead,BufNewFile *.twig set syntax=htmljinja Any idea? 7.3.912 Javi -- -- You
    Message 1 of 6 , Apr 27, 2013
    • 0 Attachment
      Hi,

      I have installed .vim/syntax/htmljinja.vim and wrote this in my .vimrc:

      au BufRead,BufNewFile *.twig set syntax=htmljinja

      Any idea?

      7.3.912

      Javi

      --
      --
      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.
    • Phil Dobbin
      ... Try: au BufRead,BufNewFile {*.twig} set ft=htmljinja Cheers, Phil... -- -- You received this message from the vim_use maillist. Do not top-post! Type
      Message 2 of 6 , Apr 27, 2013
      • 0 Attachment
        On 27/04/2013 14:41, Javier Garcia wrote:

        > Hi,
        >
        > I have installed .vim/syntax/htmljinja.vim and wrote this in my .vimrc:
        >
        > au BufRead,BufNewFile *.twig set syntax=htmljinja

        Try:

        'au BufRead,BufNewFile {*.twig} set ft=htmljinja'

        Cheers,

        Phil...




        --
        --
        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.
      • Gary Johnson
        ... The {} are not necessary. Regards, Gary -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you
        Message 3 of 6 , Apr 27, 2013
        • 0 Attachment
          On 2013-04-27, Phil Dobbin wrote:
          > On 27/04/2013 14:41, Javier Garcia wrote:
          >
          > > Hi,
          > >
          > > I have installed .vim/syntax/htmljinja.vim and wrote this in my .vimrc:
          > >
          > > au BufRead,BufNewFile *.twig set syntax=htmljinja
          >
          > Try:
          >
          > 'au BufRead,BufNewFile {*.twig} set ft=htmljinja'

          The {} are not necessary.

          Regards,
          Gary

          --
          --
          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.
        • Phil Dobbin
          ... That s right. Only if you intend to add more than one file extension (I copied & pasted it straight out of my vimrc & deleted as appropriate). Cheers,
          Message 4 of 6 , Apr 27, 2013
          • 0 Attachment
            On 27/04/2013 19:39, Gary Johnson wrote:
            > On 2013-04-27, Phil Dobbin wrote:
            >> On 27/04/2013 14:41, Javier Garcia wrote:
            >>
            >>> Hi,
            >>>
            >>> I have installed .vim/syntax/htmljinja.vim and wrote this in my .vimrc:
            >>>
            >>> au BufRead,BufNewFile *.twig set syntax=htmljinja
            >>
            >> Try:
            >>
            >> 'au BufRead,BufNewFile {*.twig} set ft=htmljinja'
            >
            > The {} are not necessary.

            That's right. Only if you intend to add more than one file extension (I
            copied & pasted it straight out of my vimrc & deleted as appropriate).

            Cheers,

            Phil...



            --
            --
            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.
          • Benji Fisher
            ... This advice comes down to set the ft option instead of the syntax option. I think that misses the point: setting syntax should work. Probably you
            Message 5 of 6 , Apr 28, 2013
            • 0 Attachment
              On Sat, Apr 27, 2013 at 5:05 PM, Phil Dobbin <phildobbin@...> wrote:
              On 27/04/2013 19:39, Gary Johnson wrote:
              > On 2013-04-27, Phil Dobbin wrote:
              >> On 27/04/2013 14:41, Javier Garcia wrote:
              >>
              >>> Hi,
              >>>
              >>> I have installed .vim/syntax/htmljinja.vim and wrote this in my .vimrc:
              >>>
              >>> au BufRead,BufNewFile *.twig set syntax=htmljinja
              >>
              >> Try:
              >>
              >> 'au BufRead,BufNewFile {*.twig} set ft=htmljinja'
              >
              > The {} are not necessary.

              That's right. Only if you intend to add more than one file extension (I
              copied & pasted it straight out of my vimrc & deleted as appropriate).

                   This advice comes down to "set the 'ft' option instead of the 'syntax' option."  I think that misses the point:  setting 'syntax' should work.

                   Probably you do not have  a syntax file for htmljinja,  Last I checked, there is none included with the standard vim distribution.  Either download and install a syntax file for htmljinja or use something similar, like htmldjango (which is included in the standard distro).  While editing a .twig file, try

              :set syntax=htmldjango

              and see whether you like it.  If so, add an autocommand to your vimrc file.  If not, then make sure you have a syntax file for htmljinja.

                   Another possibility:  if you *do* already have a syntax file for htmljinja and you added an autocommand to your vimrc file, did you  restart vim after editing vimrc?

              HTH  --Benji Fisher

              --
              --
              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.
               
               
            • Javier Garcia
              ... Thanks, works! -- -- 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
              Message 6 of 6 , Apr 28, 2013
              • 0 Attachment
                On Saturday, 27 April 2013 20:27:13 UTC+2, Phil Dobbin wrote:
                > On 27/04/2013 14:41, Javier Garcia wrote:

                > 'au BufRead,BufNewFile {*.twig} set ft=htmljinja'

                Thanks, works!

                --
                --
                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.