From b5474ac3fa754d3e0ec54e916c36ee81b439c0b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Zanghelini?= Date: Sat, 8 Aug 2020 02:20:42 -0300 Subject: [PATCH] Auto-pair single quotes on selections --- Default.sublime-keymap | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Default.sublime-keymap b/Default.sublime-keymap index 337e78b2..7889d20d 100644 --- a/Default.sublime-keymap +++ b/Default.sublime-keymap @@ -3,6 +3,14 @@ { "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'"}, "context": [{ "key": "selector", "operator": "equal", "operand": "source.rust" }] }, + // auto-pair single quotes on selections. + { "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'${0:$SELECTION}'"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "source.rust" }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true } + ] + }, // ' in b'c' will skip past the end quote. { "keys": ["'"], "command": "move", "args": {"by": "characters", "forward": true}, "context": [