Line 1: Line 1:
 
+
== Hotkeys Binding ==
 
+
=== Tag Wrapping ===
== Новые горячии клавиши ==
+
Go to "preferences -> key binding (user)"
 
+
Например,
+
 
+
=== оборачивание тегом math ===
+
 
+
preferences - key binding (user)
+
  
 
  [
 
  [
Line 13: Line 7:
 
  ]
 
  ]
  
Packages/mediawiki/math-tag.sublime-snippet:
+
Create `Packages/mediawiki/math-tag.sublime-snippet`:
  
 
  <snippet>
 
  <snippet>
Line 20: Line 14:
 
     <description>Math Tag</description>
 
     <description>Math Tag</description>
 
  </snippet>
 
  </snippet>
 +
 +
 +
You don't need to create an XML file, and can pass arguments directly to snippets: [https://www.sublimetext.com/forum/viewtopic.php?f=6&t=2314]
 +
 +
<pre>
 +
[
 +
  {"keys": ["alt+q"], "command": "insert_snippet", "args": {"contents": "&lt;code>${0:$TM_SELECTED_TEXT}&lt;/code&gt;"}},
 +
  {"keys": ["alt+w"], "command": "insert_snippet", "args": {"contents": "&lt;pre>${0:$TM_SELECTED_TEXT}&lt;/pre&gt;"}}
 +
]
 +
</pre>
 +
 +
 +
 +
 +
[[Category:Snippets]]

Revision as of 13:44, 16 November 2015

Hotkeys Binding

Tag Wrapping

Go to "preferences -> key binding (user)"

[
 { "keys": ["alt+shift+m"], "command": "insert_snippet", "args": { "name": "Packages/mediawiki/math-tag.sublime-snippet" } }
]

Create `Packages/mediawiki/math-tag.sublime-snippet`:

<snippet>
    <content><![CDATA[<math>${2:$SELECTION}</math>]]></content>
    <scope>math</scope>
    <description>Math Tag</description>
</snippet>


You don't need to create an XML file, and can pass arguments directly to snippets: [1]

[
  {"keys": ["alt+q"], "command": "insert_snippet", "args": {"contents": "<code>${0:$TM_SELECTED_TEXT}</code>"}},
  {"keys": ["alt+w"], "command": "insert_snippet", "args": {"contents": "<pre>${0:$TM_SELECTED_TEXT}</pre>"}}
]