Sublime Forum

Disable auto completion for quotes and brackets *solved*

#1

Someone knows a setting without disable the whole auto complete feature? i have to open and close the tags myself.

This editor is still epic, thanks

1 Like

#2

You can set the auto_complete to false in Preferences.sublime-settings -- User to completely disable auto complete.

0 Likes

#3

default keybindings have

	// Auto-pair single quotes
	{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'"}, "context":
		[
			{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
			{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
			{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
			{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true },
			{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single - punctuation.definition.string.end", "match_all": true }
		]
	},

so you can set auto_match_enabled to false to disable it.

0 Likes

#4

does not work for me

    // Auto-pair single quotes
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'"}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": false }
    ]
},
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'${0:$SELECTION}'"}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": false }
    ]
},
{ "keys": ["'"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": false }
    ]
},    
// Auto-pair brackets
{ "keys": ["("], "command": "insert_snippet", "args": {"contents": "($0)"}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": false }
    ]
},
{ "keys": ["("], "command": "insert_snippet", "args": {"contents": "(${0:$SELECTION})"}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": false }
    ]
},
{ "keys": [")"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": false },            
    ]
},
// Auto-pair square brackets
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[$0]"}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": false }
    ]
},
{ "keys": ["["], "command": "insert_snippet", "args": {"contents": "[${0:$SELECTION}]"}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": false }
    ]
},
{ "keys": ["]"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
    [
        { "key": "setting.auto_match_enabled", "operator": "equal", "operand": false }
    ]
},
0 Likes

#5

What I mean is set auto_match_enabled in your preferences.

2 Likes

#6
{
	"auto_close_tags": false,
	"color_scheme": "Packages/Color Scheme - Default/Monokai.sublime-color-scheme",
	"font_size": 10,
	"ignored_packages":
	[
		"Vintage"
	],
	"show_git_status": false,
	"tab_completion": false,
	"tab_size": 4,
	"theme": "Default.sublime-theme",
	"translate_tabs_to_spaces": true,
	"scroll_speed": 1.0,
	"highlight_line": true,
	"drag_text": false,
	"highlight_modified_tabs": true,
	"auto_match_enabled": false
}

does not work, you got an working example?

0 Likes

#7

Yes, that’s what I mean. But if it’s not working then I have no idea. That’s deduced from the context in the keybindings.

1 Like

#8

Hey, i got it. With my first try in key bindings, the feature was defect. After reverting my key bindings and set auto_match_enabled to false in settings file, it works as expected. Thank you so much!

1 Like

#9

add this line to
preferences.setttings,
“auto_match_enabled”: false,

0 Likes