The Computer Oracle

Different language syntax highlighting within same file

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Over a Mysterious Island

--

Chapters
00:00 Different Language Syntax Highlighting Within Same File
00:49 Accepted Answer Score 4
01:27 Answer 2 Score 1
01:57 Answer 3 Score 0
02:16 Thank you

--

Full question
https://superuser.com/questions/235320/d...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#notepad++ #css #syntaxhighlighting

#avk47



ACCEPTED ANSWER

Score 4


I use a program called phpDesigner that highlights PHP, HTML, CSS, JavaScript all separately in the same document. It does code completion for each part, even if you do style="fon...".

I had to move to it since I couldn't find any other program that was so good when working with PHP (and all the other languages it uses at the same time), including Notepad++. The one thing I wish it did was syntax highlight SQL strings within PHP (it does fine with just SQL), but maybe in a future version.




ANSWER 2

Score 1


I recently tried out Sublime Text 2 which did very well with highlighting files which contained multiple languages. In my case, it was only HTML+CSS+JS but I'm sure it would work well with PHP.

The app is not as feature rich as notepad++ but it is much more aesthetically pleasing.

The demo version prompts the user to purchase the license once in a while, but there is no time limit.




ANSWER 3

Score 0


For those who are trying to embed different languages into each other I've found tool that allows such type of configuration: http://www.freescripteditor.org/

I personally needed PHP embedded into SQL (yes, in that order).

Configuration files are human readable, so you can change them with text editor (there's also GUI in program itself).