Add systemd layer

This commit is contained in:
Fabien Dubosson 2016-01-24 20:31:22 +01:00 committed by syl20bnr
parent 6f21ccbc64
commit 23006ed21d
2 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,25 @@
#+TITLE: systemd layer
#+HTML_HEAD_EXTRA: <link rel="stylesheet" type="text/css" href="../css/readtheorg.css" />
* Table of Contents :TOC_4_org:noexport:
- [[Description][Description]]
- [[Install][Install]]
- [[Key bindings][Key bindings]]
* Description
This layer provides syntax highlighting for systemd files and completion through
=company= if the =auto-completion= layer is used.
* Install
To use this contribution add it to your =~/.spacemacs=
#+begin_src emacs-lisp
(setq-default dotspacemacs-configuration-layers '(systemd))
#+end_src
* Key bindings
| Key Binding | Description |
|---------------+--------------------------------------------------------------------------|
| ~<SPC> m h d~ | Systemd open the directives documentation |
| ~<SPC> m h o~ | Systemd open documentation (if a =\=Documentation= directive is provided |

View file

@ -0,0 +1,27 @@
;;; packages.el --- systemd layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Fabien Dubosson <fabien.dubosson@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defconst systemd-packages
'(systemd)
"The list of Lisp packages required by the systemd layer.")
(defun systemd/init-systemd ()
(use-package systemd
:defer t
:init
(when (configuration-layer/package-usedp 'company)
(setq systemd-use-company-p t))
:config
(spacemacs/set-leader-keys-for-major-mode 'systemd-mode
"hd" 'systemd-doc-directives
"ho" 'systemd-doc-open)))
;;; packages.el ends here