Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RestructuredText/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
2 changes: 0 additions & 2 deletions RestructuredText/Comments.tmPreferences
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Miscellaneous</string>
<key>scope</key>
<string>text.restructuredtext</string>
<key>settings</key>
Expand Down
143 changes: 143 additions & 0 deletions RestructuredText/Default.sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
[
// {
// "keys": ["ctrl+alt+l"],
// "command": "restructuredtext_encapsulate_literal",
// "context":
// [
// { "key": "selector", "operand": "text.restructuredtext"},
// { "key": "selection_empty", "operand": false, "match_all": true },
// ]
// },

// {
// "keys": ["ctrl+alt+t"],
// "command": "restructuredtext_encapsulate_interpreted_text_role",
// "args": {
// "role_name": "term"
// },
// "context":
// [
// { "key": "selector", "operand": "text.restructuredtext"},
// { "key": "selection_empty", "operand": false, "match_all": true },
// ]
// },

// Auto-pair asterisks
{
"keys": ["*"],
"command": "insert_snippet",
"args": {"contents": "*${0:$SELECTION}*"},
"context": [
{ "key": "setting.auto_match_enabled"},
{ "key": "selection_empty", "operand": false, "match_all": true },
{ "key": "selector", "operand": "text.restructuredtext - markup.raw" }
]
},
{
"keys": ["backspace"],
"command": "run_macro_file",
"args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"},
"context": [
{ "key": "setting.auto_match_enabled" },
{ "key": "selection_empty", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text.restructuredtext - markup.raw" },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\*$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\*", "match_all": true }
]
},

// Auto-pair colon
{
"keys": [":"],
"command": "insert_snippet",
"args": {"contents": ":${0:$SELECTION}:"},
"context": [
{ "key": "setting.auto_match_enabled"},
{ "key": "selection_empty", "operand": false, "match_all": true },
{ "key": "selector", "operand": "text.restructuredtext - markup.raw" }
]
},
{
"keys": ["backspace"],
"command": "run_macro_file",
"args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"},
"context": [
{ "key": "setting.auto_match_enabled" },
{ "key": "selection_empty", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text.restructuredtext - markup.raw" },
{ "key": "preceding_text", "operator": "regex_contains", "operand": ":$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^:", "match_all": true }
]
},

// Auto-pair underscore
{
"keys": ["_"],
"command": "insert_snippet",
"args": {"contents": "_${0:$SELECTION}_"},
"context": [
{ "key": "setting.auto_match_enabled"},
{ "key": "selection_empty", "operand": false, "match_all": true },
{ "key": "selector", "operand": "text.restructuredtext - markup.raw" }
]
},
{
"keys": ["backspace"],
"command": "run_macro_file",
"args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"},
"context": [
{ "key": "setting.auto_match_enabled" },
{ "key": "selection_empty", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "text.restructuredtext - markup.raw" },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "_$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^_", "match_all": true }
]
},

// Auto-pair backticks
{
"keys": ["`"],
"command": "insert_snippet",
"args": {"contents": "`$0`"},
"context": [
{ "key": "setting.auto_match_enabled"},
{ "key": "selection_empty", "match_all": true },
{ "key": "selector", "operand": "text.restructuredtext - markup.raw - text.restructuredtext.embedded" },
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\\w`]$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|\\.|,|$)", "match_all": true }
]
},
{
"keys": ["`"],
"command": "insert_snippet",
"args": {"contents": "`${0:$SELECTION}`"},
"context": [
{ "key": "setting.auto_match_enabled"},
{ "key": "selection_empty", "operand": false, "match_all": true },
{ "key": "selector", "operand": "text.restructuredtext - markup.raw - text.restructuredtext.embedded" }
]
},
{
"keys": ["`"],
"command": "move",
"args": {"by": "characters", "forward": true},
"context": [
{ "key": "setting.auto_match_enabled" },
{ "key": "selection_empty", "operand": true, "match_all": true },
{ "key": "selector", "operand": "text.restructuredtext markup.raw.inline - markup.raw.block - text.restructuredtext.embedded" },
{ "key": "following_text", "operator": "regex_contains", "operand": "^`", "match_all": true }
]
},
{
"keys": ["backspace"],
"command": "run_macro_file",
"args": {"file": "res://Packages/Default/Delete Left Right.sublime-macro"},
"context": [
{ "key": "setting.auto_match_enabled" },
{ "key": "selection_empty", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "punctuation.definition.raw.begin.restructuredtext" },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "`$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^`", "match_all": true }
]
}
]
107 changes: 107 additions & 0 deletions RestructuredText/Fold.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>text.restructuredtext</string>
<key>settings</key>
<dict>
<key>foldScopes</key>
<array>
<dict>
<key>begin</key>
<string>punctuation.section.block.begin</string>
<key>end</key>
<string>punctuation.section.block.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.definition.generic.begin</string>
<key>end</key>
<string>punctuation.definition.generic.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.definition.constant.begin</string>
<key>end</key>
<string>punctuation.definition.constant.end</string>
</dict>
<dict>
<key>begin</key>
<string>meta.fold.raw-code-directive.begin</string>
<key>end</key>
<string>meta.fold.raw-code-directive.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.definition.substitution.begin</string>
<key>end</key>
<string>punctuation.definition.substitution.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.definition.bold.begin</string>
<key>end</key>
<string>punctuation.definition.bold.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.definition.italic.begin</string>
<key>end</key>
<string>punctuation.definition.italic.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.definition.raw.begin</string>
<key>end</key>
<string>punctuation.definition.raw.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.definition.link.begin</string>
<key>end</key>
<string>punctuation.definition.link.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.definition.location.begin</string>
<key>end</key>
<string>punctuation.definition.location.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.definition.markup-interpreted.begin</string>
<key>end</key>
<string>punctuation.definition.markup-interpreted.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.definition.footnote-reference.begin</string>
<key>end</key>
<string>punctuation.definition.footnote-reference.end</string>
</dict>
<!--
<dict>
<key>begin</key>
<string>punctuation.section.braces.begin</string>
<key>end</key>
<string>punctuation.section.braces.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.section.brackets.begin</string>
<key>end</key>
<string>punctuation.section.brackets.end</string>
</dict>
<dict>
<key>begin</key>
<string>punctuation.section.group.begin</string>
<key>end</key>
<string>punctuation.section.group.end</string>
</dict>
-->
</array>
<key>indentationFoldingEnabled</key>
<false/>
</dict>
</dict>
</plist>
112 changes: 112 additions & 0 deletions RestructuredText/Main.sublime-menu
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
[
{
"id": "preferences",
"children":
[
{
"caption": "Package Settings",
"id": "package-settings",
"children":
[
{
"caption": "reStructuredText (reST)",
"children":
[
{
"caption": "Docutils ∙ Reference ∙ Introduction",
"command": "open_url",
"args": { "url": "https://docutils.sourceforge.io/docs/ref/rst/introduction.html" }
},
{
"caption": "Docutils ∙ Reference ∙ Markup Specification",
"command": "open_url",
"args": { "url": "https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html" }
},
{
"caption": "Docutils ∙ Reference ∙ Markup Specification ∙ Tables",
"command": "open_url",
"args": { "url": "https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#tables" }
},
{
"caption": "Docutils ∙ Reference ∙ Markup Specification ∙ Substitution References",
"command": "open_url",
"args": { "url": "https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#substitution-references" }
},
{
"caption": "Docutils ∙ Reference ∙ Directives",
"command": "open_url",
"args": { "url": "https://docutils.sourceforge.io/docs/ref/rst/directives.html" }
},
{
"caption": "Docutils ∙ Reference ∙ Interpreted Text Roles",
"command": "open_url",
"args": { "url": "https://docutils.sourceforge.io/docs/ref/rst/roles.html" }
},
{
"caption": "Docutils ∙ User ∙ Quickstart",
"command": "open_url",
"args": { "url": "https://docutils.sourceforge.io/docs/user/rst/quickstart.html" }
},
{
"caption": "Docutils ∙ User ∙ Examples",
"command": "open_url",
"args": { "url": "https://docutils.sourceforge.io/docs/user/rst/demo.html" }
},
{
"caption": "Docutils ∙ User ∙ Quick Reference",
"command": "open_url",
"args": { "url": "https://docutils.sourceforge.io/docs/user/rst/quickref.html" }
},
{ "caption": "-" },
{
"caption": "Sphinx ∙ Command Line Tools",
"command": "open_url",
"args": { "url": "https://www.sphinx-doc.org/en/master/man/index.html" }
},
{
"caption": "Sphinx ∙ 'sphinx-build' Command Line",
"command": "open_url",
"args": { "url": "https://www.sphinx-doc.org/en/master/man/sphinx-build.html" }
},
{
"caption": "Sphinx ∙ Documentation",
"command": "open_url",
"args": { "url": "https://www.sphinx-doc.org/en/master/" }
},
{
"caption": "Sphinx ∙ Usage ∙ Configuration",
"command": "open_url",
"args": { "url": "https://www.sphinx-doc.org/en/master/usage/configuration.html" }
},
{
"caption": "Sphinx ∙ Usage ∙ reST ∙ Directives",
"command": "open_url",
"args": { "url": "https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html" }
},
{
"caption": "Sphinx ∙ Usage ∙ reST ∙ Directives ∙ Admonitions",
"command": "open_url",
"args": { "url": "https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#admonitions-messages-and-warnings" }
},
{
"caption": "Sphinx ∙ Usage ∙ Referencing",
"command": "open_url",
"args": { "url": "https://www.sphinx-doc.org/en/master/usage/referencing.html" }
},
{
"caption": "Sphinx ∙ Usage ∙ reST ∙ Interpreted Text Roles",
"command": "open_url",
"args": { "url": "https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html" }
},
{
"caption": "Sphinx ∙ Glossary",
"command": "open_url",
"args": { "url": "https://www.sphinx-doc.org/en/master/glossary.html" }
}
]
}
]
}
]
}
]
19 changes: 19 additions & 0 deletions RestructuredText/Symbol List - Citations.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<!--
https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#implicit-hyperlink-targets
-->
<key>scope</key>
<string><![CDATA[
meta.link.citation.def.restructuredtext constant.other.citation.link.restructuredtext - punctuation
]]></string>
<key>settings</key>
<dict>
<key>showInIndexedSymbolList</key>
<integer>0</integer>
<key>showInSymbolList</key>
<integer>1</integer>
</dict>
</dict>
</plist>
Loading