If I use node name in ASCII, I have a nice view:
but if I use Unicode node name it is not pretty:
How can I fix this?
If I use node name in ASCII, I have a nice view:
but if I use Unicode node name it is not pretty:
How can I fix this?
Copyright © 2021 Jogjafile Inc.
Background
The XML syntax highlighting language definition that ships with Sublime Text 2/3 does not recognize non-ASCII tags:
Note: The Neon Color Scheme is used for syntax highlighting
However, replacing it with the file in this gist fixes that problem, along with a few minor things:
How to install
Sublime Text 2
In Sublime, open a new file and paste in the contents of the gist. Save the file to your Desktop as
XML.tmLanguage
. Open yourPackages
folder by selectingPreferences → Browse Packages…
, then close Sublime. Scroll down to theXML
folder and renameXML.tmLanguage
asXML.tmLanguage.old
. If it exists, deleteXML.tmLanguage.cache
. Now, copy the newXML.tmLanguage
from your Desktop toPackages/XML
. The next time you open an XML file in Sublime, it will use the new syntax.Sublime Text 3 Build <= 3083 (public beta)
In Sublime, open a new file and paste in the contents of the gist. Save the file to your Desktop as
XML.tmLanguage
. Open yourPackages
folder by selectingPreferences → Browse Packages…
, then close Sublime. Create a new folder inPackages
namedXML
and copy the newXML.tmLanguage
from your Desktop toPackages/XML
. The next time you open an XML file in Sublime, it will use the new syntax.Sublime Text 3 Build > 3083 (dev builds)
In Sublime, open a new file and paste in the contents of the gist. Save the file to your Desktop as
XML.tmLanguage
. Create another new file in Sublime with the following contents:Save this file to your Desktop as
XML.sublime-syntax
. Open yourPackages
folder by selectingPreferences → Browse Packages…
, then close Sublime. Create a new folder inPackages
namedXML
and copy the newXML.tmLanguage
andXML.sublime-syntax
files from your Desktop toPackages/XML
. The next time you open an XML file in Sublime, it will use the new syntax. There will be a new entry in the syntax menu calledXML-ss
(for sublime-syntax), just ignore it.How it works
Sublime Text 2
Here, we simply replace the old language definition (
.tmLanguage
file) with the new one.Sublime Text 3
In Sublime Text 3, the default packages (and many that you install with Package Control) are stored in a separate directory as zipped
.sublime-package
files. However, if you create a folder and file in thePackages
folder with the same name as a package (XML
in this case) and file contained within it, the version inPackages
will override the version in thesublime-package
archive. For ST3 builds 3083 and before, the same XML-based.tmLanguage
format as ST2 was used.However, starting with dev build 3084 and beyond, a new YAML-based
.sublime-syntax
format was introduced, and all of the default syntax definitions were converted. The.tmLanguage
format is still supported, however, but we needed to override theXML/XML.sublime-syntax
file first in order for our new.tmLanguage
file to be used.