Skip to content

Commit fc0d179

Browse files
committed
Refactor snippets
Fixes #1524 This commit... 1. replaces `biblatex_snippet_completions` module by default ST3+ snippets as there's no obvious reason for providing default snippets by a plugin. 2. organizes all existing *.sublime-snippets in snippets/ sub directory 3. converts various *.sublime-completions files to *.sublime-snippet format to recover ST3 behavior in ST4. That's required because ST4 drops completions of which trigger perfectly matches user input in order to ensure real snippets always take precedence. Snippets to cycle through various tags via tab key have been removed as they may cause confusion when triggered directly (fixes #1555). Snippets are generally named by their trigger. Those, which differ only by case are suffixed with `_upr` to support case-insensitive filesystems. Notes: 1. line breaks in scope tag require ST3176+. 2. if no prefix is typed, completion panel shows entries only as of ST4.
1 parent c9ad1fd commit fc0d179

File tree

174 files changed

+783
-387
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+783
-387
lines changed

Beamer.sublime-completions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
{ "trigger": "visible", "contents": "\\visible<${1:+-}>{$2}"},
77
{ "trigger": "only", "contents": "\\only<${1:+-}>{$2}"}
88
]
9-
}
9+
}

Default (Linux).sublime-keymap

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -297,21 +297,21 @@ LaTeX Package keymap for Linux
297297
// Wrap selected text in command or environment
298298
{
299299
"keys": ["ctrl+l","ctrl+c"],
300-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Wrap in command.sublime-snippet" },
300+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/Wrap in command.sublime-snippet" },
301301
"context": [
302302
{ "key": "selector", "operand": "text.tex.latex" }
303303
]
304304
},
305305
{
306306
"keys": ["ctrl+l","ctrl+n"],
307-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Wrap in environment.sublime-snippet" },
307+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/Wrap in environment.sublime-snippet" },
308308
"context": [
309309
{ "key": "selector", "operand": "text.tex.latex" }
310310
]
311311
},
312312
{
313313
"keys": ["ctrl+l","ctrl+n"],
314-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Insert environment.sublime-snippet" },
314+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/Insert environment.sublime-snippet" },
315315
"context": [
316316
{ "key": "selection_empty", "match_all": true },
317317
{ "key": "selector", "operand": "text.tex.latex" }
@@ -336,43 +336,50 @@ LaTeX Package keymap for Linux
336336

337337
// Wrap selected text in emph, bold or underline
338338
{
339-
"keys": ["ctrl+l","ctrl+e"],
340-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text emphasize.sublime-snippet" },
339+
"keys": ["ctrl+l","ctrl+b"],
340+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/bf.sublime-snippet" },
341341
"context": [
342-
{ "key": "selector", "operand": "text.tex.latex" }
342+
{ "key": "selector", "operand": "text.tex.latex - text.tex.latex meta.environment.math" }
343343
]
344344
},
345345
{
346346
"keys": ["ctrl+l","ctrl+b"],
347-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text boldface.sublime-snippet" },
347+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/math/bf.sublime-snippet" },
348348
"context": [
349-
{ "key": "selector", "operand": "text.tex.latex" }
349+
{ "key": "selector", "operand": "text.tex.latex meta.environment.math" }
350350
]
351351
},
352352
{
353-
"keys": ["ctrl+l","ctrl+b"],
354-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Math boldface.sublime-snippet" },
353+
"keys": ["ctrl+l","ctrl+e"],
354+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/em.sublime-snippet" },
355355
"context": [
356-
{ "key": "selector", "operand": "text.tex.latex meta.environment.math" }
356+
{ "key": "selector", "operand": "text.tex.latex" }
357357
]
358358
},
359359
{
360360
"keys": ["ctrl+l","ctrl+s"],
361-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text slanted.sublime-snippet" },
361+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/sl.sublime-snippet" },
362362
"context": [
363-
{ "key": "selector", "operand": "text.tex.latex" }
363+
{ "key": "selector", "operand": "text.tex.latex - text.tex.latex meta.environment.math" }
364364
]
365365
},
366366
{
367-
"keys": ["ctrl+l","ctrl+u"],
368-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text underline.sublime-snippet" },
367+
"keys": ["ctrl+l","ctrl+t"],
368+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/tt.sublime-snippet" },
369369
"context": [
370-
{ "key": "selector", "operand": "text.tex.latex" }
370+
{ "key": "selector", "operand": "text.tex.latex - text.tex.latex meta.environment.math" }
371371
]
372372
},
373373
{
374374
"keys": ["ctrl+l","ctrl+t"],
375-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text monospace.sublime-snippet" },
375+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/math/tt.sublime-snippet" },
376+
"context": [
377+
{ "key": "selector", "operand": "text.tex.latex meta.environment.math" }
378+
]
379+
},
380+
{
381+
"keys": ["ctrl+l","ctrl+u"],
382+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/un.sublime-snippet" },
376383
"context": [
377384
{ "key": "selector", "operand": "text.tex.latex" }
378385
]

Default (OSX).sublime-keymap

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -297,21 +297,21 @@ LaTeX Package keymap for OS X
297297
// Wrap selected text in command or environment
298298
{
299299
"keys": ["super+l","super+c"],
300-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Wrap in command.sublime-snippet" },
300+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/Wrap in command.sublime-snippet" },
301301
"context": [
302302
{ "key": "selector", "operand": "text.tex.latex" }
303303
]
304304
},
305305
{
306306
"keys": ["super+l","super+n"],
307-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Wrap in environment.sublime-snippet" },
307+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/Wrap in environment.sublime-snippet" },
308308
"context": [
309309
{ "key": "selector", "operand": "text.tex.latex" }
310310
]
311311
},
312312
{
313313
"keys": ["super+l","super+n"],
314-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Insert environment.sublime-snippet" },
314+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/Insert environment.sublime-snippet" },
315315
"context": [
316316
{ "key": "selection_empty", "match_all": true },
317317
{ "key": "selector", "operand": "text.tex.latex" }
@@ -336,43 +336,50 @@ LaTeX Package keymap for OS X
336336

337337
// Wrap selected text in emph, bold or underline
338338
{
339-
"keys": ["super+l","super+e"],
340-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text emphasize.sublime-snippet" },
339+
"keys": ["super+l","super+b"],
340+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/bf.sublime-snippet" },
341341
"context": [
342-
{ "key": "selector", "operand": "text.tex.latex" }
342+
{ "key": "selector", "operand": "text.tex.latex - text.tex.latex meta.environment.math" }
343343
]
344344
},
345345
{
346346
"keys": ["super+l","super+b"],
347-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text boldface.sublime-snippet" },
347+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/math/bf.sublime-snippet" },
348348
"context": [
349-
{ "key": "selector", "operand": "text.tex.latex" }
349+
{ "key": "selector", "operand": "text.tex.latex meta.environment.math" }
350350
]
351351
},
352352
{
353-
"keys": ["super+l","super+b"],
354-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Math boldface.sublime-snippet" },
353+
"keys": ["super+l","super+e"],
354+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/em.sublime-snippet" },
355355
"context": [
356-
{ "key": "selector", "operand": "text.tex.latex meta.environment.math" }
356+
{ "key": "selector", "operand": "text.tex.latex" }
357357
]
358358
},
359359
{
360360
"keys": ["super+l","super+s"],
361-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text slanted.sublime-snippet" },
361+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/sl.sublime-snippet" },
362362
"context": [
363-
{ "key": "selector", "operand": "text.tex.latex" }
363+
{ "key": "selector", "operand": "text.tex.latex - text.tex.latex meta.environment.math" }
364364
]
365365
},
366366
{
367-
"keys": ["super+l","super+u"],
368-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text underline.sublime-snippet" },
367+
"keys": ["super+l","super+t"],
368+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/tt.sublime-snippet" },
369369
"context": [
370-
{ "key": "selector", "operand": "text.tex.latex" }
370+
{ "key": "selector", "operand": "text.tex.latex - text.tex.latex meta.environment.math" }
371371
]
372372
},
373373
{
374374
"keys": ["super+l","super+t"],
375-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text monospace.sublime-snippet" },
375+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/math/tt.sublime-snippet" },
376+
"context": [
377+
{ "key": "selector", "operand": "text.tex.latex meta.environment.math" }
378+
]
379+
},
380+
{
381+
"keys": ["super+l","super+u"],
382+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/un.sublime-snippet" },
376383
"context": [
377384
{ "key": "selector", "operand": "text.tex.latex" }
378385
]

Default (Windows).sublime-keymap

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -297,21 +297,21 @@ LaTeX Package keymap for Linux
297297
// Wrap selected text in command or environment
298298
{
299299
"keys": ["ctrl+l","ctrl+c"],
300-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Wrap in command.sublime-snippet" },
300+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/Wrap in command.sublime-snippet" },
301301
"context": [
302302
{ "key": "selector", "operand": "text.tex.latex" }
303303
]
304304
},
305305
{
306306
"keys": ["ctrl+l","ctrl+n"],
307-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Wrap in environment.sublime-snippet" },
307+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/Wrap in environment.sublime-snippet" },
308308
"context": [
309309
{ "key": "selector", "operand": "text.tex.latex" }
310310
]
311311
},
312312
{
313313
"keys": ["ctrl+l","ctrl+n"],
314-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Insert environment.sublime-snippet" },
314+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/Insert environment.sublime-snippet" },
315315
"context": [
316316
{ "key": "selection_empty", "match_all": true },
317317
{ "key": "selector", "operand": "text.tex.latex" }
@@ -336,43 +336,50 @@ LaTeX Package keymap for Linux
336336

337337
// Wrap selected text in emph, bold or underline
338338
{
339-
"keys": ["ctrl+l","ctrl+e"],
340-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text emphasize.sublime-snippet" },
339+
"keys": ["ctrl+l","ctrl+b"],
340+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/bf.sublime-snippet" },
341341
"context": [
342-
{ "key": "selector", "operand": "text.tex.latex" }
342+
{ "key": "selector", "operand": "text.tex.latex - text.tex.latex meta.environment.math" }
343343
]
344344
},
345345
{
346346
"keys": ["ctrl+l","ctrl+b"],
347-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text boldface.sublime-snippet" },
347+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/math/bf.sublime-snippet" },
348348
"context": [
349-
{ "key": "selector", "operand": "text.tex.latex" }
349+
{ "key": "selector", "operand": "text.tex.latex meta.environment.math" }
350350
]
351351
},
352352
{
353-
"keys": ["ctrl+l","ctrl+b"],
354-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Math boldface.sublime-snippet" },
353+
"keys": ["ctrl+l","ctrl+e"],
354+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/em.sublime-snippet" },
355355
"context": [
356-
{ "key": "selector", "operand": "text.tex.latex meta.environment.math" }
356+
{ "key": "selector", "operand": "text.tex.latex" }
357357
]
358358
},
359359
{
360360
"keys": ["ctrl+l","ctrl+s"],
361-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text slanted.sublime-snippet" },
361+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/sl.sublime-snippet" },
362362
"context": [
363-
{ "key": "selector", "operand": "text.tex.latex" }
363+
{ "key": "selector", "operand": "text.tex.latex - text.tex.latex meta.environment.math" }
364364
]
365365
},
366366
{
367-
"keys": ["ctrl+l","ctrl+u"],
368-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text underline.sublime-snippet" },
367+
"keys": ["ctrl+l","ctrl+t"],
368+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/tt.sublime-snippet" },
369369
"context": [
370-
{ "key": "selector", "operand": "text.tex.latex" }
370+
{ "key": "selector", "operand": "text.tex.latex - text.tex.latex meta.environment.math" }
371371
]
372372
},
373373
{
374374
"keys": ["ctrl+l","ctrl+t"],
375-
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/Text monospace.sublime-snippet" },
375+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/math/tt.sublime-snippet" },
376+
"context": [
377+
{ "key": "selector", "operand": "text.tex.latex meta.environment.math" }
378+
]
379+
},
380+
{
381+
"keys": ["ctrl+l","ctrl+u"],
382+
"command": "insert_snippet", "args": { "name":"Packages/LaTeXTools/snippets/latex/un.sublime-snippet" },
376383
"context": [
377384
{ "key": "selector", "operand": "text.tex.latex" }
378385
]

0 commit comments

Comments
 (0)