Add puppet contrib layer
This is the layer for puppet-mode. It has bindings for all available puppet-mode key commands under `<SPC> m`
This commit is contained in:
parent
02da569a3b
commit
38faa15ebe
49
contrib/lang/puppet/README.md
Normal file
49
contrib/lang/puppet/README.md
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# Puppet contribution layer for Spacemacs
|
||||||
|
|
||||||
|
![logo](img/puppet.png)
|
||||||
|
|
||||||
|
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
|
||||||
|
**Table of Contents**
|
||||||
|
|
||||||
|
- [Puppet contribution layer for Spacemacs](#puppet-contribution-layer-for-spacemacs)
|
||||||
|
- [Description](#description)
|
||||||
|
- [Install](#install)
|
||||||
|
- [Key bindings](#key-bindings)
|
||||||
|
|
||||||
|
<!-- markdown-toc end -->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
This layer aims at providing support for the Puppet DSL using [puppet-mode][].
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
To use this contribution add it to your `~/.spacemacs`
|
||||||
|
|
||||||
|
```elisp
|
||||||
|
(setq-default dotspacemacs-configuration-layers '(puppet)
|
||||||
|
"List of contribution to load."
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Key bindings
|
||||||
|
|
||||||
|
The following key bindings are available in Puppet Mode:
|
||||||
|
|
||||||
|
Key Binding | Description
|
||||||
|
------------|--------------------------------------------------
|
||||||
|
`<SPC> m {` | Move to the beginning of the current block
|
||||||
|
`<SPC> m }` | Move to the end of the current block
|
||||||
|
`<SPC> m a` | Align parameters in the current block
|
||||||
|
`<SPC> m '` | Toggle string quoting between single and double
|
||||||
|
`<SPC> m ;` | Blank the string at point
|
||||||
|
`<SPC> m j` | Jump to a `class`, `define`, variable or resource
|
||||||
|
`<SPC> m c` | Apply the current manifest in dry-run mode
|
||||||
|
`<SPC> m v` | Validate the syntax of the current manifest
|
||||||
|
`<SPC> m l` | Check the current manifest for semantic issues
|
||||||
|
`<SPC> m $` | Interpolate with ${} in double quoted strings
|
||||||
|
|
||||||
|
|
||||||
|
Use `M-x customize-group RET puppet` to customize Puppet Mode.
|
||||||
|
|
||||||
|
[puppet-mode]: https://github.com/lunaryorn/puppet-mode
|
BIN
contrib/lang/puppet/img/puppet.png
Normal file
BIN
contrib/lang/puppet/img/puppet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 78 KiB |
38
contrib/lang/puppet/packages.el
Normal file
38
contrib/lang/puppet/packages.el
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
(defvar puppet-packages
|
||||||
|
'(
|
||||||
|
;; package puppets go here
|
||||||
|
puppet-mode
|
||||||
|
)
|
||||||
|
"List of all packages to install and/or initialize. Built-in packages
|
||||||
|
which require an initialization must be listed explicitly in the list.")
|
||||||
|
|
||||||
|
(defvar puppet-excluded-packages '())
|
||||||
|
|
||||||
|
;; For each package, define a function puppet-mode/init-<package-puppet-mode>
|
||||||
|
;;
|
||||||
|
;; (defun puppet-mode/init-my-package ()
|
||||||
|
;; "Initialize my package"
|
||||||
|
;; )
|
||||||
|
;;
|
||||||
|
;; Often the body of an initialize function uses `use-package'
|
||||||
|
;; For more info on `use-package', see readme:
|
||||||
|
;; https://github.com/jwiegley/use-package
|
||||||
|
|
||||||
|
(defun puppet/init-puppet-mode ()
|
||||||
|
"Initialize Puppet mode"
|
||||||
|
(use-package puppet-mode
|
||||||
|
:defer t
|
||||||
|
:init
|
||||||
|
(progn
|
||||||
|
(evil-leader/set-key-for-mode 'puppet-mode
|
||||||
|
"m{" 'beginning-of-defun
|
||||||
|
"m}" 'end-of-defun
|
||||||
|
"m$" 'puppet-interpolate
|
||||||
|
"ma" 'puppet-align-block
|
||||||
|
"m'" 'puppet-toggle-string-quotes
|
||||||
|
"m;" 'puppet-clear-string
|
||||||
|
"mj" 'imenu
|
||||||
|
"mc" 'puppet-apply
|
||||||
|
"mv" 'puppet-validate
|
||||||
|
"ml" 'puppet-lint
|
||||||
|
))))
|
Loading…
Reference in a new issue