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

Question about setting default syntax highlighter

Expand Messages
  • Carfield Yim
    Hi, I need to use vim to edit config files for Visual Studio project a lot, all the config file are XML but edit with *.conf. How can I config vim to use XML
    Message 1 of 3 , Jul 17, 2014
    • 0 Attachment
      Hi, I need to use vim to edit config files for Visual Studio project a lot, all the config file are XML but edit with *.conf. How can I config vim to use XML syntax highlighter for all *.conf file?

      --
      --
      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/d/optout.
    • John Beckett
      ... See the example at http://vim.wikia.com/wiki/Filetype.vim Sorry it s a bit hard to follow, but where it says: au! BufNewFile,BufRead *.csv setf csv you
      Message 2 of 3 , Jul 17, 2014
      • 0 Attachment
        Carfield Yim wrote:
        > Hi, I need to use vim to edit config files for Visual Studio
        > project a lot, all the config file are XML but edit with
        > *.conf. How can I config vim to use XML syntax highlighter for
        > all *.conf file?

        See the example at
        http://vim.wikia.com/wiki/Filetype.vim

        Sorry it's a bit hard to follow, but where it says:

        au! BufNewFile,BufRead *.csv setf csv

        you need:

        au! BufNewFile,BufRead *.conf setf xml

        John


        --
        --
        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/d/optout.
      • Paul Isambert
        ... See “:help new-filetype”. You must do something like: au BufNewFile,BufRead *.conf set filetype=xml and save that in e.g.
        Message 3 of 3 , Jul 17, 2014
        • 0 Attachment
          Le jeudi 17 juillet 2014 à 11:45, Carfield Yim a écrit:
          > Hi, I need to use vim to edit config files for Visual Studio project
          > a lot, all the config file are XML but edit with *.conf. How can I
          > config vim to use XML syntax highlighter for all *.conf file?

          See “:help new-filetype”. You must do something like:

          au BufNewFile,BufRead *.conf set filetype=xml

          and save that in e.g. $HOME/.vim/ftdetect/filetype.vim.

          Best,
          Paul

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