Skip to content

Commit

Permalink
Added simple keyboard shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchief committed Apr 30, 2012
1 parent 280a3f5 commit 2decf5b
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 2 deletions.
20 changes: 20 additions & 0 deletions Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{ "keys": ["ctrl+b"], "command": "insert_snippet", "args": {"contents": "*${0:$SELECTION}*"}, "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
},
{ "keys": ["ctrl+i"], "command": "insert_snippet", "args": {"contents": "_${0:$SELECTION}_"}, "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
},
{ "keys": ["ctrl+k"], "command": "insert_snippet", "args": {"contents": "+${0:$SELECTION}+"}, "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
}
]
20 changes: 20 additions & 0 deletions Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{ "keys": ["cmd+b"], "command": "insert_snippet", "args": {"contents": "*${0:$SELECTION}*"}, "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
},
{ "keys": ["cmd+i"], "command": "insert_snippet", "args": {"contents": "_${0:$SELECTION}_"}, "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
},
{ "keys": ["cmd+k"], "command": "insert_snippet", "args": {"contents": "+${0:$SELECTION}+"}, "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
}
]
20 changes: 20 additions & 0 deletions Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{ "keys": ["ctrl+b"], "command": "insert_snippet", "args": {"contents": "*${0:$SELECTION}*"}, "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
},
{ "keys": ["ctrl+i"], "command": "insert_snippet", "args": {"contents": "_${0:$SELECTION}_"}, "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
},
{ "keys": ["ctrl+k"], "command": "insert_snippet", "args": {"contents": "+${0:$SELECTION}+"}, "context":
[
{"key": "selection_empty", "operator": "equal", "operand": false},
{"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"}
]
}
]
16 changes: 14 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,26 @@ Few tab completion examples are:
- Headings (type `h1 TAB` to `h4 TAB` for one-liner versions)
- Table generation (type `|= TAB`)
- Tab expansion for blocks (type `== TAB`)
- Sidebar block (type `** TAB`)
- Sidebar block (type `** TAB`)

Keyboard Shortcuts
--------
Basic support for some handy shortcuts are now available:

- **Bold** selection: Select some text and then press `ctrl+b`
- _Italic_ize selection: Select some text and then press `ctrl+i`
- Mark selection as Code literal: Select some text and then press `ctrl+k`

**Note**: `ctrl+b` overrides the standard key binding of `Tools > Build System`. If this bothers you, you can edit the `.sublime-keymap` files (based on your OS) under `Packages\AsciiDoc` folder.

Time permitting, I'll add more shortcuts but meanwhile if you come upon something useful, feel free to submit a patch!

Enhancements
------------

Following are planned enhancements for the package:

- Add keyboard shortcuts for various commands such bold text, italics, blocks etc.
- <strike>Add keyboard shortcuts for various commands such bold text, italics, blocks etc.</strike>
- Adding Build system to preview as HTML or PDF.

Your suggestions are welcome.
Expand Down

0 comments on commit 2decf5b

Please sign in to comment.