I am giving Sublime Text 2 a try and I was editing an XML file - that had a DOCTYPE
declaration and a DTD - and there seems to be no way to get code hinting / completion when editing the XML document.
I am sure its something simple I am overlooking. I cannot imagine Sublime does not have this kind of functionality, even if provided via a plugin.
Can someone shed some light on this for me?
SublimeText Indent pluginIt is smart enough to recognize XML or JSON even if you are editing plain text.
Usage. By default, Sublime Text will automatically show the completions popup when a user is editing source code or markup, but not within prose in comments, strings or markups. Pressing the Esc key will hide the completions popup. To manually show the completions popup, press Ctrl+Space.
Open any XML file, or create a new file and paste any XML into it. Ctrl-K, F to indent it.
In the Sublime menu go to Preferences > Package Settings > All Autocomplete > Settings – User.
Sublime Text is first and foremost a text editor. But, the reason for it's popularity is in large part due to it's extensibility.
Although you could use Sublime's api to create a specific plug-in to do this, Sublime has a few tools that are already helpful in editing xml files and other markup files on a bare install.
Hinting and completions in particular are very easy to add. It shouldn't take a more than few minutes to create a domain specific sublime-completions file for your particular xml. You can use alt+shift+w to create an xml element, in addition alt+. will close any un-closed xml element.
You may also want to try the Sublime Tag plug-in available through Package Control
Lastly you could also bring this up in the Sublime forums as a plug-in request. There are a lot of helpful folks in the plug-in community.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With