Sublime Forum

[solved] xml auto formatting problem

#1

In the default XML bundle, whenever you write something and press tab, it creates a node with that word.

My problem is that it interferes with every snippet I create, and can’t jump to the next tab position ($1, $2, $3, etc) without creating a new unwanted xml node.

I’ve looked into the snippets of the default bundle but haven’t found a way to change this behavior…

I’m really annoyed by the fact that not only it creates a new node, it also puts 3 line breaks.

How can I change that?

TIA

0 Likes

Change the trigger for Zen coding
#2

bump

0 Likes

#3

BUMP

Can anyone tell me how to change the xml bundle so that it does NOT make a new node with 3 lines everytime I press TAB ?

myNode + TAB produces:

[code]

[/code]

How can I change that?

0 Likes

#4

bump

This is stil giving me problems…

How can I completely override the default XMl package snippets?

0 Likes

#5

This behaviour might be from a plug-in such as ZenCoding. If it is from an XML snippet then try removing these snippets from your Packages folder.

0 Likes

#6

You are absolutely and totally right.

I disabled Zen Coding and now everything works as expected. I would have never guessed the problem was not in the XML package… sorry for being such a sublime text ignorant.

I’ve searched if there was some config file in the Zen Coding folder, but couldn’t find anything. Again, I may have missed something very obvious.

Is there a way to disable Zen Coding for XML files?

0 Likes

#7

SOLVED!!!

So I edited the file Default.sublime-keymap in Zen Coding folder, and removed text.xml and text.xsl from this portion.

[code]{
“keys”: “tab”], “command”: “expand_zen_abbreviation_on_tab”, “context”:

	{ "key": "selector", "operator": "equal", "operand": "source.css - source.css.embedded, text.html -source -meta.tag, meta.scope.between-tag-pair.html -source", "match_all": true },
	{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
	{ "key": "is_zen", "match_all": true },
	{ "key": "setting.zen_keybinds", "operator": "equal", "operand": true }
]

}[/code]

Thank you AGibson!!

0 Likes