2

I have to use a very specific software with its own syntax and file format: .htc.

I have been supplied a .xml and .lang that can be used for Notepad++ and gedit to support syntax highlighting but no such file for Vim.

Is there a way I can convert/import this to VIM?

  • Unfortunately this answer might be a bad news for you. TL;DR version: Vim syntax file are very specifics to vim and relies on vimscript language so it's really a pain to convert or import from another editor. – statox Sep 11 '15 at 14:01
  • 1
    It's often not that difficult to program basic syntax highlighting for most file types. – Martin Tournoij Sep 11 '15 at 15:25
  • I'm not sure if my comment was clear: the pain I was talking about was from the "automatic" conversion, not from writing the file manually from scratch which is as Carpetsmoker said pretty accessible. – statox Sep 11 '15 at 15:59
  • @statox et al, It would be wonderful if you guys could "answer" an example of a syntax in both formats... – JJoao Sep 30 '15 at 16:12
2

Note 1: In the comments OP requested examples of syntax files in both formats, so this is not a complete answer but maybe some elements which could be useful to have in mind.

Note 2: My knowledge of Notepad++ is pretty limited so as said in the Note1 let's hope that someone with a deeper knowledge will see this post and make a better answer.

First to answer the question, as said here it seems that there is no existing tool able to automatically convert a Notepad++ language file to Vim syntax file. The main reason is that the vim syntax files use some very specific mechanisms which don't have equivalents in Notepad++. Hence translating a file might be much longer than writing one from scratch.

Here are some resources which might be useful:

I think it is possible to get the keywords on the Notepad++ file to create a basic Vim file.

Once again this answer is not complete at all and really doesn't solve the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.