diff --git a/README.md b/README.md index 497cab4..88ad65b 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ Terminates the current line with a semicolon. #### End Line with a comma `CTRL-,` Terminates the current line with a comma (great for object literals). +#### End Line `CTRL-.` +Terminates the current line with a dot. + #### End New Line `CTRL-ENTER` Terminates the current line with a colon or semicolon, followed with a new line. A comma is inserted when the cursor is inside an object literal, otherwise a semicolon is inserted. diff --git a/keymaps/turbo-javascript.cson b/keymaps/turbo-javascript.cson index 407d2b1..61db7ec 100644 --- a/keymaps/turbo-javascript.cson +++ b/keymaps/turbo-javascript.cson @@ -10,5 +10,6 @@ 'atom-text-editor': 'ctrl-;': 'turbo-javascript:end-line' 'ctrl-,': 'turbo-javascript:end-line-comma' + 'ctrl-.': 'turbo-javascript:end-line-dot' 'ctrl-enter': 'turbo-javascript:end-new-line' 'ctrl-b': 'turbo-javascript:wrap-block' diff --git a/lib/turbo-javascript.coffee b/lib/turbo-javascript.coffee index 34d7fbf..bb0c82e 100644 --- a/lib/turbo-javascript.coffee +++ b/lib/turbo-javascript.coffee @@ -9,6 +9,8 @@ module.exports = 'turbo-javascript:end-line': => @endLine(';', false) atom.commands.add 'atom-text-editor', 'turbo-javascript:end-line-comma': => @endLine(',', false) + atom.commands.add 'atom-text-editor', + 'turbo-javascript:end-line-dot': => @endLine('.', false) atom.commands.add 'atom-text-editor', 'turbo-javascript:end-new-line': => @endLine('', true) atom.commands.add 'atom-text-editor', diff --git a/menus/turbo-javascript.cson b/menus/turbo-javascript.cson index 027096b..e323b47 100644 --- a/menus/turbo-javascript.cson +++ b/menus/turbo-javascript.cson @@ -7,6 +7,7 @@ {'label': 'End line and return', 'command': 'turbo-javascript:end-new-line'} {'label': 'End line with semicolon', 'command': 'turbo-javascript:end-line'} {'label': 'End line with comma', 'command': 'turbo-javascript:end-line-comma'} + {'label': 'End line with dot', 'command': 'turbo-javascript:end-line-dot'} {'label': 'Insert or remove block', 'command': 'turbo-javascript:wrap-block'} ] ]