Home  >  Q&A  >  body text

vim opens the file in the specified syntax coloring format, or the file has been opened and the syntax format needs to be specified.

When opening the resin configuration file, I hope to use xml format to color the file. However, since the configuration file suffix on the server is conf, vim does not have syntax highlighting. Is there any way to specify the xml format syntax to open the file? document?

Supplement:
The current method is to copy the configuration file and change the suffix to xml to view. But I want to know if there is a less troublesome way?

天蓬老师天蓬老师2734 days ago788

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-05-16 16:40:28

    Use :setf xml:setfiletype xml (complete)

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 16:40:28

    au BufNewFile,BufRead *.conf set syntax=xml
    
    

    reply
    0
  • 迷茫

    迷茫2017-05-16 16:40:28

    I recommend sublime text2 instead of VIM

    reply
    0
  • Cancelreply