Sublime Forum

Struggling to remap tab to "indent" in all file types except html

#1

Hi,

I would like the tab key to do its usual thing in html, but in all other file types to trigger the indent command. I tried this but it fails:

{ "keys": ["tab"], "command": "indent", "context": [
    { "key": "selector", "operator": "not equal", "operand": "(text.html, text.xml)" }
]},

Can someone point me in the right direction? Thanks.

0 Likes

#2

did you try not_equal with an underscore, instead of with a space?

0 Likes

#3

OK I feel silly. Yes this worked.

Btw I was under the maybe false impression that typing div.red + tab would complete to <div class="red"></div> in html. But it seems not to work. Am I misremembering, and the former completion just an Emmet thing?

If so, is there some “lightweight” version of Emmet that would offer those kinds of simple completions? (Emmet seems not to work in very large files and I work with very large files.)

0 Likes

#4

div.red Tab works for me with the standard HTML package

0 Likes

#5

Thanks I fixed it. I had tab_completion set to false in my preferences.

(Curiously it was still completing things like

<div + tab

to

<div></div>

though. But not

div+tab

to

<div></div>

somehow.)

Thanks!

0 Likes