Skip to content

Commit 4c38f6d

Browse files
committed
Add snippet for inserting a code block.
Tab trigger: <kbd>`⇥</kbd> (that is, a single backtick and then pressing the tab key). Note that typing a single backtick will insert two backticks (with the cursor in between), because the Markdown bundle defines an appropriate smart typing pair. This is why the snippet inserts only two backticks at the end of the code block: Together with the backtick already inserted by the smart typing pair this gives three backticks at the end. The snippet shows a completion list for specifying the language of the code block. The list of supported languages was extracted from the bundle’s grammar. If at some point in the future more languages are added to the grammar, these languages should be added to the completion list as well.
1 parent 8e97796 commit 4c38f6d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Snippets/Code block.tmSnippet

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>content</key>
6+
<string>\`\`\`${1|bash,bib,c,c#,c++,cpp,csharp,css,go,html,inc,java,javascript,jruby,js,latex,macruby,node,php,python,rake,rb,rbx,ruby,rusthon,sh,shell,swift,tex,xhtml,zsh|}
7+
$0
8+
\`\`</string>
9+
<key>name</key>
10+
<string>Insert Code Block</string>
11+
<key>tabTrigger</key>
12+
<string>`</string>
13+
<key>uuid</key>
14+
<string>801405C3-C14D-4C1D-8353-AF6A54FED3D8</string>
15+
</dict>
16+
</plist>

0 commit comments

Comments
 (0)