From 23006ed21debd05fa2ad292702bb6f34bf7d1a9a Mon Sep 17 00:00:00 2001 From: Fabien Dubosson Date: Sun, 24 Jan 2016 20:31:22 +0100 Subject: [PATCH] Add systemd layer --- layers/+config-files/systemd/README.org | 25 ++++++++++++++++++++++ layers/+config-files/systemd/packages.el | 27 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 layers/+config-files/systemd/README.org create mode 100644 layers/+config-files/systemd/packages.el diff --git a/layers/+config-files/systemd/README.org b/layers/+config-files/systemd/README.org new file mode 100644 index 000000000..82a9a986d --- /dev/null +++ b/layers/+config-files/systemd/README.org @@ -0,0 +1,25 @@ +#+TITLE: systemd layer +#+HTML_HEAD_EXTRA: + +* 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 | +|---------------+--------------------------------------------------------------------------| +| ~ m h d~ | Systemd open the directives documentation | +| ~ m h o~ | Systemd open documentation (if a =\=Documentation= directive is provided | diff --git a/layers/+config-files/systemd/packages.el b/layers/+config-files/systemd/packages.el new file mode 100644 index 000000000..f02c024a1 --- /dev/null +++ b/layers/+config-files/systemd/packages.el @@ -0,0 +1,27 @@ +;;; packages.el --- systemd layer packages file for Spacemacs. +;; +;; Copyright (c) 2012-2016 Sylvain Benner & Contributors +;; +;; Author: Fabien Dubosson +;; 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