diff --git a/README.md b/README.md index c0f172a..db1d791 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,15 @@ moodlog_sublime =============== -A sublime plugin to give syntax highlighting to moodlog.txt \ No newline at end of file +A sublime plugin to give syntax highlighting to moodlog.txt + +Setup +===== + +simply copy *moodlog.sublime-syntax* to: + +C:\Users\\[your username]\AppData\Roaming\Sublime Text 3\Packages\User\ + +Example +======= +![screenshot](http://swin.es/g/NaN/moodlog_sublime/raw/d2294d3c2f53b69d271d4b1fe8a5ad573a4a6430/moodlog_sublime_example.png) \ No newline at end of file diff --git a/README.md b/README.md index c0f172a..db1d791 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,15 @@ moodlog_sublime =============== -A sublime plugin to give syntax highlighting to moodlog.txt \ No newline at end of file +A sublime plugin to give syntax highlighting to moodlog.txt + +Setup +===== + +simply copy *moodlog.sublime-syntax* to: + +C:\Users\\[your username]\AppData\Roaming\Sublime Text 3\Packages\User\ + +Example +======= +![screenshot](http://swin.es/g/NaN/moodlog_sublime/raw/d2294d3c2f53b69d271d4b1fe8a5ad573a4a6430/moodlog_sublime_example.png) \ No newline at end of file diff --git a/moodlog.sublime-syntax b/moodlog.sublime-syntax new file mode 100755 index 0000000..ee5fc5c --- /dev/null +++ b/moodlog.sublime-syntax @@ -0,0 +1,40 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: moodlogtxt +file_extensions: + - moodlog.txt +scope: text.moodlogtxt +variables: + date: ([1-2]\d{3}[-/\\.](0?[1-9]|1[012])[-/\\.](0[1-9]|[12]\d|3[01])) + time: (?:\s([0-9]|0[0-9]|1[0-9]|2[0-3])\:[0-5][0-9]) + yellow: hsl(54, 100%, 50%) +contexts: + main: + - match: '{{time}}{1,2}' + comment: moodlog time + scope: constant.numeric.moodlogtxt.time + + - match: (^\[\S+)|(\s\[\S+) + comment: Todo item project + scope: string.unquoted.scheduler.config + + - match: (^\@\S+)|(\s\@\S+) + comment: moodlog positive item context + scope: comment.block.moodlogtxt.context + + - match: (^\+\S+)|(\s\+\S+) + comment: Todo item project + scope: entity.name.class.moodlogtxt.project + + - match: (^\-\S+)|(\s\-\S+) + comment: Todo item project + scope: entity.name.tag.moodlogtxt.context + + - match: '{{date}}(?= ){1,2}' + comment: Todo item done or creation date + scope: constant.numeric.moodlogtxt.date + + - match: '(?:[^x])((?!\s([@\+\-])|({{date}})).)+' + comment: Todo item text + scope: entity.task.moodlogtxt \ No newline at end of file diff --git a/README.md b/README.md index c0f172a..db1d791 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,15 @@ moodlog_sublime =============== -A sublime plugin to give syntax highlighting to moodlog.txt \ No newline at end of file +A sublime plugin to give syntax highlighting to moodlog.txt + +Setup +===== + +simply copy *moodlog.sublime-syntax* to: + +C:\Users\\[your username]\AppData\Roaming\Sublime Text 3\Packages\User\ + +Example +======= +![screenshot](http://swin.es/g/NaN/moodlog_sublime/raw/d2294d3c2f53b69d271d4b1fe8a5ad573a4a6430/moodlog_sublime_example.png) \ No newline at end of file diff --git a/moodlog.sublime-syntax b/moodlog.sublime-syntax new file mode 100755 index 0000000..ee5fc5c --- /dev/null +++ b/moodlog.sublime-syntax @@ -0,0 +1,40 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: moodlogtxt +file_extensions: + - moodlog.txt +scope: text.moodlogtxt +variables: + date: ([1-2]\d{3}[-/\\.](0?[1-9]|1[012])[-/\\.](0[1-9]|[12]\d|3[01])) + time: (?:\s([0-9]|0[0-9]|1[0-9]|2[0-3])\:[0-5][0-9]) + yellow: hsl(54, 100%, 50%) +contexts: + main: + - match: '{{time}}{1,2}' + comment: moodlog time + scope: constant.numeric.moodlogtxt.time + + - match: (^\[\S+)|(\s\[\S+) + comment: Todo item project + scope: string.unquoted.scheduler.config + + - match: (^\@\S+)|(\s\@\S+) + comment: moodlog positive item context + scope: comment.block.moodlogtxt.context + + - match: (^\+\S+)|(\s\+\S+) + comment: Todo item project + scope: entity.name.class.moodlogtxt.project + + - match: (^\-\S+)|(\s\-\S+) + comment: Todo item project + scope: entity.name.tag.moodlogtxt.context + + - match: '{{date}}(?= ){1,2}' + comment: Todo item done or creation date + scope: constant.numeric.moodlogtxt.date + + - match: '(?:[^x])((?!\s([@\+\-])|({{date}})).)+' + comment: Todo item text + scope: entity.task.moodlogtxt \ No newline at end of file diff --git a/moodlog_sublime_example.png b/moodlog_sublime_example.png new file mode 100755 index 0000000..fe25949 --- /dev/null +++ b/moodlog_sublime_example.png Binary files differ