<commit_before>from dragonfly import (Grammar, AppContext, MappingRule, Dictation,
                       Key, Text, FocusWindow, IntegerRef, Choice)
from dragonglue import LinuxAppContext


#---------------------------------------------------------------------------
# Create this module's grammar and the context under which it'll be active.

context = LinuxAppContext(executable='sublime_text')
grammar = Grammar("sublime text", context=context)


#---------------------------------------------------------------------------
# Create a mapping rule which maps things you can say to actions.
#
# Note the relationship between the *mapping* and *extras* keyword
#  arguments.  The extras is a list of Dragonfly elements which are
#  available to be used in the specs of the mapping.  In this example
#  the Dictation("text")* extra makes it possible to use "<text>"
#  within a mapping spec and "%(text)s" within the associated action.

example_rule = MappingRule(
    name="sublime text",    # The name of the rule.
    mapping={
        'close [(file | tab)]': Key('c-w'),
        'file new': Key('c-n'),
        'open [file]': Key('c-o'),
        'save [file]': Key('c-s'),

        '[Enter] distraction free [mode]': Key('s-f11'),
        '[toggle] sidebar': Key('c-k,c-b'),
        '[toggle] menu': Key('cs-p') + Text('menu\n'),
        '[toggle] tabs': Key('cs-p') + Text('tabs\n'),

        'entab': Key('c-pgdown'),
        'pretab': Key('c-pgup'),
        'flip': Key('c-tab'),

        'See it': Key('cs-r'),

        'Nav': Key('c-p'),
        'file list': Key('c-p'),
        'Nav <text>': Key('c-p/5') + Text('%(text)s'),<commit_msg>Add command to toggle auxiliary ruler<commit_after>from dragonfly import (Grammar, AppContext, MappingRule, Dictation,
                       Key, Text, FocusWindow, IntegerRef, Choice)
from dragonglue import LinuxAppContext
from dragonglue.command import Command


#---------------------------------------------------------------------------
# Create this module's grammar and the context under which it'll be active.

context = LinuxAppContext(executable='sublime_text')
grammar = Grammar("sublime text", context=context)


#---------------------------------------------------------------------------
# Create a mapping rule which maps things you can say to actions.
#
# Note the relationship between the *mapping* and *extras* keyword
#  arguments.  The extras is a list of Dragonfly elements which are
#  available to be used in the specs of the mapping.  In this example
#  the Dictation("text")* extra makes it possible to use "<text>"
#  within a mapping spec and "%(text)s" within the associated action.

example_rule = MappingRule(
    name="sublime text",    # The name of the rule.
    mapping={
        'close [(file | tab)]': Key('c-w'),
        'file new': Key('c-n'),
        'open [file]': Key('c-o'),
        'save [file]': Key('c-s'),

        '[Enter] distraction free [mode]': Key('s-f11'),
        '[toggle] sidebar': Key('c-k,c-b'),
        '[toggle] menu': Key('cs-p') + Text('menu\n'),
        '[toggle] tabs': Key('cs-p') + Text('tabs\n'),
        '[toggle] ruler': Command('/home/drocco/bin/utils/sublime_toggle_ruler.sh'),

        'entab': Key('c-pgdown'),
        'pretab': Key('c-pgup'),
        'flip': Key('c-tab'),

        'See it': Key('cs-r'),

        'Nav': Key('c-p'),
        'file list': Key('c-p'),
        'Nav <text>': Key('c-p/5') + Text('%(text)s'),
{'fraction_non_alphanumeric': 0.23736199883788495, 'fraction_numerical': 0.0017431725740848344, 'mean_word_length': 2.2419962335216574, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5032363', 'n_tokens_mistral': 1037, 'n_tokens_neox': 1003, 'n_words': 321}