Home Download Buy Blog Forum Support

CSS tab completion can't disable

CSS tab completion can't disable

Postby soggie on Wed Aug 17, 2011 4:54 pm

I can't disable tab completion. I absolutely hate tab completion and am desperate to get rid of it. I'm currently using a trial version of sublime text 2.

I added this to Preferences > File Settings, User:

Code: Select all
{
   'tab_completion' : false
}


And then in my CSS, I typed: color, and pressed tab. A dialog pops out giving me a list to choose from, but I don't want any. I just want to tab, not autocomplete! How do I disable it for good, or is this a bug?
soggie
 
Posts: 2
Joined: Wed Aug 17, 2011 4:50 pm

Re: CSS tab completion can't disable

Postby adzenith on Wed Aug 17, 2011 9:41 pm

What you're seeing here are snippets, which are different from tab-completion—tab-completion completes tokens by looking at other tokens in the file, whereas snippets are predefined for different languages and add chunks of code based on the tab-trigger.
Add this to your user key bindings and you should be good to go in all cases:
Code: Select all
  { "keys": ["tab"], "command": "insert", "args": {"characters": "\t"} }

It will overwrite all other bindings of the tab key.
adzenith
 
Posts: 1213
Joined: Mon Oct 19, 2009 9:12 pm

Re: CSS tab completion can't disable

Postby adzenith on Wed Aug 17, 2011 10:23 pm

It occurs to me that you may still want to use the tab key to indent selected text; in such a case, you can copy the relevant bindings from the default key bindings file into your user keybindings file—just put them after the previous line I sent you. That command, which takes no context argument, will wipe out all other bindings. Further bindings with a context argument will be layered on top of the most recent context-free keybinding.
adzenith
 
Posts: 1213
Joined: Mon Oct 19, 2009 9:12 pm

Re: CSS tab completion can't disable

Postby soggie on Thu Aug 18, 2011 12:27 am

That does the trick for me. Thanks a lot! I'm ready to get a license now. :)

I didn't add in the part for indents, because I can always revert to command + [ and ] to do highlight indents.

EDIT: I added it and doesn't seem to work for me when I do single line indents (select a whole line that doesn't have a line ending, and press tab). I think it's because of the regex "\n" part.

Code: Select all
[
    { "keys": ["tab"], "command": "insert", "args": {"characters": "\t"} },
    { "keys": ["tab"], "command": "reindent", "context":
        [
            { "key": "setting.auto_indent", "operator": "equal", "operand": true },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
            { "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
        ]
    },
    { "keys": ["tab"], "command": "indent", "context":
        [
            { "key": "text", "operator": "regex_contains", "operand": "\n" }
        ]
    },
    { "keys": ["tab"], "command": "next_field", "context":
        [
            { "key": "has_next_field", "operator": "equal", "operand": true }
        ]
    }
]


Changing "\n" to "." works.

YEAHHHHH!!!!!!!!!!!!!!!!!!
soggie
 
Posts: 2
Joined: Wed Aug 17, 2011 4:50 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests