Collect helm configuration from spacemacs and spacemacs-base into one place. The purpose is to allow choice between this layer and spacemacs-ivy.
40 lines
1.6 KiB
EmacsLisp
40 lines
1.6 KiB
EmacsLisp
;;; keybindings.el --- Spacemacs Base Layer key-bindings File
|
|
;;
|
|
;; Copyright (c) 2012-2014 Sylvain Benner
|
|
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
|
|
;;
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
;;
|
|
;; This file is not part of GNU Emacs.
|
|
;;
|
|
;;; License: GPLv3
|
|
|
|
;; describe functions ---------------------------------------------------------
|
|
(defmacro spacemacs||set-helm-key (keys func)
|
|
"Define a key bindings for FUNC using KEYS.
|
|
Ensure that helm is required before calling FUNC."
|
|
(let ((func-name (intern (format "spacemacs/%s" (symbol-name func)))))
|
|
`(progn
|
|
(defun ,func-name ()
|
|
,(format "Wrapper to ensure that `helm' is loaded before calling %s."
|
|
(symbol-name func))
|
|
(interactive)
|
|
(require 'helm)
|
|
(call-interactively ',func))
|
|
(spacemacs/set-leader-keys ,keys ',func-name))))
|
|
(spacemacs||set-helm-key "hdb" describe-bindings)
|
|
(spacemacs||set-helm-key "hdc" describe-char)
|
|
(spacemacs||set-helm-key "hdf" describe-function)
|
|
(spacemacs||set-helm-key "hdk" describe-key)
|
|
(spacemacs||set-helm-key "hdm" describe-mode)
|
|
(spacemacs||set-helm-key "hdp" describe-package)
|
|
(spacemacs/set-leader-keys "hds" 'spacemacs/describe-system-info)
|
|
(spacemacs||set-helm-key "hdt" describe-theme)
|
|
(spacemacs||set-helm-key "hdv" describe-variable)
|
|
(spacemacs||set-helm-key "hn" view-emacs-news)
|
|
(spacemacs||set-helm-key "hL" helm-locate-library)
|
|
;; search functions -----------------------------------------------------------
|
|
(spacemacs||set-helm-key "sww" helm-wikipedia-suggest)
|
|
(spacemacs||set-helm-key "swg" helm-google-suggest)
|