Edit vagrant layer README and minor refactor of packages.el

This commit is contained in:
syl20bnr 2015-03-08 23:10:32 -04:00
parent 36e21d9961
commit 2ca205201d
2 changed files with 47 additions and 43 deletions

View file

@ -16,14 +16,12 @@
## Description
This layers adds support for working with Vagrant using
[vagrant.el](https://github.com/ottbot/vagrant.el) and
[vagrant-tramp](https://github.com/dougm/vagrant-tramp)
This layer adds support for working with Vagrant using [vagrant.el][] and
[vagrant-tramp][].
Features:
- manage boxes (under the `SPC V` prefix)
- remote editing on Vagrant boxes via tramp
- manage boxes (under the <kbd>SPC V</kbd> prefix)
- remote editing on Vagrant boxes via Tramp
## Install
@ -32,33 +30,39 @@ Features:
To use this contribution add it to your `~/.spacemacs`
```elisp
(setq-default dotspacemacs-configuration-layers '(vagrant))
(setq-default dotspacemacs-configuration-layers '(ruby vagrant))
```
**Note** Since vagrant files are written in `ruby` it is recommended
to install the `ruby` layer as well.
### Vagrant
Follow the
[Installing Vagrant](http://docs.vagrantup.com/v2/installation/index.html)
and
[Getting Started](http://docs.vagrantup.com/v2/getting-started/index.html)
guides in Vagrant's documentation.
Follow the [Installing Vagrant][] and [Getting Started][] guides in
Vagrant's documentation.
### Testing
If you'd like to test this layer out in a simple way (for example to
make sure you have Vagrant configured correctly) there is a
[Vagrantfile](Vagrantfile) in this directory.
make sure you have Vagrant configured correctly) there is a [Vagrantfile][]
in this directory.
## Keybindings
Key Binding | Description
------------|-----------------------------------------------------------------------------------------------
`SPC V V` | bring up a Vagrant box
`SPC V p` | (re)provision a box that is already up
`SPC V D` | destroy a box
`SPC V s` | view the status of running boxes in the current project
`SPC V S` | suspend a box
`SPC V r` | resume a suspended box (you can also use `SPC V V` for this)
`SPC V H` | halt (shut down) a box
`SPC V e` | edit the `Vagrantfile`
`SPC V t` | start a `vagrant-tramp-term` session - after start, edit files at `/vagrant:box_name:filename`
Key Binding | Description
-------------------|-----------------------------------------------------------------------------------------------
<kbd>SPC V D</kbd> | destroy a box
<kbd>SPC V e</kbd> | edit the `Vagrantfile`
<kbd>SPC V H</kbd> | halt (shut down) a box
<kbd>SPC V p</kbd> | (re)provision a box that is already up
<kbd>SPC V r</kbd> | resume a suspended box (you can also use `SPC V V` for this)
<kbd>SPC V s</kbd> | view the status of running boxes in the current project
<kbd>SPC V S</kbd> | suspend a box
<kbd>SPC V t</kbd> | start a `vagrant-tramp-term` session - after start, edit files at `/vagrant:box_name:filename`
<kbd>SPC V V</kbd> | bring up a Vagrant box
[vagrant.el]: https://github.com/ottbot/vagrant.el
[vagrant-tramp]: https://github.com/dougm/vagrant-tramp
[Installing Vagrant]: http://docs.vagrantup.com/v2/installation/index.html
[Getting Started]: http://docs.vagrantup.com/v2/getting-started/index.html
[Vagrantfile]: Vagrantfile

View file

@ -13,24 +13,24 @@
vagrant-tramp))
(defun vagrant/init-vagrant ()
(use-package vagrant
:defer t
:init (progn
(spacemacs/declare-prefix "V" "vagrant")
(evil-leader/set-key
"VV" 'vagrant-up
"Vp" 'vagrant-provision
"VD" 'vagrant-destroy
"Vs" 'vagrant-status
"VS" 'vagrant-suspend
"Vr" 'vagrant-resume
"VH" 'vagrant-halt
"Ve" 'vagrant-edit))))
(use-package vagrant
:defer t
:init
(progn
(spacemacs/declare-prefix "V" "vagrant")
(evil-leader/set-key
"VD" 'vagrant-destroy
"Ve" 'vagrant-edit
"VH" 'vagrant-halt
"Vp" 'vagrant-provision
"Vr" 'vagrant-resume
"Vs" 'vagrant-status
"VS" 'vagrant-suspend
"VV" 'vagrant-up))))
(defun vagrant/init-vagrant-tramp ()
(use-package vagrant-tramp
:defer t
:init (progn
(vagrant-tramp-enable)
(evil-leader/set-key
"Vt" 'vagrant-tramp-term))))
:init
(progn
(vagrant-tramp-enable)
(evil-leader/set-key "Vt" 'vagrant-tramp-term))))