Skip to content
Open
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
6 changes: 6 additions & 0 deletions Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
},
{ "keys": ["ctrl+alt+v"], "command": "adoc_paste_as_link", "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
}
]
6 changes: 6 additions & 0 deletions Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
},
{ "keys": ["super+alt+v"], "command": "adoc_paste_as_link", "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
}
]
6 changes: 6 additions & 0 deletions Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
},
{ "keys": ["ctrl+alt+v"], "command": "adoc_paste_as_link", "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
}
]
14 changes: 14 additions & 0 deletions adoc_paste_as_link.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import sublime
import sublime_plugin


class AdocPasteAsLinkCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
sel = view.sel()[0]
text = view.substr(sel)
contents = sublime.get_clipboard()
view.replace(edit, sel, "" + contents + "["+text+"]")

def is_enabled(self):
return bool(self.view.sel())