Skip to content
t9md edited this page Feb 15, 2018 · 4 revisions

Workflow when adding new Operation to vmp-core

  1. Open Atom in dev mode like atom -d .
  2. Define operator/motion/text-object class. (e.g. eadd NewOperator class in operator.js)
  3. Execute vim-mode-plus:reload-with-dependencies then execute vim-mode-plus:write-command-table-and-file-table-to-disk
  4. Execute vim-mode-plus:reload-with-dependencies
  5. Check behavior via executing vim-mode-plus:new-operator from command-palette.
  6. Define appropriate keymap if necessary.

Step 3 is necessary only when you define operator first time. So you can skip step 3 when modifying code without changing class name in following development.

So if you keymap f7 to vim-mode-plus:reload-with-dependencies command in your keymap.cson.

'atom-text-editor.vim-mode-plus.normal-mode:not(.narrow-editor)':
  'f7': 'vim-mode-plus:reload-with-dependencies'

You can reload code by just hitting f7 to check behavior whenever you saved modified code while interactive/incremental development.

Workflow when development in vmp-plugin

To accelerate your dev of vmp-plugin, you can hot-reload vmp and vmp-plugin by vim-mode-plus:reload-with-dependencies.

First, open your config.cson and add your vmp-plugin pkg name in your devReloadPackages. These listed plugin packages are reloaded after vmp reload was finished.

  "vim-mode-plus":
    devReloadPackages: [
      "vim-mode-plus-move-selected-text"
      "narrow"
      "quick-highlight"
    ]

Then start development with following workflow!

  1. Open Atom in dev mode like atom -d .
  2. Edit your vmp-plugin codes.
  3. Execute vim-mode-plus:reload-with-dependencies
  4. Check behavior via executing vim-mode-plus:new-operator from command-palette.
  5. Define appropriate keymap if necessary.
Why? reloading vmp is required?

vmp-plugin use vmp's service which is provided by vmp. Reloading just vmp-plugin only is not necessary to refresh service-link between provider(vmp) and consumer(vmp-plugin).