aboutsummaryrefslogtreecommitdiff
path: root/atom/packages/vim-surround
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2015-09-28 12:39:59 -0500
committerBen Beltran <ben@nsovocal.com>2015-09-28 12:39:59 -0500
commit455f099b504ec07dd492ab31987ae05a6f6774c7 (patch)
tree22b0c7fd8e492733b97e661750a2d79c46da451d /atom/packages/vim-surround
parent24c7594d62d8d7fbbcdb64b11ce4adc5d8e6991a (diff)
Adds atom packages
Diffstat (limited to 'atom/packages/vim-surround')
-rw-r--r--atom/packages/vim-surround/CHANGELOG.md11
-rw-r--r--atom/packages/vim-surround/README.md4
-rw-r--r--atom/packages/vim-surround/lib/command/change.coffee2
-rw-r--r--atom/packages/vim-surround/lib/command/delete.coffee4
-rw-r--r--atom/packages/vim-surround/lib/command/selector.coffee4
-rw-r--r--atom/packages/vim-surround/lib/vim-surround.coffee8
-rw-r--r--atom/packages/vim-surround/package.json16
7 files changed, 35 insertions, 14 deletions
diff --git a/atom/packages/vim-surround/CHANGELOG.md b/atom/packages/vim-surround/CHANGELOG.md
index c669642..b093333 100644
--- a/atom/packages/vim-surround/CHANGELOG.md
+++ b/atom/packages/vim-surround/CHANGELOG.md
@@ -1,3 +1,14 @@
+## 0.8.0
+* Tentative support for
+ [vim-mode-next](https://atom.io/packages/vim-mode-next). See
+ [#28](https://github.com/gepoch/vim-surround/issues/28).
+
+## 0.7.4
+* Bugfixes.
+
+## 0.7.3
+* Fixed problems cause by vim-mode changing "command-mode" to "normal-mode".
+
## 0.7.1
* Propagate README changes.
diff --git a/atom/packages/vim-surround/README.md b/atom/packages/vim-surround/README.md
index 193f733..0418831 100644
--- a/atom/packages/vim-surround/README.md
+++ b/atom/packages/vim-surround/README.md
@@ -26,6 +26,10 @@ See vim-surround on [github](https://github.com/gepoch/vim-surround) or
* New in 0.7: Change surround and delete surround added.
+* New in 0.8: Tentative support for
+ [vim-mode-next](https://atom.io/packages/vim-mode-next). See
+ [#28](https://github.com/gepoch/vim-surround/issues/28).
+
### Muscle Memory Compatability Note
vim-surround uses a lowercase `s` instead of `S` for surround commands! This is
diff --git a/atom/packages/vim-surround/lib/command/change.coffee b/atom/packages/vim-surround/lib/command/change.coffee
index b1860f5..7bdf623 100644
--- a/atom/packages/vim-surround/lib/command/change.coffee
+++ b/atom/packages/vim-surround/lib/command/change.coffee
@@ -6,7 +6,7 @@ Selector = require './selector'
module.exports = class Change
constructor: (config) ->
@command = config.changeSurroundCommand
- @context = "atom-text-editor.vim-mode.command-mode"
+ @context = "atom-text-editor.vim-mode.normal-mode"
@disposables = new CompositeDisposable
@curPairs = []
@curPairsWithTarget = []
diff --git a/atom/packages/vim-surround/lib/command/delete.coffee b/atom/packages/vim-surround/lib/command/delete.coffee
index aa5eec0..744b3a1 100644
--- a/atom/packages/vim-surround/lib/command/delete.coffee
+++ b/atom/packages/vim-surround/lib/command/delete.coffee
@@ -1,4 +1,4 @@
-{CompositeDisposable} = require 'atom'
+{compositedisposable} = require 'atom'
Base = require './base'
Selector = require './selector'
@@ -6,7 +6,7 @@ Selector = require './selector'
module.exports = class Delete extends Base
constructor: (config) ->
@command = config.deleteSurroundCommand
- @context = "atom-text-editor.vim-mode.command-mode"
+ @context = "atom-text-editor.vim-mode.normal-mode"
super config
getName: (key) -> "delete-#{key}"
diff --git a/atom/packages/vim-surround/lib/command/selector.coffee b/atom/packages/vim-surround/lib/command/selector.coffee
index aae3541..bcb3c15 100644
--- a/atom/packages/vim-surround/lib/command/selector.coffee
+++ b/atom/packages/vim-surround/lib/command/selector.coffee
@@ -1,4 +1,6 @@
-vimModePath = atom.packages.resolvePackagePath('vim-mode')
+vimModePath = atom.packages.resolvePackagePath('vim-mode') or
+ atom.packages.resolvePackagePath('vim-mode-next')
+
{SelectInsideQuotes, SelectInsideBrackets} = require "#{vimModePath}/lib/text-objects"
module.exports = class Selector
diff --git a/atom/packages/vim-surround/lib/vim-surround.coffee b/atom/packages/vim-surround/lib/vim-surround.coffee
index b9fd332..f293194 100644
--- a/atom/packages/vim-surround/lib/vim-surround.coffee
+++ b/atom/packages/vim-surround/lib/vim-surround.coffee
@@ -20,6 +20,9 @@ module.exports =
surroundCommand:
type: 'string'
default: 's'
+ deleteCommand:
+ type: 'string'
+ default: 'd s'
activate: (state) ->
@commandClasses = [
@@ -37,5 +40,6 @@ module.exports =
@commands.push command
@disposables.add command.disposables
- deactivate: () ->
- @disposables.dispose()
+ consumeVimMode: (vimMode) -> @vimMode = vimMode
+
+ deactivate: () -> @disposables.dispose()
diff --git a/atom/packages/vim-surround/package.json b/atom/packages/vim-surround/package.json
index ead55b9..b142af6 100644
--- a/atom/packages/vim-surround/package.json
+++ b/atom/packages/vim-surround/package.json
@@ -1,11 +1,11 @@
{
"name": "vim-surround",
"main": "./lib/vim-surround",
- "version": "0.7.2",
+ "version": "0.8.0",
"description": "vim-surround for Atom!",
"repository": {
"type": "git",
- "url": "https://github.com/gepoch/vim-surround"
+ "url": "git+https://github.com/gepoch/vim-surround.git"
},
"license": "MIT",
"keywords": [
@@ -20,16 +20,16 @@
},
"dependencies": {},
"consumedServices": {},
- "readme": "# Vim Surround for Atom [![Build Status](https://travis-ci.org/gepoch/vim-surround.svg?branch=master)](https://travis-ci.org/gepoch/vim-surround)\n\nSurround is an implementation of vim-surround for the [atom](http://atom.io)\neditor, creating a vim-surround with the power of Atom!\n\nYou should definitely have [vim-mode](https://atom.io/packages/vim-mode) for\nthis package to function properly, of course.\n\nInspiration from and kudos to the wonderful [vim-surround for\nvim](https://github.com/tpope/vim-surround)\n\nSee vim-surround on [github](https://github.com/gepoch/vim-surround) or\n[atom.io](https://atom.io/packages/vim-surround).\n\n## News\n\n* This package supports visual mode's `s )` set of commands for a configurable\n set of pairs.\n\n* Next on the roadmap are pair deletions with `d )` and friends.\n\n* New in 0.4: Multiple cursors are now supported, and conveniently work just\n like you think they do.\n\n* New in 0.5: Stable configuration changes and configurable surround key!\n\n* New in 0.7: Change surround and delete surround added.\n\n### Muscle Memory Compatability Note\n\nvim-surround uses a lowercase `s` instead of `S` for surround commands! This is\nconfigurable in the package settings, if you would like to set it to the\noriginal keybinding.\n\n## How to use Surround\n\n### Surrounding\n\nFor double quotes, highlight the string in visual mode and enter `s \"`.\n\n```\nHello world -> \"Hello world\"\n```\n\nFor parentheses there are two options. `s )` will surround as normal. `s (`\nwill pad with a space. All asymmetrical pairs have the secondary space-padded\nform.\n\nFor example:\n\n`s )`\n\n```\nHello world -> (Hello world)\n```\n\n`s (`\n\n```\nHello world -> ( Hello world )\n```\n\n### Changing Surrounding Pairs\n\nSuppose I want to make double quotes into single quotes. To do this, I should\nput my cursor inside the double quotes in question and enter `c s \" '`\n\n```\n\"Hello world\" -> 'Hello world'\n```\n\n### Deleting Surrounding Pairs\n\nTo delete the single quotes, place your cursor inside of them and enter `d s '`\n\n```\n'Hello world' -> Hello world\n```\n### Configuration\n\nCurrently, the following pairs work out of the box!:\n\n- ()\n- []\n- {}\n- \"\"\n- ''\n\nYou can add to the available pairs in atom's settings, and the commands will\nbe dynamically added to your keybindings.\n\nFor example if I'm working on Jinja templates, and I want to add the ability to\nsurround using `{%` and `%}` I would add this in my settings:\n\n```\n(), [], {}, \"\", '', {%%}\n```\n\nThen:\n\n`s % }`\n\n```\nHello world -> {%Hello world%}\n```\n\n`s { %`\n\n```\nHello world -> {% Hello world %}\n```\n\n### TODO\n\n- [x] Implement deleting surrounding pairs with `d s`\n- [x] Implement changing surrounding pairs with `c s`\n- [ ] Intelligent tag surrounding/deleting/replacing with `s <q>` and friends.\n",
+ "readme": "# Vim Surround for Atom [![Build Status](https://travis-ci.org/gepoch/vim-surround.svg?branch=master)](https://travis-ci.org/gepoch/vim-surround)\n\nSurround is an implementation of vim-surround for the [atom](http://atom.io)\neditor, creating a vim-surround with the power of Atom!\n\nYou should definitely have [vim-mode](https://atom.io/packages/vim-mode) for\nthis package to function properly, of course.\n\nInspiration from and kudos to the wonderful [vim-surround for\nvim](https://github.com/tpope/vim-surround)\n\nSee vim-surround on [github](https://github.com/gepoch/vim-surround) or\n[atom.io](https://atom.io/packages/vim-surround).\n\n## News\n\n* This package supports visual mode's `s )` set of commands for a configurable\n set of pairs.\n\n* Next on the roadmap are pair deletions with `d )` and friends.\n\n* New in 0.4: Multiple cursors are now supported, and conveniently work just\n like you think they do.\n\n* New in 0.5: Stable configuration changes and configurable surround key!\n\n* New in 0.7: Change surround and delete surround added.\n\n* New in 0.8: Tentative support for\n [vim-mode-next](https://atom.io/packages/vim-mode-next). See\n [#28](https://github.com/gepoch/vim-surround/issues/28).\n\n### Muscle Memory Compatability Note\n\nvim-surround uses a lowercase `s` instead of `S` for surround commands! This is\nconfigurable in the package settings, if you would like to set it to the\noriginal keybinding.\n\n## How to use Surround\n\n### Surrounding\n\nFor double quotes, highlight the string in visual mode and enter `s \"`.\n\n```\nHello world -> \"Hello world\"\n```\n\nFor parentheses there are two options. `s )` will surround as normal. `s (`\nwill pad with a space. All asymmetrical pairs have the secondary space-padded\nform.\n\nFor example:\n\n`s )`\n\n```\nHello world -> (Hello world)\n```\n\n`s (`\n\n```\nHello world -> ( Hello world )\n```\n\n### Changing Surrounding Pairs\n\nSuppose I want to make double quotes into single quotes. To do this, I should\nput my cursor inside the double quotes in question and enter `c s \" '`\n\n```\n\"Hello world\" -> 'Hello world'\n```\n\n### Deleting Surrounding Pairs\n\nTo delete the single quotes, place your cursor inside of them and enter `d s '`\n\n```\n'Hello world' -> Hello world\n```\n### Configuration\n\nCurrently, the following pairs work out of the box!:\n\n- ()\n- []\n- {}\n- \"\"\n- ''\n\nYou can add to the available pairs in atom's settings, and the commands will\nbe dynamically added to your keybindings.\n\nFor example if I'm working on Jinja templates, and I want to add the ability to\nsurround using `{%` and `%}` I would add this in my settings:\n\n```\n(), [], {}, \"\", '', {%%}\n```\n\nThen:\n\n`s % }`\n\n```\nHello world -> {%Hello world%}\n```\n\n`s { %`\n\n```\nHello world -> {% Hello world %}\n```\n\n### TODO\n\n- [x] Implement deleting surrounding pairs with `d s`\n- [x] Implement changing surrounding pairs with `c s`\n- [ ] Intelligent tag surrounding/deleting/replacing with `s <q>` and friends.\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/gepoch/vim-surround/issues"
},
- "homepage": "https://github.com/gepoch/vim-surround",
- "_id": "vim-surround@0.7.2",
- "_shasum": "34c0ad724ca6be2fbe6f708455bddc5f5964eb19",
- "_resolved": "file:../d-11562-86965-1746m6m/package.tgz",
- "_from": "../d-11562-86965-1746m6m/package.tgz",
+ "homepage": "https://github.com/gepoch/vim-surround#readme",
+ "_id": "vim-surround@0.8.0",
+ "_shasum": "13e7554fb6a90ba6178fb2b8bddb87ca45e3d0d3",
+ "_resolved": "file:../d-115828-94497-mmttc8/package.tgz",
+ "_from": "../d-115828-94497-mmttc8/package.tgz",
"_atomModuleCache": {
"version": 1,
"dependencies": [],