Similar to Jonno's answer above, you can modify the keymap settings for a given package in the same way:
Create a Default.sublime-keymap
file in the LaTeX directory (create folders if needed):
Windows:
%APPDATA%\Sublime Text 3\Packages\LaTeX\Default.sublime-keymap
macOS:
~/Library/Application Support/Sublime Text 3/Packages/LaTeX/Default.sublime-keymap
Linux:
~/.config/sublime-text-3/Packages/LaTeX/Default.sublime-keymap
You can then copy & paste the default keymap (Preferences -> Key Bindings - Default
) settings for double quotes into this new file. Then I modified the actions of those key bindings to no longer insert quoted pairs. This is the result of my changes:
[
// changed snippet arg contents from `"\"$0\""` to `"\""` to prevent inserting paired quotes
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\""}, "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.double - punctuation.definition.string.end", "match_all": true }
]
},
// changed the command and args from `move` to the same command/args as above to prevent skipping auto-inserted quotes
{ "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\""}, "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": "^\"", "match_all": true },
{ "key": "selector", "operator": "not_equal", "operand": "punctuation.definition.string.begin", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double - punctuation.definition.string.end", "match_all": true },
]
}
]
Notes:
- I did not change the
backspace
operator (seen in the default keymap) when surrounded by quotes. I'm not exactly sure how to fix or if the behavior is incorrect or not
- Your default keybindings may be different than mine, feel free to make the same changes I described in comments above
- I imagine you can remove the entire
context
section and it work, but I did not try that out myself.