Skip to content

Commit

Permalink
Add the menu to context menu instead of application menu as per norms.
Browse files Browse the repository at this point in the history
Add OS X specific key map;
Add instructions to README for Mac OSX.

Add Linux keymap (duplicate of Windows)
  • Loading branch information
btbytes committed Jan 22, 2016
1 parent 88d1976 commit dfdd9b4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 45 deletions.
3 changes: 3 additions & 0 deletions DFormat.sublime-commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
{"caption" : "DFormat: format D code", "command" : "dformat"}
]
3 changes: 3 additions & 0 deletions Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
{ "keys": ["ctrl+alt+f"], "command": "dformat" }
]
7 changes: 7 additions & 0 deletions Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"keys": ["super+.", "super+f"],
"command": "dformat",
"context": [{ "key": "selector", "operator": "equal", "operand": "source.d" }]
}
]
56 changes: 20 additions & 36 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
@@ -1,36 +1,20 @@
[
{
"caption": "Preferences",
"mnemonic": "n",
"id": "preferences",
"children": [
{
"caption": "Package Settings",
"mnemonic": "P",
"id": "package-settings",
"children": [
{
"caption": "DFormat",
"children": [
{
"command": "open_file",
"args": {"file": "${packages}/DFormat/dformat.sublime-settings"},
"caption": "Settings – Default"
}
]
}
]
}
]
},
{
"caption":"DLang",
"id": "dlang",
"children":
[
{
"caption": "DFormat", "command": "dformat"
}
]
}
]
[ { "caption" : "Preferences",
"children" : [ { "caption" : "Package Settings",
"children" : [ { "caption" : "DFormat",
"children" : [ { "args" : { "file" : "${packages}/DFormat/dformat.sublime-settings" },
"caption" : "Settings – Default",
"command" : "open_file"
},
{ "args" : { "file" : "${packages}/User/dformat.sublime-settings" },
"caption" : "Settings – User",
"command" : "open_file"
}
]
} ],
"id" : "package-settings",
"mnemonic" : "P"
} ],
"id" : "preferences",
"mnemonic" : "n"
}
]
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Format D source code in Sublime Text
# `dfmt-sublime` - Format D source code in Sublime Text

## dfmt-sublime
Integration of [dfmt](https://github.com/Hackerpilot/dfmt) with Sublime Text 2/3.

Integration of [**dfmt**](https://github.com/Hackerpilot/dfmt) with Sublime Text 2/3.
## Notes

**Note 1:** You need `dfmt` placed in your PATH.
1. You need `dfmt` placed in your PATH.
2. Specify path to your [.editorconfig](https://github.com/Hackerpilot/dfmt/blob/master/.editorconfig) file (`Preferences` -> `Package Settings` -> `DFormat` -> `Settings - User`)

**Note 2:** Specify path to your [.editorconfig](https://github.com/Hackerpilot/dfmt/blob/master/.editorconfig) file (`Preferences` -> `Package Settings` -> `DFormat` -> `Settings - Default`)
## Installation

**Note 3:** I have only Windows, so can't test it on other systems...
Use [Package Control](https://packagecontrol.io/packages/DFormat).

**Note 4:** I have no experience with Python before.

## Usage

## Installation
Key-bindings to format the current buffer:

Please use [Package Control](https://packagecontrol.io/packages/DFormat).
* Windows and Linux - `ctrl+alt+f`
* Mac - `super+.` followed by `super+f`

0 comments on commit dfdd9b4

Please sign in to comment.