atom/vim-mode — pull request #461 by saidai-no (2014-12-04 11:53:54+00:00)
Title: vim-mode extensibility 

Add interface for external vim-mode extension packages.

Extension packages are intended to augment vim-mode operator suite for some specific areas not appropriate to be included into main vim-mode distribution. Examples of such areas are:

* port of existing Vim plugin (e.g. `vim-surround` #188)
* language-specific motions (e.g. https://github.com/guns/vim-sexp)
* late-binding vim-mode functionality for existing packages (e.g. git integration)

The proposed workflow for extensions is:

* at load subscribe to `PackageManager::onDidLoadAll`
* in `Package-manager@did-load-all` callback subscribe to `vim-mode::onDidAttach`
* in `vim-mode@did-attach` callback register new commands (operators/motions) which can use operation stack by means of `pushOperations` method of provided `VimState`
* at `vim-mode@did-deactivate` unregister provided commands and probably self-deactivate

This workflow will be changed when (if) Atom package dependence mechanism is introduced.

`vim-mode::getStateForEditor` is a convenience method which can be useful for just-installed packages.