diff --git a/contrib/vagrant/README.md b/contrib/vagrant/README.md new file mode 100644 index 000000000..b54725b80 --- /dev/null +++ b/contrib/vagrant/README.md @@ -0,0 +1,64 @@ + +**Table of Contents** + +- [Vagrant contribution layer for Spacemacs](#vagrant-contribution-layer-for-spacemacs) + - [Description](#description) + - [Install](#install) + - [Layer](#layer) + - [Vagrant](#vagrant) + - [Testing](#testing) + - [Keybindings](#keybindings) + + +# Vagrant contribution layer for Spacemacs + +![vagrant](img/vagrant.png) + +## 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) + +Features: + + - manage boxes (under the `SPC V` prefix) + - remote editing on Vagrant boxes via tramp + +## Install + +### Layer + +To use this contribution add it to your `~/.spacemacs` + +```elisp +(setq-default dotspacemacs-configuration-layers '(vagrant)) +``` + +### 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. + +### 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. + +## 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` diff --git a/contrib/vagrant/Vagrantfile b/contrib/vagrant/Vagrantfile new file mode 100644 index 000000000..245438d78 --- /dev/null +++ b/contrib/vagrant/Vagrantfile @@ -0,0 +1,14 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# This file is provided for testing this layer - it doesn't really do +# very much! + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.box = "ubuntu/trusty64" + + config.vm.provision :shell, inline: "echo provisioned" +end diff --git a/contrib/vagrant/img/vagrant.png b/contrib/vagrant/img/vagrant.png new file mode 100644 index 000000000..3d2544442 Binary files /dev/null and b/contrib/vagrant/img/vagrant.png differ diff --git a/contrib/vagrant/packages.el b/contrib/vagrant/packages.el new file mode 100644 index 000000000..c9a9e39a7 --- /dev/null +++ b/contrib/vagrant/packages.el @@ -0,0 +1,36 @@ +;;; packages.el --- Vagrant Layer extensions File for Spacemacs +;; +;; Copyright (c) 2012-2014 Sylvain Benner +;; Copyright (c) 2015 Brian Hicks & Contributors +;; +;; Author: Brian Hicks +;; URL: https://github.com/syl20bnr/spacemacs +;; +;; This file is not part of GNU Emacs. +;; +;;; License: GPLv3 +(defvar vagrant-packages '(vagrant + 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)))) + +(defun vagrant/init-vagrant-tramp () + (use-package vagrant-tramp + :defer t + :init (progn + (vagrant-tramp-enable) + (evil-leader/set-key + "Vt" 'vagrant-tramp-term))))