This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

The configuration of Sublime Text uses verbose JSON files, XML files, and also horrible PList/XML files (TextMate legacy). When used in plugins, some of them (e.g. keymaps) may contain even hundreds of lines with huge ratio of duplications. Sooner or later, it’ll become quite hard to maintain such a mess.

The aim of this module is to provide simple pythonic DSL for generating particular configuration files. Currently only Key Bindings are supported, but other configs may come later.

You’re more than welcome to add DSL for other Sublime Text’s configs!

Usage

Examples

#!/usr/bin/env python3
from sublimedsl.keymap import *

Keymap(
    bind('backspace')
        .to('run_macro_file', file='res://Packages/Default/Delete Left Right.sublime-macro')
        .when('setting.auto_match_enabled').any().true()
        .also('preceding_text').regex_contains(r'_$')
        .also('following_text').regex_contains(r'^_'),

    bind('super+k', 'super+shift+up')
        .to('new_pane', move=False),

    common_context=[
        context('selector').equal('text.asciidoc')
    ],
    default_match_all=True

).dump()

The above code generates:

[
  {
    "keys": [ "backspace" ],
    "command": "run_macro_file",
    "args": { "file": "res://Packages/Default/Delete Left Right.sublime-macro" },
    "context": [
      { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true, "match_all": false },
      { "key": "preceding_text", "operator": "regex_contains", "operand": "_$", "match_all": true },
      { "key": "following_text", "operator": "regex_contains", "operand": "^_", "match_all": true },
      { "key": "selector", "operator": "equal", "operand": "text.asciidoc", "match_all": true }
    ]
  },
  {
    "keys": [ "super+k", "super+shift+up" ],
    "command": "new_pane",
    "args": { "move": false },
    "context": [
      { "key": "selector", "operator": "equal", "operand": "text.asciidoc", "match_all": true }
    ]
  }
]

You can also look at real-world example in the Asciidoctor plugin: Keymap DSL and generated JSON.

Installation

System-wide

Install from PyPI system-wide:

sudo pip install sublimedsl

…or manually:

git clone git@github.com:jirutka/sublimedsl.git
cd sublimedsl
sudo ./setup.py install

Locally

If you don’t have a root access to the system, or just don’t want to install sublimedsl system-wide, then you can tell pip or setup.py to install it into your home directory (namely ~/.local):

pip install --user sublimedsl

…or manually:

git clone git@github.com:jirutka/sublimedsl.git
cd sublimedsl
./setup.py --user install

License

This project is licensed under MIT license.

Release History

Release History

0.3.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
sublimedsl-0.3.2.tar.gz (6.6 kB) Copy SHA256 Checksum SHA256 Source Aug 19, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting