Skip to content

Commit

Permalink
Add auto_complete triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
bordaigorl committed Mar 21, 2014
1 parent a36db96 commit 08b4635
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
29 changes: 29 additions & 0 deletions Default (Linux).sublime-keymap
@@ -0,0 +1,29 @@
[
{ "keys": [","], "command": "run_macro_file", "args":{"file": "Packages/Evernote/EvernoteAutoTags.sublime-macro"}, "context":
[
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*tags\\s*:.*$", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "meta.metadata.evernote - meta.structure.array", "match_all": true },
{ "key": "selector", "operator": "not_equal", "operand": "markup.raw", "match_all": true }
]
},
{ "keys": [" "], "command": "auto_complete", "context":
[
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*tags\\s*:\\s*$", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "meta.metadata.evernote - meta.structure.array", "match_all": true },
{ "key": "selector", "operator": "not_equal", "operand": "markup.raw", "match_all": true }
]
},
{ "keys": [","], "command": "run_macro_file", "args":{"file": "Packages/Evernote/EvernoteAutoTagsQuoted.sublime-macro"}, "context":
[
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^\\s*tags\\s*:.*$", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted", "match_all": true },
{ "key": "selector", "operator": "equal", "operand": "meta.metadata.evernote meta.structure.array", "match_all": true },
{ "key": "selector", "operator": "not_equal", "operand": "markup.raw", "match_all": true }
]
},
]
4 changes: 4 additions & 0 deletions EvernoteAutoTags.sublime-macro
@@ -0,0 +1,4 @@
[
{"command": "insert", "args": {"characters": ", "}},
{"command": "auto_complete"}
]
4 changes: 4 additions & 0 deletions EvernoteAutoTagsQuoted.sublime-macro
@@ -0,0 +1,4 @@
[
{"command": "insert_snippet", "args": {"contents": ", \"$1\"$0"}},
{"command": "auto_complete"}
]
2 changes: 1 addition & 1 deletion sublime_evernote.py
Expand Up @@ -145,7 +145,7 @@ def load_settings(self):
EvernoteDo.MD_EXTRAS['inline-css'] = css
self.md_syntax = self.settings.get("md_syntax")
if not self.md_syntax:
self.md_syntax = find_syntax("Markdown")
self.md_syntax = find_syntax("Evernote")

def message(self, msg):
sublime.status_message(msg)
Expand Down

0 comments on commit 08b4635

Please sign in to comment.