Sublime-Package

Sublime-Package is a Yeoman GENERATOR, which creates scaffolding for a Sublime-Packages.

We are all lazy 🦥 and only want to code 👨‍💻 if it doesn’t already exist.
So I created this yeoman generator to easily get a Scaffolding for a Sublime package.

RepositoryGitHubNpm
GitHub release (latest by date)GitHub open issues GitHub closed issuesnpm version
GitHub licenseGitHub pull requests GitHub closed pull requestsnpm collaborators
GitHub language countGitHub contributorsnpm npm
GitHub code size in bytesGitHub downloadsnpm npm
Status
GitHub commits since tagged version GitHub Workflow Lint GitHub Workflow UnitTest GitHub Workflow Pages

sublime-package


Feature

The following files can be created.

GeneratorFilesFunction
app.gitattributesA gitattributes file is a simple text file that gives attributes to pathnames.
 .gitignoreA gitignore file specifies intentionally untracked files that Git should ignore.
 messages/changelog.txtAll notable changes to your new package will be documented in this file.
 messages/install.txtWhen a package is installed, if the key install is present in the messages.json file, the value will be used as the file path to a txt file containing a message to display the user.
 messages/version.txtWhen a package is upgraded, Package Control looks through each key in the messages.json file sand shows the content of the text file that is a value of any key that is higher than the previous version of the package the user has installed.
 messages.jsonMessaging is controlled by a file named messages.json in the root of the package.
commandcommands/SublimePackage.sublime-commandsSublimePackage.sublime-commands is a file to register your new command / plugin for the Command Palette.
completioncompletions/SublimePackage.sublime-completionsSublimePackage.sublime-commands is a file to register your new command / plugin for the Command Palette.
keymapkeymaps/Default.sublime-keymapCreates a Default.sublime-keymap file. Default.sublime-keymap files contain the key bindings (shortcuts) for a command. The JSON objects must contain a keys and command key, and may also contain a args key if the command requires arguments.
 keymaps/Default (Linux).sublime-keymapShortcuts for Linux
 keymaps/Default (OSX).sublime-keymapShortcuts for OSX
 keymaps/Default (Windows).sublime-keymapShortcuts for Windows
macromacros/SublimePackage.sublime-macro.Macros are a basic automation facility comprising sequences of commands. Use them whenever you need to repeat the exact same steps to perform an operation.
menumenus/Context.sublime-menuRight click on main buffer.
 menus/Encoding.sublime-menuLeft click on “Encoding” section in statusbar.
 menus/Find in Files.sublime-menuLeft click on “…” button on Where field of Find_in_files.
 menus/Indentation.sublime-menuLeft click on “Indentation” section in statusbar.
 menus/Line Endings.sublime-menuLeft click on “Line Ending” section in statusbar.
 menus/Main.sublime-menuMain Menu bar.
 menus/Side Bar.sublime-menuRight click on items in Sidebar.
 menus/Syntax.sublime-menuLeft click on current syntax section in statusbar e.g. ‘Plain Text’.
 menus/Side Bar Mount Point.sublime-menuRight click on main folders in Sidebar.
 menus/Tab Context.sublime-menuRight click on Tab bar.
 menus/Widget Context.sublime-menuRight click on text field of any widget (i.e: search panel or output panel).
mousemapmousemaps/Default.sublime-mousemapCreates a Default.sublime-mousemap file. The mousemap files (which have the extension .sublime-mousemap) control what commands are executed when a user performs an action with a mouse, e.g. clicking a mouse button, scrolling the scroll wheel, etc.
 mousemaps/Default (Linux).sublime-mousemapShortcuts for Linux
 mousemaps/Default (OSX).sublime-mousemapShortcuts for OSX
 mousemaps/Default (Windows).sublime-mousemapShortcuts for Windows
pluginSublimePackage.pyCreates a new python plugin.
 SublimePackage.sublime-settingsCreates a SublimePackage.sublime-settings file to stores configuration data.
projectprojects/SublimePackage.sublime-projectsCreates a SublimePackage.sublime-project file to register a collection of files and folders, which are shown in Sidebar.
readmeREADME.mdA README is often the first item a visitor will see when visiting your repository.
settingsettings/SublimePackage.sublime-settingsCreates a SublimePackage.sublime-settings file to stores configuration data.
snippetsnippets/SublimePackage.sublime-snippetSnippets are smart templates that will insert text for you, adapting it to their context.

Usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Create a new directory
mkdir sublime-package && cd $_

# Let the magic happen
yo sublime-package

# Show all possible generators
yo sublime-package --generators

# Shows the description of each sub-generator
yo sublime-package --generator-description

# Run subgenerators directly
yo sublime-package:SUBGENERATOR

# Print the generator's options and usage
yo sublime-package:SUBGENERATOR --help

yo sublime-package:command
yo sublime-package:completion
yo sublime-package:keymap
yo sublime-package:macro
yo sublime-package:menu
yo sublime-package:mousemap
yo sublime-package:plugin
yo sublime-package:project
yo sublime-package:readme
yo sublime-package:setting
yo sublime-package:snippet

Dependencies

Node.js

generator-sublime-package uses Node.js as runtime environment.

Node.js

Install Node

Yeoman

generator-sublime-package uses the yeoman module to create that epic scaffolding.

Install Yeoman

1
2
# Install yeoman global
npm install -g yo

Installation

1. Npm

1
2
# Install generator-sublime-package via npm
npm install -g generator-sublime-package

2. Source code

Clone the latest dev branch

1
2
3
# Clone repository
git clone git@github.com:dennykorsukewitz/generator-sublime-package.git
cd generator-sublime-package

Check all node dependencies in package.json

1
2
# Run npm install to add all dependencies.
npm install

Run this link command in generator-sublime-package directory to link this generator to yeoman.

1
2
# Link local generator
npm link ./

Development

Dependencies

1
2
3
4
5
6
7
# Install yeoman-test and yeoman-assert for jest tests
npm install -g yeoman-test
npm install -g yeoman-assert

# Install eslint and ejs-lint for linting
npm install -g eslint
npm install -g ejs-lint

Commands

1
2
3
4
npm run lint        # lint all JS files
npm run lint-fix    # lint and fix all JS files
npm run test        # start jest (tests)
npm run coverage    # start jest (tests) with coverage

Download

For download see generator-sublime-package


Alternatives

The following generators can also help.

But, they do not have the accumulated power.


Enjoy!

Your Denny Korsukéwitz 🚀