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

137395Re: I'm not getting highlighting syntax for .twig files..

Expand Messages
  • Benji Fisher
    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.
    • Show all 6 messages in this topic