How to use the rules.emacs.common.emacsDefaults function in rules

To help you get started, we’ve selected a few rules examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jgarvin / mandimus / rules / emacs / Term.py View on Github external
from Actions import Key
from rules.ContextualRule import makeContextualRule
from requirements.Emacs import IsEmacs
from requirements.ModeRequirement import ModeRequirement
from rules.emacs.common import emacsExtras, emacsDefaults

# Term mode issues:
# -Can wreck prompt and previous output
# -Completion won't work, because we need to emulate moving cursor and pressing TAB

_mapping = {
    "line mode" : Key("c-c,c-j"),
    "care mode" : Key("c-c,c-k"),
}

TermRule = makeContextualRule("Term", _mapping, emacsExtras, emacsDefaults)
TermRule.context.addRequirement(IsEmacs)
TermRule.context.addRequirement(ModeRequirement(modes="term-mode"))
github jgarvin / mandimus / rules / emacs / Dired.py View on Github external
from Actions import Key, Text
from rules.ContextualRule import makeContextualRule
from requirements.Emacs import IsEmacs
from requirements.ModeRequirement import ModeRequirement
from rules.emacs.common import emacsExtras, emacsDefaults


_mapping = {
    "dired copy"  : Key("c-c,a-w"),
    "dired cut"   : Key("c-c,c-w"),
    "dired paste" : Key("c-c,c-y")
}

DiredRule = makeContextualRule("Dired", _mapping, emacsExtras, emacsDefaults)
DiredRule.context.addRequirement(IsEmacs)
DiredRule.context.addRequirement(ModeRequirement(modes="dired-mode"))
github jgarvin / mandimus / rules / emacs / Org.py View on Github external
from Actions import Key, Repeat
from rules.ContextualRule import makeContextualRule
from requirements.Emacs import IsEmacs
from requirements.ModeRequirement import ModeRequirement
from rules.emacs.common import emacsExtras, emacsDefaults

_mapping = {
    "org save link"   : Key("c-c,l"),
    "org agenda menu" : Key("c-c,a"),
    "org agenda"      : Key("c-c,a,a"),
    "org list to do"  : Key("c-c,a,t"),
}

OrgAnywhereRule = makeContextualRule("OrgAnywhere", _mapping, emacsExtras, emacsDefaults)
OrgAnywhereRule.context.addRequirement(IsEmacs)


# "scoot" -> expand section
# "cap scoot" -> collapse all sections
# "lima" -> log view to see record for the day
_mapping = {
    "new"                     : Key("a-enter"),
    "new todo"                : Key("as-enter"),
    "make headline"           : Key("c-c,asterisk"),
    "make table"              : Key("c-c,bar"),
    "archive [<i>]"           : Key("c-c,c-t,c-a") * Repeat(extra="i"),
    "task [<i>]"              : Key("c-c,c-x") * Repeat(extra="i"),
    "follow"                  : Key("c-c,c-o"),
    "insert link"             : Key("c-c,c-l"),
    "schedule"                : Key("c-c,c-s"),</i></i>
github jgarvin / mandimus / rules / emacs / Comint.py View on Github external
from requirements.ModeRequirement import ModeRequirement
from rules.emacs.common import emacsExtras, emacsDefaults
from rules.emacs.Cmd import Cmd
from rules.emacs.Text import EmacsText

_mapping = {
    "prior [<i>]"       : Key("a-p:%(i)d"),
    "future [<i>]"      : Key("a-n:%(i)d"),
    "history"           : Key("a-r"),
    "interrupt"         : Key("c-c,c-c"),
    "exit"              : Key("c-d"),
    "prompt up []"   : Key("c-c,c-p:%(n)d"),
    "prompt down []" : Key("c-c,c-n:%(n)d"),
}

ComintRule = makeContextualRule("Comint", _mapping, emacsExtras, emacsDefaults)
ComintRule.context.addRequirement(IsEmacs)
ComintRule.context.addRequirement(ModeRequirement(modes="comint-mode"))
</i></i>