Newer
Older
moodlog_sublime / moodlog.sublime-syntax
%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:
    - include: hashtags

    - 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: context
      scope: comment.block.moodlogtxt.context

    - match: (^\#\S+)|(\s\#\S+)
      comment: hashtag
      scope: variable.function

    - match: (^\+\S+)|(\s\+\S+)
      comment: positive
      scope: entity.name.class.moodlogtxt.project

    - match: (^\-\S+)|(\s\-\S+)
      comment: negative
      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