From ba01f8a1b188c6e4757ae521c542120da55a8f52 Mon Sep 17 00:00:00 2001 From: Joey Marianer Date: Sun, 8 Jan 2017 14:27:21 -0800 Subject: [PATCH 01/46] ex-mode supports vim-mode-plus --- README.md | 4 +++- keymaps/ex-mode.cson | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 58bcc45..3f247de 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ ex-mode for Atom's vim-mode ## Use -Install both [vim-mode](https://github.com/atom/vim-mode) and ex-mode. Type `:` in command mode. Enter `w` or `write`. +Install both [vim-mode-plus](https://github.com/t9md/atom-vim-mode-plus) (or +the deprecated `vim-mode`) and ex-mode. Type `:` in command mode. Enter `w` or +`write`. ## Extend diff --git a/keymaps/ex-mode.cson b/keymaps/ex-mode.cson index 5abddd0..1c70132 100644 --- a/keymaps/ex-mode.cson +++ b/keymaps/ex-mode.cson @@ -7,5 +7,7 @@ # For more detailed documentation see # https://atom.io/docs/latest/advanced/keymaps +'atom-text-editor.vim-mode-plus:not(.insert-mode)': + ':': 'ex-mode:open' 'atom-text-editor.vim-mode:not(.insert-mode)': ':': 'ex-mode:open' From f4eb1aef7d0607f6c4d12fc0ff91cb648c1a1a0a Mon Sep 17 00:00:00 2001 From: mkiken Date: Mon, 20 Mar 2017 12:03:35 +0900 Subject: [PATCH 02/46] test package.json change. --- package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package.json b/package.json index 7fa69ff..9f8c99d 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,11 @@ }, "consumedServices": { "vim-mode": { + "versions": { + "^0.1.0": "_consumeVim" + } + }, + "vim-mode-plus": { "versions": { "^0.1.0": "consumeVim" } From 50f1beb1e987db5f7c181c8d9c9a3af4b2b7204e Mon Sep 17 00:00:00 2001 From: mkiken Date: Mon, 20 Mar 2017 13:49:33 +0900 Subject: [PATCH 03/46] switch searchHistory --- lib/ex.coffee | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index 5edf5a8..d2e9ed9 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -335,12 +335,23 @@ class Ex [pattern, substition, flags] = parsed if pattern is '' - pattern = vimState.getSearchHistoryItem() + if vimState.getSearchHistoryItem? + # vim-mode + pattern = vimState.getSearchHistoryItem() + else if vimState.searchHistory? + #vim-mode-plus + pattern = vimState.searchHistory.get('prev') + if not pattern? atom.beep() throw new CommandError('No previous regular expression') else - vimState.pushSearchHistory(pattern) + if vimState.pushSearchHistory? + # vim-mode + vimState.pushSearchHistory(pattern) + else if vimState.searchHistory? + #vim-mode-plus + vimState.searchHistory.save(pattern) try flagsObj = {} From 0abb61fcb8970658d13fb1fc42d405fbb7fb4748 Mon Sep 17 00:00:00 2001 From: mkiken Date: Mon, 20 Mar 2017 14:02:05 +0900 Subject: [PATCH 04/46] add consumeVimModePlus. --- lib/ex-mode.coffee | 3 +++ package.json | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ex-mode.coffee b/lib/ex-mode.coffee index 490003e..5274e0a 100644 --- a/lib/ex-mode.coffee +++ b/lib/ex-mode.coffee @@ -36,6 +36,9 @@ module.exports = ExMode = @vim = vim @globalExState.setVim(vim) + consumeVimModePlus: (vim) -> + this.consumeVim(vim) + config: splitbelow: title: 'Split below' diff --git a/package.json b/package.json index 9f8c99d..0984409 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,12 @@ "consumedServices": { "vim-mode": { "versions": { - "^0.1.0": "_consumeVim" + "^0.1.0": "consumeVim" } }, "vim-mode-plus": { "versions": { - "^0.1.0": "consumeVim" + "^0.1.0": "consumeVimModePlus" } } }, From 378cf6cff4e9db8d7af5cb3b2666c97004b08309 Mon Sep 17 00:00:00 2001 From: mkiken Date: Mon, 20 Mar 2017 14:07:44 +0900 Subject: [PATCH 05/46] comment refactoring. --- lib/ex.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index d2e9ed9..e026b96 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -339,7 +339,7 @@ class Ex # vim-mode pattern = vimState.getSearchHistoryItem() else if vimState.searchHistory? - #vim-mode-plus + # vim-mode-plus pattern = vimState.searchHistory.get('prev') if not pattern? @@ -350,7 +350,7 @@ class Ex # vim-mode vimState.pushSearchHistory(pattern) else if vimState.searchHistory? - #vim-mode-plus + # vim-mode-plus vimState.searchHistory.save(pattern) try From 02ab74465c68e9976c57a91bdc26c257e3dc0fd9 Mon Sep 17 00:00:00 2001 From: jazzpi Date: Thu, 25 May 2017 01:08:21 +0200 Subject: [PATCH 06/46] Support vim-mode-plus marks --- lib/command.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/command.coffee b/lib/command.coffee index 0cfd6f2..fcc1144 100644 --- a/lib/command.coffee +++ b/lib/command.coffee @@ -22,7 +22,7 @@ class Command else if str[0] is "'" # Parse Mark... unless @vimState? throw new CommandError("Couldn't get access to vim-mode.") - mark = @vimState.marks[str[1]] + mark = @vimState.mark.marks[str[1]] unless mark? throw new CommandError("Mark #{str} not set.") addr = mark.getEndBufferPosition().row From 708aa94eb0d94b3cb951ab35255739b6428f6dbe Mon Sep 17 00:00:00 2001 From: jazzpi Date: Thu, 25 May 2017 01:08:38 +0200 Subject: [PATCH 07/46] Use vim-mode-plus in specs --- spec/ex-commands-spec.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/ex-commands-spec.coffee b/spec/ex-commands-spec.coffee index cc349ac..4e3d839 100644 --- a/spec/ex-commands-spec.coffee +++ b/spec/ex-commands-spec.coffee @@ -11,7 +11,7 @@ describe "the commands", -> [editor, editorElement, vimState, exState, dir, dir2] = [] projectPath = (fileName) -> path.join(dir, fileName) beforeEach -> - vimMode = atom.packages.loadPackage('vim-mode') + vimMode = atom.packages.loadPackage('vim-mode-plus') exMode = atom.packages.loadPackage('ex-mode') waitsForPromise -> activationPromise = exMode.activate() @@ -42,7 +42,6 @@ describe "the commands", -> editor = editorElement.getModel() vimState = vimMode.mainModule.getEditorState(editor) exState = exMode.mainModule.exStates.get(editor) - vimState.activateNormalMode() vimState.resetNormalMode() editor.setText("abc\ndef\nabc\ndef") From 99dd953370ded740057119fda1a4761cbd8a4b12 Mon Sep 17 00:00:00 2001 From: jazzpi Date: Thu, 25 May 2017 01:18:58 +0200 Subject: [PATCH 08/46] Use vim-mode-plus on Travis Also use Linux on Travis because there are more machines available --- .travis.yml | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3a85896..e8e09d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,45 @@ -language: objective-c +## Project specific config ### +language: generic + env: - - APM_TEST_PACKAGES="vim-mode" + global: + - APM_TEST_PACKAGES="vim-mode-plus" + - ATOM_LINT_WITH_BUNDLED_NODE="true" + + matrix: + - ATOM_CHANNEL=stable + - ATOM_CHANNEL=beta + +os: + - linux + +dist: trusty + +### Generic setup follows ### +script: + - curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh + - chmod u+x build-package.sh + - ./build-package.sh notifications: email: on_success: never on_failure: change -script: 'curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh' +branches: + only: + - master git: depth: 10 + +sudo: false + +addons: + apt: + packages: + - build-essential + - git + - libgnome-keyring-dev + - libsecret-1-dev + - fakeroot From 546aa9f95c42aaa8b439d64ac85207423e54f710 Mon Sep 17 00:00:00 2001 From: jazzpi Date: Thu, 25 May 2017 01:33:11 +0200 Subject: [PATCH 09/46] Use vim-mode-plus in ex-input-spec as well --- spec/ex-input-spec.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/ex-input-spec.coffee b/spec/ex-input-spec.coffee index 3d076b9..cd7fbd0 100644 --- a/spec/ex-input-spec.coffee +++ b/spec/ex-input-spec.coffee @@ -2,7 +2,7 @@ helpers = require './spec-helper' describe "the input element", -> [editor, editorElement, vimState, exState] = [] beforeEach -> - vimMode = atom.packages.loadPackage('vim-mode') + vimMode = atom.packages.loadPackage('vim-mode-plus') exMode = atom.packages.loadPackage('ex-mode') waitsForPromise -> activationPromise = exMode.activate() @@ -26,7 +26,6 @@ describe "the input element", -> atom.commands.dispatch(getCommandEditor(), "core:cancel") vimState = vimMode.mainModule.getEditorState(editor) exState = exMode.mainModule.exStates.get(editor) - vimState.activateNormalMode() vimState.resetNormalMode() editor.setText("abc\ndef\nabc\ndef") From 9b62ba70ca6fe2d27f7d6f05946a380dcdf80c9c Mon Sep 17 00:00:00 2001 From: jazzpi Date: Thu, 25 May 2017 01:43:49 +0200 Subject: [PATCH 10/46] Add Changelog for v0.15.0 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7a3578..d767be1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.15.0 +* `vim-mode-plus` support! + - Add keybinding (@jmarianer) + - Support `:substitute` command (@mkiken) + - Support marks + - Use `vim-mode-plus` in specs + ## 0.14.0 * Support `:tabonly` (@jmarianer) * Fix `:x` closing Atom instead of the current pane From 545f13294e925d5e7b2407aa70f41390eee1c666 Mon Sep 17 00:00:00 2001 From: jazzpi Date: Thu, 25 May 2017 01:45:07 +0200 Subject: [PATCH 11/46] Prepare 0.15.0 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0984409..8dc63b8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ex-mode", "main": "./lib/ex-mode", - "version": "0.14.0", + "version": "0.15.0", "description": "Ex for Atom's vim-mode", "activationCommands": { "atom-workspace": "ex-mode:open" From abb5cd207f025b122522aed40dffe11e08d3d9aa Mon Sep 17 00:00:00 2001 From: Sophie Haskins Date: Thu, 29 Jun 2017 10:32:17 -0400 Subject: [PATCH 12/46] use Atom 1.19 buffer API for finding the length of a buffer --- lib/command.coffee | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/command.coffee b/lib/command.coffee index fcc1144..15e74fe 100644 --- a/lib/command.coffee +++ b/lib/command.coffee @@ -14,7 +14,11 @@ class Command addr = row else if str is '$' # Lines are 0-indexed in Atom, but 1-indexed in vim. - addr = @editor.getBuffer().lines.length - 1 + # The two ways of getting length let us support Atom 1.19's new buffer + # implementation (https://github.com/atom/atom/pull/14435) and still + # support 1.18 and below + buffer = @editor.getBuffer() + addr = (buffer.getLineCount?() ? buffer.lines.length) - 1 else if str[0] in ["+", "-"] addr = row + @parseOffset(str) else if not isNaN(str) @@ -73,7 +77,9 @@ class Command return # Step 4: Address parsing - lastLine = @editor.getBuffer().lines.length - 1 + # see comment in parseAddr about line length + buffer = @editor.getBuffer() + lastLine = (buffer.getLineCount?() ? buffer.lines.length) - 1 if cl[0] is '%' range = [0, lastLine] cl = cl[1..] From dfbbdadfbcd04c3c7a89e10b73c18862b0c7e357 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Thu, 27 Jul 2017 15:14:39 +0200 Subject: [PATCH 13/46] :memo: update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d767be1..47ae57c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.16.0 + +* Support for Atom 1.18 and 1.19 (#184) + ## 0.15.0 * `vim-mode-plus` support! - Add keybinding (@jmarianer) From 78a479bf9b8f9fc008d89673dfac00d9a71f273e Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Thu, 27 Jul 2017 15:16:12 +0200 Subject: [PATCH 14/46] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47ae57c..d708c94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.16.0 -* Support for Atom 1.18 and 1.19 (#184) +* Support for Atom 1.18 and 1.19 ([#184](https://github.com/lloeki/ex-mode/pull/184)) ## 0.15.0 * `vim-mode-plus` support! From d0e7afe164f9f9b1b2d695972f8aa94ef6b4d4b6 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Thu, 27 Jul 2017 15:17:32 +0200 Subject: [PATCH 15/46] Prepare 0.16.0 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8dc63b8..26d692b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ex-mode", "main": "./lib/ex-mode", - "version": "0.15.0", + "version": "0.16.0", "description": "Ex for Atom's vim-mode", "activationCommands": { "atom-workspace": "ex-mode:open" From 3dbcf76ff79cbae59ff30054efa01d919131d414 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Thu, 27 Jul 2017 15:18:20 +0200 Subject: [PATCH 16/46] Prepare 0.17.0 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 26d692b..1b23c20 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ex-mode", "main": "./lib/ex-mode", - "version": "0.16.0", + "version": "0.17.0", "description": "Ex for Atom's vim-mode", "activationCommands": { "atom-workspace": "ex-mode:open" From f2ee5516e03696aa7b3a6bc45c622b51aa13cc7a Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Thu, 27 Jul 2017 15:20:06 +0200 Subject: [PATCH 17/46] Prepare 0.18.0 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1b23c20..cda6de9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ex-mode", "main": "./lib/ex-mode", - "version": "0.17.0", + "version": "0.18.0", "description": "Ex for Atom's vim-mode", "activationCommands": { "atom-workspace": "ex-mode:open" From eb7a23717ada8f945c5f42b694b2e05afa2d3e94 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Thu, 27 Jul 2017 15:20:56 +0200 Subject: [PATCH 18/46] Revert back versions, apm publish strugles.. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cda6de9..8dc63b8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ex-mode", "main": "./lib/ex-mode", - "version": "0.18.0", + "version": "0.15.0", "description": "Ex for Atom's vim-mode", "activationCommands": { "atom-workspace": "ex-mode:open" From 4747bcf5e8dc212f50223799d816fee5406c96bd Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Thu, 27 Jul 2017 15:22:18 +0200 Subject: [PATCH 19/46] :arrow_up: version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8dc63b8..26d692b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ex-mode", "main": "./lib/ex-mode", - "version": "0.15.0", + "version": "0.16.0", "description": "Ex for Atom's vim-mode", "activationCommands": { "atom-workspace": "ex-mode:open" From b5cb054b3976288785051b11b2a2ab6365fce32d Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Thu, 27 Jul 2017 15:58:50 +0200 Subject: [PATCH 20/46] Support Promise response in trySave In Atom 1.19, TextBuffer.save returns a Promise. This commit adds support to catch this and resolve our internal callbacks when promise resolves. --- lib/ex.coffee | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index e026b96..4b13d1a 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -17,8 +17,13 @@ trySave = (func) -> deferred = defer() try - func() - deferred.resolve() + response = func() + + if response instanceof Promise + response.then -> + deferred.resolve() + else + deferred.resolve() catch error if error.message.endsWith('is a directory') atom.notifications.addWarning("Unable to save file: #{error.message}") @@ -252,7 +257,7 @@ class Ex @write(args) wq: (args) => - @write(args).then => @quit() + @write(args).then(=> @quit()) wa: => @wall() From 26ac7c50b161ec4d6a7c998f00977de9c6e3a300 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Thu, 27 Jul 2017 16:13:48 +0200 Subject: [PATCH 21/46] Support Ctrl-C to cancel ex-mode --- keymaps/ex-mode.cson | 2 ++ lib/ex-normal-mode-input-element.coffee | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/keymaps/ex-mode.cson b/keymaps/ex-mode.cson index 1c70132..6191513 100644 --- a/keymaps/ex-mode.cson +++ b/keymaps/ex-mode.cson @@ -9,5 +9,7 @@ # https://atom.io/docs/latest/advanced/keymaps 'atom-text-editor.vim-mode-plus:not(.insert-mode)': ':': 'ex-mode:open' +'atom-text-editor.ex-mode-editor': + 'ctrl-c': 'ex-mode:close' 'atom-text-editor.vim-mode:not(.insert-mode)': ':': 'ex-mode:open' diff --git a/lib/ex-normal-mode-input-element.coffee b/lib/ex-normal-mode-input-element.coffee index 73ca3da..915a5be 100644 --- a/lib/ex-normal-mode-input-element.coffee +++ b/lib/ex-normal-mode-input-element.coffee @@ -15,7 +15,8 @@ class ExCommandModeInputElement extends HTMLDivElement @editorContainer.style.height = "0px" @editorElement = document.createElement "atom-text-editor" - @editorElement.classList.add('editor') + @editorElement.classList.add('editor') # Consider this deprecated! + @editorElement.classList.add('ex-mode-editor') @editorElement.getModel().setMini(true) @editorElement.setAttribute('mini', '') @editorContainer.appendChild(@editorElement) @@ -40,6 +41,7 @@ class ExCommandModeInputElement extends HTMLDivElement atom.commands.add(@editorElement, 'core:confirm', @confirm.bind(this)) atom.commands.add(@editorElement, 'core:cancel', @cancel.bind(this)) + atom.commands.add(@editorElement, 'ex-mode:close', @cancel.bind(this)) atom.commands.add(@editorElement, 'blur', @cancel.bind(this)) backspace: -> From 9f1a767fece7b7d64c0708edc6bff9fbfa53f4e3 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Fri, 28 Jul 2017 14:28:03 +0200 Subject: [PATCH 22/46] :memo: update changeling --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d708c94..3dc73c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.17.0 (Unreleased) + +* Added support for canceling ex-mode with Ctrl-C ([#186](https://github.com/lloeki/ex-mode/pull/186)) + ## 0.16.0 * Support for Atom 1.18 and 1.19 ([#184](https://github.com/lloeki/ex-mode/pull/184)) From daddcf8d0fb6baece4be035da601ea3edaedee92 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Sat, 29 Jul 2017 17:38:07 +0200 Subject: [PATCH 23/46] add editorconfig --- .editorconfig | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..33224b4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true + +[*.{coffee,json}] +indent_style = space +indent_size = 2 From 91f748f85f1e4bafc05cf1925df2ad8b1ecc92d7 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Sat, 29 Jul 2017 17:40:59 +0200 Subject: [PATCH 24/46] fix indenting --- lib/ex.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index 4b13d1a..2923602 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -20,10 +20,10 @@ trySave = (func) -> response = func() if response instanceof Promise - response.then -> - deferred.resolve() - else + response.then -> deferred.resolve() + else + deferred.resolve() catch error if error.message.endsWith('is a directory') atom.notifications.addWarning("Unable to save file: #{error.message}") From 3283b723942a43eac83cff084bfcbd29b29990ef Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Sat, 29 Jul 2017 17:41:38 +0200 Subject: [PATCH 25/46] :memo: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dc73c9..43b94cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## 0.17.0 (Unreleased) +* Add support for Atom 1.19 ([#185](https://github.com/lloeki/ex-mode/pull/185)) * Added support for canceling ex-mode with Ctrl-C ([#186](https://github.com/lloeki/ex-mode/pull/186)) ## 0.16.0 From 8590f5a67877951f29fc2c1da663efdfddb0aef2 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Sat, 29 Jul 2017 17:49:40 +0200 Subject: [PATCH 26/46] :arrow_up: 1.17.0 --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43b94cc..8c0e973 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.17.0 (Unreleased) +## 0.17.0 * Add support for Atom 1.19 ([#185](https://github.com/lloeki/ex-mode/pull/185)) * Added support for canceling ex-mode with Ctrl-C ([#186](https://github.com/lloeki/ex-mode/pull/186)) diff --git a/package.json b/package.json index 26d692b..1b23c20 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ex-mode", "main": "./lib/ex-mode", - "version": "0.16.0", + "version": "0.17.0", "description": "Ex for Atom's vim-mode", "activationCommands": { "atom-workspace": "ex-mode:open" From 117d7439ad5ae59f0192cc0999334998ae0f7728 Mon Sep 17 00:00:00 2001 From: Robby Date: Sun, 6 Aug 2017 21:23:41 -0500 Subject: [PATCH 27/46] Adds save ex-mode command --- lib/ex.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ex.coffee b/lib/ex.coffee index e026b96..6913b52 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -133,6 +133,7 @@ class Ex qall: => @quitall() + tabedit: (args) => if args.args.trim() isnt '' @edit(args) @@ -437,4 +438,11 @@ class Ex throw new CommandError("No such option: #{option}") optionProcessor() + sort: ({ range }) => + range = [[range[0], 0], [range[1] + 1, 0]] + editor = atom.workspace.getActiveTextEditor() + text = editor.getTextInBufferRange(range) + sortedText = _.sortBy(text.split(/\n/)).join('\n') + editor.buffer.setTextInRange(range, sortedText) + module.exports = Ex From 15296ff369b87400975ff308487ae05809a31ed8 Mon Sep 17 00:00:00 2001 From: Robby Date: Sun, 6 Aug 2017 21:24:22 -0500 Subject: [PATCH 28/46] Removes accidental newline --- lib/ex.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index 6913b52..16f74f9 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -133,7 +133,6 @@ class Ex qall: => @quitall() - tabedit: (args) => if args.args.trim() isnt '' @edit(args) From 43127775084196b1bdbd3038e272a4abaffeefab Mon Sep 17 00:00:00 2001 From: Robby Date: Sun, 6 Aug 2017 23:22:13 -0500 Subject: [PATCH 29/46] Modifies sort function and adds a unit test --- lib/ex.coffee | 17 +++++++++++++---- spec/ex-commands-spec.coffee | 10 ++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index 16f74f9..46ab42b 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -438,10 +438,19 @@ class Ex optionProcessor() sort: ({ range }) => - range = [[range[0], 0], [range[1] + 1, 0]] editor = atom.workspace.getActiveTextEditor() - text = editor.getTextInBufferRange(range) - sortedText = _.sortBy(text.split(/\n/)).join('\n') - editor.buffer.setTextInRange(range, sortedText) + sortingRange = [[]] + isMultiLine = range[1] - range[0] > 1 + if isMultiLine + sortingRange = [[range[0], 0], [range[1] + 1, 0]] + else + sortingRange = [[0, 0], [editor.getLastBufferRow(), 0]] + + textLines = [] + for lineIndex in [sortingRange[0][0]..sortingRange[1][0] - 1] + textLines.push(editor.lineTextForBufferRow(lineIndex)) + + sortedText = _.sortBy(textLines).join('\n') + '\n' + editor.buffer.setTextInRange(sortingRange, sortedText) module.exports = Ex diff --git a/spec/ex-commands-spec.coffee b/spec/ex-commands-spec.coffee index 4e3d839..2d9facc 100644 --- a/spec/ex-commands-spec.coffee +++ b/spec/ex-commands-spec.coffee @@ -983,3 +983,13 @@ describe "the commands", -> expect(calls.length).toEqual 2 expect(calls[0].args[0].range).toEqual [0, 2] expect(calls[1].args[0].range).toEqual [3, 3] + + desctibe ':sort', -> + beforeEach -> + editor.setText('ghi\nabc\njkl\ndef\n') + editor.setCursorBufferPosition([0, 0]) + + it "sorts entire file if range is not multi-line", -> + openEx() + submitNormalModeInputText('sort') + expect(atom.getText()).toEqual('abc\ndef\nghi\njkl\n') From d76940dabc05ef7967ecdce5d69cd4b351285c0e Mon Sep 17 00:00:00 2001 From: Robby Date: Sun, 6 Aug 2017 23:40:06 -0500 Subject: [PATCH 30/46] Adds another unit test --- spec/ex-commands-spec.coffee | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/spec/ex-commands-spec.coffee b/spec/ex-commands-spec.coffee index 2d9facc..2eb252a 100644 --- a/spec/ex-commands-spec.coffee +++ b/spec/ex-commands-spec.coffee @@ -984,12 +984,17 @@ describe "the commands", -> expect(calls[0].args[0].range).toEqual [0, 2] expect(calls[1].args[0].range).toEqual [3, 3] - desctibe ':sort', -> + describe ':sort', -> beforeEach -> - editor.setText('ghi\nabc\njkl\ndef\n') + editor.setText('ghi\nabc\njkl\ndef\n142\nzzz\n91xfds9\n') editor.setCursorBufferPosition([0, 0]) it "sorts entire file if range is not multi-line", -> openEx() submitNormalModeInputText('sort') - expect(atom.getText()).toEqual('abc\ndef\nghi\njkl\n') + expect(editor.getText()).toEqual('142\n91xfds9\nabc\ndef\nghi\njkl\nzzz\n') + + it "sorts specific range if range is multi-line", -> + openEx() + submitNormalModeInputText('2,4sort') + expect(editor.getText()).toEqual('ghi\nabc\ndef\njkl\n142\nzzz\n91xfds9\n') From 791c62a3bad988d977a177cac7f76a1adedb0ba5 Mon Sep 17 00:00:00 2001 From: Robert Paul Date: Tue, 8 Aug 2017 14:02:29 -0500 Subject: [PATCH 31/46] Adds clarification comments --- lib/ex.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ex.coffee b/lib/ex.coffee index 46ab42b..c84fbbf 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -440,16 +440,20 @@ class Ex sort: ({ range }) => editor = atom.workspace.getActiveTextEditor() sortingRange = [[]] + + # If no range is provided, the entire file should be sorted. isMultiLine = range[1] - range[0] > 1 if isMultiLine sortingRange = [[range[0], 0], [range[1] + 1, 0]] else sortingRange = [[0, 0], [editor.getLastBufferRow(), 0]] + # Store every bufferedRow string in an array. textLines = [] for lineIndex in [sortingRange[0][0]..sortingRange[1][0] - 1] textLines.push(editor.lineTextForBufferRow(lineIndex)) + # Sort the array and join them together with newlines for writing back to the file. sortedText = _.sortBy(textLines).join('\n') + '\n' editor.buffer.setTextInRange(sortingRange, sortedText) From 23be6cc862f269d2a0c0cd1d9cd0b6e7d150bfc2 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Tue, 8 Aug 2017 21:12:55 +0200 Subject: [PATCH 32/46] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c0e973..bc87c40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## (unpublished) + +* Add :sort command ([#190](https://github.com/lloeki/ex-mode/pull/190)) + ## 0.17.0 * Add support for Atom 1.19 ([#185](https://github.com/lloeki/ex-mode/pull/185)) From 2fa4584eb44d4b0c92952863e2eebdeefa91118f Mon Sep 17 00:00:00 2001 From: mkiken Date: Sun, 13 Aug 2017 16:08:28 +0900 Subject: [PATCH 33/46] add gdefault option --- lib/ex-mode.coffee | 5 +++++ lib/vim-option.coffee | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/lib/ex-mode.coffee b/lib/ex-mode.coffee index 5274e0a..c627483 100644 --- a/lib/ex-mode.coffee +++ b/lib/ex-mode.coffee @@ -50,3 +50,8 @@ module.exports = ExMode = description: 'when splitting, split from right' type: 'boolean' default: 'false' + gdefault: + title: 'Gdefault' + description: 'When on, the ":substitute" flag \'g\' is default on' + type: 'boolean' + default: 'false' diff --git a/lib/vim-option.coffee b/lib/vim-option.coffee index ddf4688..223395f 100644 --- a/lib/vim-option.coffee +++ b/lib/vim-option.coffee @@ -56,4 +56,10 @@ class VimOption noscs: => @nosmartcase() + gdefault: => + atom.config.set("ex-mode.gdefault", true) + + nogdefault: => + atom.config.set("ex-mode.gdefault", false) + module.exports = VimOption From 964813a0b0d5c45bbd93f1a4295071082c3eaf0a Mon Sep 17 00:00:00 2001 From: mkiken Date: Sun, 13 Aug 2017 16:37:00 +0900 Subject: [PATCH 34/46] implement gdefault option --- lib/ex.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index a1e5ad3..cbc7857 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -18,7 +18,7 @@ trySave = (func) -> try response = func() - + if response instanceof Promise response.then -> deferred.resolve() @@ -361,6 +361,9 @@ class Ex try flagsObj = {} flags.split('').forEach((flag) -> flagsObj[flag] = true) + # gdefault option + if atom.config.get('ex-mode.gdefault') + flagsObj.g = !flagsObj.g patternRE = getSearchTerm(pattern, flagsObj) catch e if e.message.indexOf('Invalid flags supplied to RegExp constructor') is 0 From 1a515fcb056db8d6bc09d6f1cf45a040440b9bf2 Mon Sep 17 00:00:00 2001 From: mkiken Date: Sun, 13 Aug 2017 16:47:28 +0900 Subject: [PATCH 35/46] gdefault option set test --- spec/ex-commands-spec.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/ex-commands-spec.coffee b/spec/ex-commands-spec.coffee index 2eb252a..438bbd7 100644 --- a/spec/ex-commands-spec.coffee +++ b/spec/ex-commands-spec.coffee @@ -944,6 +944,14 @@ describe "the commands", -> submitNormalModeInputText(':set nosmartcase') expect(atom.config.get('vim-mode.useSmartcaseForSearch')).toBe(false) + it "sets (no)gdefault", -> + openEx() + submitNormalModeInputText(':set gdefault') + expect(atom.config.get('ex-mode.gdefault')).toBe(true) + atom.commands.dispatch(editorElement, 'ex-mode:open') + submitNormalModeInputText(':set nogdefault') + expect(atom.config.get('ex-mode.gdefault')).toBe(false) + describe "aliases", -> it "calls the aliased function without arguments", -> ExClass.registerAlias('W', 'w') From d0059a7bb20c7e5716890cec2e76f2c92815f276 Mon Sep 17 00:00:00 2001 From: mkiken Date: Sun, 13 Aug 2017 16:57:11 +0900 Subject: [PATCH 36/46] gdefault option implementation test --- spec/ex-commands-spec.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/ex-commands-spec.coffee b/spec/ex-commands-spec.coffee index 438bbd7..49469d0 100644 --- a/spec/ex-commands-spec.coffee +++ b/spec/ex-commands-spec.coffee @@ -715,6 +715,12 @@ describe "the commands", -> submitNormalModeInputText(':%substitute/abc/ghi/ig') expect(editor.getText()).toEqual('ghiaghi\ndefdDEF\nghiaghi') + it "set gdefault option", -> + openEx() + atom.config.set('ex-mode.gdefault', true) + submitNormalModeInputText(':substitute/a/x/g') + expect(editor.getText()).toEqual('xbcaABC\ndefdDEF\nabcaABC') + describe ":yank", -> beforeEach -> editor.setText('abc\ndef\nghi\njkl') From c75395174fa64232e2bc7973b795c17aaf3166e5 Mon Sep 17 00:00:00 2001 From: mkiken Date: Sun, 13 Aug 2017 17:18:26 +0900 Subject: [PATCH 37/46] add gdefault option implementation test --- spec/ex-commands-spec.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/ex-commands-spec.coffee b/spec/ex-commands-spec.coffee index 49469d0..29f211e 100644 --- a/spec/ex-commands-spec.coffee +++ b/spec/ex-commands-spec.coffee @@ -718,6 +718,11 @@ describe "the commands", -> it "set gdefault option", -> openEx() atom.config.set('ex-mode.gdefault', true) + submitNormalModeInputText(':substitute/a/x') + expect(editor.getText()).toEqual('xbcxABC\ndefdDEF\nabcaABC') + + atom.commands.dispatch(editorElement, 'ex-mode:open') + atom.config.set('ex-mode.gdefault', true) submitNormalModeInputText(':substitute/a/x/g') expect(editor.getText()).toEqual('xbcaABC\ndefdDEF\nabcaABC') From 146d832e14ab0b2db75135aa5933df1b47733d4c Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Tue, 15 Aug 2017 21:33:13 +0200 Subject: [PATCH 38/46] Update CHANGELOG.md [ci skip] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc87c40..c6c943c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## (unpublished) +* Add Gdefault support ([#191](https://github.com/lloeki/ex-mode/pull/191)) * Add :sort command ([#190](https://github.com/lloeki/ex-mode/pull/190)) ## 0.17.0 From 93d0af041fa997ed740b525cb0defd863c37986a Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Sat, 19 Aug 2017 09:43:43 +0200 Subject: [PATCH 39/46] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6c943c..41dfadf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## (unpublished) +## 0.18.0 + * Add Gdefault support ([#191](https://github.com/lloeki/ex-mode/pull/191)) * Add :sort command ([#190](https://github.com/lloeki/ex-mode/pull/190)) From 653d62ec1500934750dd8dcd4a528e978fbdee10 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Sat, 19 Aug 2017 09:44:09 +0200 Subject: [PATCH 40/46] Prepare 0.18.0 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1b23c20..cda6de9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ex-mode", "main": "./lib/ex-mode", - "version": "0.17.0", + "version": "0.18.0", "description": "Ex for Atom's vim-mode", "activationCommands": { "atom-workspace": "ex-mode:open" From 4f1ebf8a1a8d5e2e32d099c54656867cd42938af Mon Sep 17 00:00:00 2001 From: Bernard Laveaux Date: Tue, 17 Oct 2017 16:31:54 -0400 Subject: [PATCH 41/46] Support Ctrl-[ to close ex-mode This is merely a suggestion to also default the `ctrl-[` keymap to close ex-mode. This behaviour is very similar to vim's default behaviour: ``` CTRL-[ *c_CTRL-[* *c_* *c_Esc* When typed and 'x' not present in 'cpoptions', quit Command-line mode without executing. In macros or when 'x' present in 'cpoptions', start entered command. Note: If your key is hard to hit on your keyboard, train yourself to use CTRL-[. ``` Is very similar to the currently supported `ctrl-c` ``` CTRL-C *c_CTRL-C* quit command-line without executing ``` --- keymaps/ex-mode.cson | 1 + 1 file changed, 1 insertion(+) diff --git a/keymaps/ex-mode.cson b/keymaps/ex-mode.cson index 6191513..a071efd 100644 --- a/keymaps/ex-mode.cson +++ b/keymaps/ex-mode.cson @@ -11,5 +11,6 @@ ':': 'ex-mode:open' 'atom-text-editor.ex-mode-editor': 'ctrl-c': 'ex-mode:close' + 'ctrl-[': 'ex-mode:close' 'atom-text-editor.vim-mode:not(.insert-mode)': ':': 'ex-mode:open' From 15038d7b0cf9cea653d5ed1a04eb2cfe23106dd6 Mon Sep 17 00:00:00 2001 From: Adrian Wilkins Date: Mon, 26 Mar 2018 13:24:05 +0100 Subject: [PATCH 42/46] Only close buffers on quitall --- lib/ex-mode.coffee | 5 +++++ lib/ex.coffee | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/ex-mode.coffee b/lib/ex-mode.coffee index c627483..d8fc766 100644 --- a/lib/ex-mode.coffee +++ b/lib/ex-mode.coffee @@ -55,3 +55,8 @@ module.exports = ExMode = description: 'When on, the ":substitute" flag \'g\' is default on' type: 'boolean' default: 'false' + onlyCloseBuffers: + title: 'Only close buffers' + description: 'When on, quitall only closes all buffers, not entire Atom instance' + type: 'boolean' + default: 'false' diff --git a/lib/ex.coffee b/lib/ex.coffee index cbc7857..a266afb 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -132,7 +132,11 @@ class Ex atom.workspace.getActivePane().destroyActiveItem() quitall: -> - atom.close() + if !atom.config.get('ex-mode.onlyCloseBuffers') + atom.close() + else + atom.workspace.getTextEditors().forEach (editor) -> + editor.destroy() q: => @quit() From a33959f82996617f10afac096120d842d04035f2 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Tue, 29 May 2018 23:09:45 +0200 Subject: [PATCH 43/46] Fix :enew not working Fixes #214 --- lib/ex.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index a266afb..58b0ebb 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -3,6 +3,7 @@ CommandError = require './command-error' fs = require 'fs-plus' VimOption = require './vim-option' _ = require 'underscore-plus' +atom defer = () -> deferred = {} @@ -210,9 +211,7 @@ class Ex e: (args) => @edit(args) enew: -> - buffer = atom.workspace.getActiveTextEditor().buffer - buffer.setPath(undefined) - buffer.load() + atom.workspace.open() write: ({ range, args, editor, saveas }) -> saveas ?= false From 23dde8c7ee9b778d75deaf33ac0fe3449b68f8b7 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Tue, 29 May 2018 23:14:45 +0200 Subject: [PATCH 44/46] :memo: update CHANGELOG [ci skip] --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41dfadf..30a0532 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## (unpublished) +* Fix `:enew` not working ([#215](https://github.com/lloeki/ex-mode/pull/215)) + ## 0.18.0 * Add Gdefault support ([#191](https://github.com/lloeki/ex-mode/pull/191)) From 744ec7351e5a27991d44db38918210d32c50d964 Mon Sep 17 00:00:00 2001 From: Edvin Hultberg Date: Tue, 29 May 2018 23:55:46 +0200 Subject: [PATCH 45/46] Refactor :write command Update the logic to simplify it. Also fix #208 --- lib/ex.coffee | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index 58b0ebb..b262023 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -229,29 +229,30 @@ class Ex deferred = defer() editor = atom.workspace.getActiveTextEditor() - saved = false + + # Case 1; path is provided if filePath.length isnt 0 - fullPath = getFullPath(filePath) - if editor.getPath()? and (not fullPath? or editor.getPath() == fullPath) - if saveas - throw new CommandError("Argument required") - else - # Use editor.save when no path is given or the path to the file is given - trySave(-> editor.save()).then(deferred.resolve) - saved = true - else if not fullPath? - fullPath = atom.showSaveDialogSync() + fullPath = getFullPath filePath - if not saved and fullPath? - if not force and fs.existsSync(fullPath) - throw new CommandError("File exists (add ! to override)") - if saveas or editor.getFileName() == null - editor = atom.workspace.getActiveTextEditor() - trySave(-> editor.saveAs(fullPath, editor)).then(deferred.resolve) - else - trySave(-> saveAs(fullPath, editor)).then(deferred.resolve) + # Only write when it does not exist or we have a force flag set. + if force or not fs.existsSync(fullPath) + editor.saveAs(fullPath) + return deferred.promise - deferred.promise + throw new CommandError("File exists (add ! to override)") + + # Case 2; no path provided, call editor save. + editor = atom.workspace.getActiveTextEditor() + + # Does the current buffer exist? + if editor.getPath()? and fs.existsSync(editor.getPath()) + trySave(-> editor.save()).then(deferred.promise) + else + # Cant see what the better API is but Pane.saveActiveItemAs() is the only call + # I could find that states it will ask the user. + trySave(-> atom.workspace.getActivePane().saveActiveItemAs()).then(deferred.promise) + + return deferred.promise wall: -> atom.workspace.saveAll() From 59cafd6b994467c91ed7004a40b3cd743f472474 Mon Sep 17 00:00:00 2001 From: Sarang Joshi Date: Thu, 13 Dec 2018 14:39:51 -0800 Subject: [PATCH 46/46] Add existing command information to README --- README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) mode change 100644 => 100755 README.md diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 3f247de..ea4a068 --- a/README.md +++ b/README.md @@ -30,7 +30,34 @@ atom.packages.onDidActivatePackage (pack) -> Ex.registerAlias 'Wq', 'wq' ``` -See `lib/ex.coffee` for some examples commands. Contributions are very welcome! +## Existing commands + +This is the baseline list of commands supported in `ex-mode`. + +| Command | Operation | +| --------------------------------------- | ---------------------------------- | +| `q/quit/tabc/tabclose` | Close active tab | +| `qall/quitall` | Close all tabs | +| `tabe/tabedit/tabnew` | Open new tab | +| `e/edit/tabe/tabedit/tabnew ` | Edit given file | +| `tabn/tabnext` | Go to next tab | +| `tabp/tabprevious` | Go to previous tab | +| `tabo/tabonly` | Close other tabs | +| `w/write` | Save active tab | +| `w/write/saveas ` | Save as | +| `wall/wa` | Save all tabs | +| `sp/split` | Split window | +| `sp/split ` | Open file in split window | +| `s/substitute` | Substitute regular expression in active line | +| `vsp/vsplit` | Vertical split window | +| `vsp/vsplit ` | Open file in vertical split window | +| `delete` | Cut active line | +| `yank` | Copy active line | +| `set ` | Set options | +| `sort` | Sort all lines in file | +| `sort ` | Sort lines in line range | + +See `lib/ex.coffee` for the implementations of these commands. Contributions are very welcome! ## Status