| @ -0,0 +1,12 @@ | |||||
| Spacemacs at your fingertips... in your browser! | |||||
| Thanks to @JAremko's wonderful work, it is now possible to try out Spacemacs in | |||||
| the browser. | |||||
| Try it on your phone and be amazed that even without any modifier you can still | |||||
| use Emacs thanks to the 'spacebar' and 'fd' available on any touch keyboard. | |||||
| We are looking into useful applications of this feature, if you want to share some | |||||
| ideas you can post on https://github.com/syl20bnr/spacemacs/issues/8634 :heart: | |||||
| Go to http://spacemacs.org to test it now! | |||||
| @ -0,0 +1,20 @@ | |||||
| Spacemacs at your fingertips... in your browser! | |||||
| You are not dreaming, this is not an alien technology coming from the futur. | |||||
| Spacemacs has been ported to the WEB! | |||||
| Better than that, our technology flawlessly compiles Emacs Lisp on the fly to | |||||
| Javascript thanks to the last version of our transpiler. Yes! This very same | |||||
| transpiler which was capable to transpile Emacs Lisp to Vimscript, except Java | |||||
| is better than Vim so we decided to go nuts and support the supperior | |||||
| Javascript. | |||||
| Spacemacs can benefit from all the candies provided by a WEB browser like being | |||||
| able to run on any device supporting a decent browser, try it on your phone and | |||||
| be amazed that even without any modifier you can still use Emacs thanks to the | |||||
| 'spacebar' and 'fd' or not... | |||||
| Now Spacemacs can really be like all the cool kids. | |||||
| Go to http://spacemacs.org to test it NOW! | |||||
| @ -0,0 +1,360 @@ | |||||
| ;;; ido-vertical-mode.el --- Makes ido-mode display vertically. | |||||
| ;; Copyright (C) 2013, 2014 Steven Degutis | |||||
| ;; Author: Steven Degutis | |||||
| ;; Maintainer: Christopher Reichert <creichert07@gmail.com> | |||||
| ;; Version: 1.0.0 | |||||
| ;; Package-Version: 20160429.1037 | |||||
| ;; Keywords: convenience | |||||
| ;; URL: https://github.com/creichert/ido-vertical-mode.el | |||||
| ;; This program is free software; you can redistribute it and/or modify | |||||
| ;; it under the terms of the GNU General Public License as published by | |||||
| ;; the Free Software Foundation, either version 3 of the License, or | |||||
| ;; (at your option) any later version. | |||||
| ;; This program is distributed in the hope that it will be useful, | |||||
| ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| ;; GNU General Public License for more details. | |||||
| ;; You should have received a copy of the GNU General Public License | |||||
| ;; along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| ;;; Commentary: | |||||
| ;; Makes ido-mode display prospects vertically | |||||
| ;;; Code: | |||||
| (require 'ido) | |||||
| ;;; The following three variables and their comments are lifted | |||||
| ;;; directly from `ido.el'; they are defined here to avoid compile-log | |||||
| ;;; warnings. See `ido.el' for more information. | |||||
| ;; Non-nil if we should add [confirm] to prompt | |||||
| (defvar ido-show-confirm-message) | |||||
| ;; Remember if current directory is non-readable (so we cannot do completion). | |||||
| (defvar ido-directory-nonreadable) | |||||
| ;; Remember if current directory is 'huge' (so we don't want to do completion). | |||||
| (defvar ido-directory-too-big) | |||||
| (defcustom ido-vertical-indicator "->" | |||||
| "Indicator displayed next to the candidate that will be selected." | |||||
| :type 'string | |||||
| :group 'ido-vertical-mode) | |||||
| (defvar ido-vertical-decorations | |||||
| `(,(format "\n%s " ido-vertical-indicator) ; left bracket around prospect list | |||||
| "" ; right bracket around prospect list | |||||
| "\n " ; separator between prospects, depends on `ido-separator` | |||||
| "\n ..." ; inserted at the end of a truncated list of prospects | |||||
| "[" ; left bracket around common match string | |||||
| "]" ; right bracket around common match string | |||||
| " [No match]" | |||||
| " [Matched]" | |||||
| " [Not readable]" | |||||
| " [Too big]" | |||||
| " [Confirm]" | |||||
| ,(format "\n%s " ido-vertical-indicator) ; left bracket around the sole remaining completion | |||||
| "" ; right bracket around the sole remaining completion | |||||
| ) | |||||
| "Changing the decorations does most of the work for ido-vertical | |||||
| This sets up newlines and arrows before, between, and after the | |||||
| prospects. For additional information, see `ido-decorations'.") | |||||
| (defvar ido-vertical-old-decorations nil | |||||
| "The original `ido-decorations' variable | |||||
| We need to keep track of the original value so we can restore it | |||||
| when turning `ido-vertical-mode' off") | |||||
| (defvar ido-vertical-old-completions nil | |||||
| "The original `ido-completions' function | |||||
| We need to keep track of the original value of `ido-completions' | |||||
| so we can restore it when turning `ido-vertical-mode' off") | |||||
| (defgroup ido-vertical-mode nil | |||||
| "Make ido behave vertically." | |||||
| :group 'ido) | |||||
| (defcustom ido-vertical-show-count nil | |||||
| "Non nil means show the count of candidates while completing." | |||||
| :type 'boolean | |||||
| :group 'ido-vertical-mode) | |||||
| (defvar ido-vertical-count-active nil | |||||
| "Used internally to track whether we're already showing the count") | |||||
| (defcustom ido-vertical-define-keys nil | |||||
| "Defines which keys that `ido-vertical-mode' redefines." | |||||
| :type '(choice | |||||
| (const :tag "Keep default ido keys." nil) | |||||
| (const :tag "C-p and C-n are up & down in match" C-n-and-C-p-only) | |||||
| (const :tag "C-p/up and C-n/down are up and down in match." C-n-C-p-up-and-down) | |||||
| (const :tag "C-p/up, C-n/down are up/down in match. left or right cycle history or directory." C-n-C-p-up-down-left-right)) | |||||
| :group 'ido-vertical-mode) | |||||
| (defcustom ido-vertical-pad-list t | |||||
| "Non nil means to pad the list of candidates to ensure the minibuffer area is always tall" | |||||
| :type 'boolean | |||||
| :group 'ido-vertical-mode) | |||||
| (defcustom ido-vertical-disable-if-short nil | |||||
| "Non nil means that ido will go back to horizontal mode if the candidates all fit in the minibuffer area" | |||||
| :type 'boolean | |||||
| :group 'ido-vertical-mode) | |||||
| (defface ido-vertical-first-match-face | |||||
| '((t (:inherit ido-first-match))) | |||||
| "Face used by Ido Vertical for highlighting first match." | |||||
| :group 'ido-vertical-mode) | |||||
| (defface ido-vertical-only-match-face | |||||
| '((t (:inherit ido-only-match))) | |||||
| "Face used by Ido Vertical for highlighting only match." | |||||
| :group 'ido-vertical-mode) | |||||
| (defface ido-vertical-match-face | |||||
| '((t (:inherit font-lock-variable-name-face :bold t :underline t))) | |||||
| "Face used by Ido Vertical for the matched part." | |||||
| :group 'ido-vertical-mode) | |||||
| (defun ido-vertical-or-horizontal-completions (name) | |||||
| (if (and ido-vertical-disable-if-short | |||||
| (<= (length ido-matches) ido-max-prospects)) | |||||
| (let ((short-result | |||||
| (let ((ido-decorations ido-vertical-old-decorations)) | |||||
| (funcall ido-vertical-old-completions name)))) | |||||
| (if (>= (window-body-width (minibuffer-window)) | |||||
| (+ (minibuffer-prompt-width) | |||||
| (length short-result))) | |||||
| short-result | |||||
| (ido-vertical-completions name))) | |||||
| (ido-vertical-completions name))) | |||||
| ;; borrowed from ido.el and modified to work better when vertical | |||||
| (defun ido-vertical-completions (name) | |||||
| ;; Return the string that is displayed after the user's text. | |||||
| ;; Modified from `icomplete-completions'. | |||||
| (let* ((comps ido-matches) | |||||
| (ind (and (consp (car comps)) (> (length (cdr (car comps))) 1) | |||||
| ido-merged-indicator)) | |||||
| (lencomps (length comps)) | |||||
| (additional-items-indicator (nth 3 ido-decorations)) | |||||
| (comps-empty (null comps)) | |||||
| (ncomps lencomps) | |||||
| first) | |||||
| ;; Keep the height of the suggestions list constant by padding | |||||
| ;; when lencomps is too small. Also, if lencomps is too short, we | |||||
| ;; should not indicate that there are additional prospects. | |||||
| (when (< lencomps (1+ ido-max-prospects)) | |||||
| (setq additional-items-indicator "\n") | |||||
| (when ido-vertical-pad-list | |||||
| (setq comps (append comps (make-list (- (1+ ido-max-prospects) lencomps) ""))) | |||||
| (setq ncomps (length comps)))) | |||||
| (if (not ido-incomplete-regexp) | |||||
| (when ido-use-faces | |||||
| ;; Make a copy of [ido-matches], otherwise the selected string | |||||
| ;; could contain text properties which could lead to weird | |||||
| ;; artifacts, e.g. buffer-file-name having text properties. | |||||
| (when (eq comps ido-matches) | |||||
| (setq comps (copy-sequence ido-matches))) | |||||
| (dotimes (i ncomps) | |||||
| (let ((comps-i (nth i comps))) | |||||
| (setf comps-i | |||||
| (setf (nth i comps) (substring (if (listp comps-i) | |||||
| (car comps-i) | |||||
| comps-i) | |||||
| 0))) | |||||
| (when (string-match (if ido-enable-regexp name (regexp-quote name)) comps-i) | |||||
| (ignore-errors | |||||
| (add-face-text-property (match-beginning 0) | |||||
| (match-end 0) | |||||
| 'ido-vertical-match-face | |||||
| nil comps-i))))))) | |||||
| (if (and ind ido-use-faces) | |||||
| (put-text-property 0 1 'face 'ido-indicator ind)) | |||||
| (when ido-vertical-show-count | |||||
| (setcar ido-vertical-decorations (format " [%d]\n%s " lencomps ido-vertical-indicator)) | |||||
| (setq ido-vertical-count-active t)) | |||||
| (when (and (not ido-vertical-show-count) | |||||
| ido-vertical-count-active) | |||||
| (setcar ido-vertical-decorations (format "\n%s "ido-vertical-indicator)) | |||||
| (setq ido-vertical-count-active nil)) | |||||
| (if (and ido-use-faces comps) | |||||
| (let* ((fn (ido-name (car comps))) | |||||
| (ln (length fn))) | |||||
| (setq first (format "%s" fn)) | |||||
| (if (fboundp 'add-face-text-property) | |||||
| (add-face-text-property 0 (length first) | |||||
| (cond ((> lencomps 1) | |||||
| 'ido-vertical-first-match-face) | |||||
| (ido-incomplete-regexp | |||||
| 'ido-incomplete-regexp) | |||||
| (t | |||||
| 'ido-vertical-only-match-face)) | |||||
| nil first) | |||||
| (put-text-property 0 ln 'face | |||||
| (if (= lencomps 1) | |||||
| (if ido-incomplete-regexp | |||||
| 'ido-incomplete-regexp | |||||
| 'ido-vertical-only-match-face) | |||||
| 'ido-vertical-first-match-face) | |||||
| first)) | |||||
| (if ind (setq first (concat first ind))) | |||||
| (setq comps (cons first (cdr comps))))) | |||||
| ;; Previously we'd check null comps to see if the list was | |||||
| ;; empty. We pad the list with empty items to keep the list at a | |||||
| ;; constant height, so we have to check if the entire list is | |||||
| ;; empty, instead of (null comps) | |||||
| (cond (comps-empty | |||||
| (cond | |||||
| (ido-show-confirm-message | |||||
| (or (nth 10 ido-decorations) " [Confirm]")) | |||||
| (ido-directory-nonreadable | |||||
| (or (nth 8 ido-decorations) " [Not readable]")) | |||||
| (ido-directory-too-big | |||||
| (or (nth 9 ido-decorations) " [Too big]")) | |||||
| (ido-report-no-match | |||||
| (nth 6 ido-decorations)) ;; [No match] | |||||
| (t ""))) | |||||
| (ido-incomplete-regexp | |||||
| (concat " " (car comps))) | |||||
| ((null (cdr comps)) ;one match | |||||
| (concat (concat (nth 11 ido-decorations) ;; [ ... ] | |||||
| (ido-name (car comps)) | |||||
| (nth 12 ido-decorations)) | |||||
| (if (not ido-use-faces) (nth 7 ido-decorations)))) ;; [Matched] | |||||
| (t ;multiple matches | |||||
| (let* ((items (if (> ido-max-prospects 0) (1+ ido-max-prospects) 999)) | |||||
| (alternatives | |||||
| (apply | |||||
| #'concat | |||||
| (cdr (apply | |||||
| #'nconc | |||||
| (mapcar | |||||
| (lambda (com) | |||||
| (setq com (ido-name com)) | |||||
| (setq items (1- items)) | |||||
| (cond | |||||
| ((< items 0) ()) | |||||
| ((= items 0) (list additional-items-indicator)) ; " | ..." | |||||
| (t | |||||
| (list (nth 2 ido-decorations) ; " | " | |||||
| (let ((str (substring com 0))) | |||||
| (if (and ido-use-faces | |||||
| (not (string= str first)) | |||||
| (ido-final-slash str)) | |||||
| (put-text-property 0 (length str) 'face 'ido-subdir str)) | |||||
| str))))) | |||||
| comps)))))) | |||||
| (concat | |||||
| ;; put in common completion item -- what you get by pressing tab | |||||
| (if (and (stringp ido-common-match-string) | |||||
| (> (length ido-common-match-string) (length name))) | |||||
| (concat (nth 4 ido-decorations) ;; [ ... ] | |||||
| (substring ido-common-match-string (length name)) | |||||
| (nth 5 ido-decorations))) | |||||
| ;; list all alternatives | |||||
| (nth 0 ido-decorations) ;; { ... } | |||||
| alternatives | |||||
| (nth 1 ido-decorations))))))) | |||||
| (defun ido-vertical-disable-line-truncation () | |||||
| "Prevent the newlines in the minibuffer from being truncated" | |||||
| (set (make-local-variable 'truncate-lines) nil)) | |||||
| (defun turn-on-ido-vertical () | |||||
| (if (and (eq nil ido-vertical-old-decorations) | |||||
| (eq nil ido-vertical-old-completions)) | |||||
| (progn | |||||
| (setq ido-vertical-old-decorations ido-decorations) | |||||
| (setq ido-vertical-old-completions (symbol-function 'ido-completions)))) | |||||
| (setq ido-decorations ido-vertical-decorations) | |||||
| (fset 'ido-completions 'ido-vertical-or-horizontal-completions) | |||||
| (add-hook 'ido-minibuffer-setup-hook 'ido-vertical-disable-line-truncation) | |||||
| (add-hook 'ido-setup-hook 'ido-vertical-define-keys)) | |||||
| (defun turn-off-ido-vertical () | |||||
| (setq ido-decorations ido-vertical-old-decorations) | |||||
| (fset 'ido-completions ido-vertical-old-completions) | |||||
| (remove-hook 'ido-minibuffer-setup-hook 'ido-vertical-disable-line-truncation) | |||||
| (remove-hook 'ido-setup-hook 'ido-vertical-define-keys)) | |||||
| (defun ido-vertical-next-match () | |||||
| "Call the correct next-match function for right key. | |||||
| This is based on: | |||||
| - Different functions for completing directories and prior history. | |||||
| " | |||||
| (interactive) | |||||
| (cond | |||||
| ((and (boundp 'item) item (eq item 'file)) | |||||
| (ido-next-match-dir)) | |||||
| (t | |||||
| (next-history-element 1)))) | |||||
| (defun ido-vertical-prev-match () | |||||
| "Call the correct prev-match function for left key. | |||||
| This is based on: | |||||
| - Different functions for completing directories and prior history. | |||||
| " | |||||
| (interactive) | |||||
| (cond | |||||
| ((and (boundp 'item) item (eq item 'file)) | |||||
| (ido-prev-match-dir)) | |||||
| (t | |||||
| (previous-history-element 1)))) | |||||
| (defun ido-vertical-define-keys () ;; C-n/p is more intuitive in vertical layout | |||||
| (when ido-vertical-define-keys | |||||
| (define-key ido-completion-map (kbd "C-n") 'ido-next-match) | |||||
| (define-key ido-completion-map (kbd "C-p") 'ido-prev-match) | |||||
| (define-key ido-completion-map (kbd "C-c C-t") 'ido-toggle-prefix)) | |||||
| (when (memq ido-vertical-define-keys '(C-n-C-p-up-and-down C-n-C-p-up-down-left-right)) | |||||
| (define-key ido-completion-map (kbd "<up>") 'ido-prev-match) | |||||
| (define-key ido-completion-map (kbd "<down>") 'ido-next-match)) | |||||
| (when (eq ido-vertical-define-keys 'C-n-C-p-up-down-left-right) | |||||
| (define-key ido-completion-map (kbd "<left>") 'ido-vertical-prev-match) | |||||
| (define-key ido-completion-map (kbd "<right>") 'ido-vertical-next-match))) | |||||
| ;;;###autoload | |||||
| (define-minor-mode ido-vertical-mode | |||||
| "Makes ido-mode display vertically." | |||||
| :global t | |||||
| :group 'ido-vertical-mode | |||||
| (if ido-vertical-mode | |||||
| (turn-on-ido-vertical) | |||||
| (turn-off-ido-vertical))) | |||||
| (provide 'ido-vertical-mode) | |||||
| ;; Local Variables: | |||||
| ;; indent-tabs-mode: nil | |||||
| ;; End: | |||||
| ;;; ido-vertical-mode.el ends here | |||||
| @ -0,0 +1,654 @@ | |||||
| ;;; quelpa.el --- Emacs Lisp packages built directly from source | |||||
| ;; Copyright 2014-2015, Steckerhalter | |||||
| ;; Copyright 2014-2015, Vasilij Schneidermann <v.schneidermann@gmail.com> | |||||
| ;; Author: steckerhalter | |||||
| ;; URL: https://github.com/quelpa/quelpa | |||||
| ;; Version: 0.0.1 | |||||
| ;; Package-Requires: ((package-build "0") (emacs "24.3")) | |||||
| ;; Keywords: package management build source elpa | |||||
| ;; This file is not part of GNU Emacs. | |||||
| ;; This file is free software; you can redistribute it and/or modify | |||||
| ;; it under the terms of the GNU General Public License as published by | |||||
| ;; the Free Software Foundation; either version 3, or (at your option) | |||||
| ;; any later version. | |||||
| ;; This file is distributed in the hope that it will be useful, | |||||
| ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| ;; GNU General Public License for more details. | |||||
| ;; You should have received a copy of the GNU General Public License | |||||
| ;; along with GNU Emacs; see the file COPYING. If not, write to | |||||
| ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |||||
| ;; Boston, MA 02111-1307, USA. | |||||
| ;;; Commentary: | |||||
| ;; Your personal local Emacs Lisp Package Archive (ELPA) with packages | |||||
| ;; built on-the-fly directly from source. | |||||
| ;; See the README for more info: | |||||
| ;; https://github.com/quelpa/quelpa/blob/master/README.md | |||||
| ;;; Requirements: | |||||
| ;; Emacs 24.3.1 | |||||
| ;;; Code: | |||||
| (require 'package-build) | |||||
| (require 'cl-lib) | |||||
| (require 'help-fns) | |||||
| (require 'url-parse) | |||||
| ;; --- customs / variables --------------------------------------------------- | |||||
| (defgroup quelpa nil | |||||
| "Build and install packages from source code" | |||||
| :group 'package) | |||||
| (defcustom quelpa-upgrade-p nil | |||||
| "When non-nil, `quelpa' will try to upgrade packages. | |||||
| The global value can be overridden for each package by supplying | |||||
| the `:upgrade' argument." | |||||
| :group 'quelpa | |||||
| :type 'boolean) | |||||
| (defcustom quelpa-stable-p nil | |||||
| "When non-nil, try to build stable packages like MELPA does." | |||||
| :group 'quelpa | |||||
| :type 'boolean) | |||||
| (defcustom quelpa-verbose t | |||||
| "When non-nil, `quelpa' prints log messages." | |||||
| :group 'quelpa | |||||
| :type 'boolean) | |||||
| (defcustom quelpa-before-hook nil | |||||
| "List of functions to be called before quelpa." | |||||
| :group 'quelpa | |||||
| :type 'hook) | |||||
| (defcustom quelpa-after-hook nil | |||||
| "List of functions to be called after quelpa." | |||||
| :group 'quelpa | |||||
| :type 'hook) | |||||
| (defcustom quelpa-dir (expand-file-name "quelpa" user-emacs-directory) | |||||
| "Where quelpa builds and stores packages." | |||||
| :group 'quelpa | |||||
| :type 'string) | |||||
| (defcustom quelpa-melpa-dir (expand-file-name "melpa" quelpa-dir) | |||||
| "Where the melpa repo cloned to." | |||||
| :group 'quelpa | |||||
| :type 'string) | |||||
| (defcustom quelpa-build-dir (expand-file-name "build" quelpa-dir) | |||||
| "Where quelpa builds packages." | |||||
| :group 'quelpa | |||||
| :type 'string) | |||||
| (defcustom quelpa-packages-dir (expand-file-name "packages" quelpa-dir) | |||||
| "Where quelpa puts built packages." | |||||
| :group 'quelpa | |||||
| :type 'string) | |||||
| (defcustom quelpa-melpa-recipe-stores (list (expand-file-name | |||||
| "recipes" | |||||
| quelpa-melpa-dir)) | |||||
| "Recipe stores where quelpa finds default recipes for packages. | |||||
| A store can either be a string pointing to a directory with | |||||
| recipe files or a list with recipes." | |||||
| :group 'quelpa | |||||
| :type '(repeat | |||||
| (choice directory | |||||
| (repeat | |||||
| :tag "List of recipes" | |||||
| (restricted-sexp :tag "Recipe" | |||||
| :match-alternatives (listp)))))) | |||||
| (defcustom quelpa-persistent-cache-file (expand-file-name "cache" quelpa-dir) | |||||
| "Location of the persistent cache file." | |||||
| :group 'quelpa | |||||
| :type 'string) | |||||
| (defcustom quelpa-persistent-cache-p t | |||||
| "Non-nil when quelpa's cache is saved on and read from disk." | |||||
| :group 'quelpa | |||||
| :type 'boolean) | |||||
| (defcustom quelpa-checkout-melpa-p t | |||||
| "If non-nil the MELPA git repo is cloned when quelpa is initialized." | |||||
| :group 'quelpa | |||||
| :type 'boolean) | |||||
| (defcustom quelpa-update-melpa-p t | |||||
| "If non-nil the MELPA git repo is updated when quelpa is initialized. | |||||
| If nil the update is disabled and the repo is only updated on | |||||
| `quelpa-upgrade' or `quelpa-self-upgrade'." | |||||
| :group 'quelpa | |||||
| :type 'boolean) | |||||
| (defcustom quelpa-melpa-repo-url "https://github.com/melpa/melpa.git" | |||||
| "The melpa git repository url." | |||||
| :group 'quelpa | |||||
| :type 'string) | |||||
| (defvar quelpa-initialized-p nil | |||||
| "Non-nil when quelpa has been initialized.") | |||||
| (defvar quelpa-cache nil | |||||
| "The `quelpa' command stores processed pkgs/recipes in the cache.") | |||||
| (defvar quelpa-recipe '(quelpa :repo "quelpa/quelpa" :fetcher github) | |||||
| "The recipe for quelpa.") | |||||
| ;; --- compatibility for legacy `package.el' in Emacs 24.3 ------------------- | |||||
| (defun quelpa-setup-package-structs () | |||||
| "Setup the struct `package-desc' when not available. | |||||
| `package-desc-from-legacy' is provided to convert the legacy | |||||
| vector desc into a valid PACKAGE-DESC." | |||||
| (unless (functionp 'package-desc-p) | |||||
| (cl-defstruct | |||||
| (package-desc | |||||
| (:constructor | |||||
| ;; convert legacy package desc into PACKAGE-DESC | |||||
| package-desc-from-legacy | |||||
| (pkg-info kind | |||||
| &aux | |||||
| (name (intern (aref pkg-info 0))) | |||||
| (version (version-to-list (aref pkg-info 3))) | |||||
| (summary (if (string= (aref pkg-info 2) "") | |||||
| "No description available." | |||||
| (aref pkg-info 2))) | |||||
| (reqs (aref pkg-info 1)) | |||||
| (kind kind)))) | |||||
| name | |||||
| version | |||||
| (summary "No description available.") | |||||
| reqs | |||||
| kind | |||||
| archive | |||||
| dir | |||||
| extras | |||||
| signed))) | |||||
| ;; --- package building ------------------------------------------------------ | |||||
| (defun quelpa-package-type (file) | |||||
| "Determine the package type of FILE. | |||||
| Return `tar' for tarball packages, `single' for single file | |||||
| packages, or nil, if FILE is not a package." | |||||
| (let ((ext (file-name-extension file))) | |||||
| (cond | |||||
| ((string= ext "tar") 'tar) | |||||
| ((string= ext "el") 'single) | |||||
| (:else nil)))) | |||||
| (defun quelpa-get-package-desc (file) | |||||
| "Extract and return the PACKAGE-DESC struct from FILE. | |||||
| On error return nil." | |||||
| (let* ((kind (quelpa-package-type file)) | |||||
| (desc (with-demoted-errors "Error getting PACKAGE-DESC: %s" | |||||
| (with-temp-buffer | |||||
| (pcase kind | |||||
| (`single (insert-file-contents file) | |||||
| (package-buffer-info)) | |||||
| (`tar (insert-file-contents-literally file) | |||||
| (tar-mode) | |||||
| (if (help-function-arglist 'package-tar-file-info) | |||||
| ;; legacy `package-tar-file-info' requires an arg | |||||
| (package-tar-file-info file) | |||||
| (with-no-warnings (package-tar-file-info))))))))) | |||||
| (pcase desc | |||||
| ((pred package-desc-p) desc) | |||||
| ((pred vectorp) (package-desc-from-legacy desc kind))))) | |||||
| (defun quelpa-archive-file-name (archive-entry) | |||||
| "Return the path of the file in which the package for ARCHIVE-ENTRY is stored." | |||||
| (let* ((name (car archive-entry)) | |||||
| (pkg-info (cdr archive-entry)) | |||||
| (version (package-version-join (aref pkg-info 0))) | |||||
| (flavour (aref pkg-info 3))) | |||||
| (expand-file-name | |||||
| (format "%s-%s.%s" name version (if (eq flavour 'single) "el" "tar")) | |||||
| quelpa-packages-dir))) | |||||
| (defun quelpa-version>-p (name version) | |||||
| "Return non-nil if VERSION of pkg with NAME is newer than what is currently installed." | |||||
| (not (or (not version) | |||||
| (let ((pkg-desc (cdr (assq name package-alist)))) | |||||
| (and pkg-desc | |||||
| (version-list-<= | |||||
| (version-to-list version) | |||||
| (if (functionp 'package-desc-vers) | |||||
| (package-desc-vers pkg-desc) ;old implementation | |||||
| (package-desc-version (car pkg-desc)))))) | |||||
| ;; Also check built-in packages. | |||||
| (package-built-in-p name (version-to-list version))))) | |||||
| (defun quelpa-checkout (rcp dir) | |||||
| "Return the version of the new package given a RCP. | |||||
| Return nil if the package is already installed and should not be upgraded." | |||||
| (pcase-let ((`(,name . ,config) rcp) | |||||
| (package-build-stable quelpa-stable-p)) | |||||
| (unless (or (and (assq name package-alist) (not quelpa-upgrade-p)) | |||||
| (and (not config) | |||||
| (quelpa-message t "no recipe found for package `%s'" name))) | |||||
| (let ((version (condition-case err | |||||
| (package-build-checkout name config dir) | |||||
| (error (quelpa-message t | |||||
| "failed to checkout `%s': `%s'" | |||||
| name | |||||
| (error-message-string err)) | |||||
| nil)))) | |||||
| (when (quelpa-version>-p name version) | |||||
| version))))) | |||||
| (defun quelpa-build-package (rcp) | |||||
| "Build a package from the given recipe RCP. | |||||
| Uses the `package-build' library to get the source code and build | |||||
| an elpa compatible package in `quelpa-build-dir' storing it in | |||||
| `quelpa-packages-dir'. Return the path to the created file or nil | |||||
| if no action is necessary (like when the package is installed | |||||
| already and should not be upgraded etc)." | |||||
| (let* ((name (car rcp)) | |||||
| (build-dir (expand-file-name (symbol-name name) quelpa-build-dir)) | |||||
| (version (quelpa-checkout rcp build-dir))) | |||||
| (when version | |||||
| (quelpa-archive-file-name | |||||
| (package-build-package (symbol-name name) | |||||
| version | |||||
| (package-build--config-file-list (cdr rcp)) | |||||
| build-dir | |||||
| quelpa-packages-dir))))) | |||||
| ;; --- package-build.el integration ------------------------------------------ | |||||
| (defun quelpa-file-version (file-path type version time-stamp) | |||||
| "Return version of file at FILE-PATH." | |||||
| (if (eq type 'directory) | |||||
| time-stamp | |||||
| (cl-letf* ((package-strip-rcs-id-orig (symbol-function 'package-strip-rcs-id)) | |||||
| ((symbol-function 'package-strip-rcs-id) | |||||
| (lambda (str) | |||||
| (or (funcall package-strip-rcs-id-orig (lm-header "package-version")) | |||||
| (funcall package-strip-rcs-id-orig (lm-header "version")) | |||||
| "0")))) | |||||
| (concat (mapconcat | |||||
| #'number-to-string | |||||
| (package-desc-version (quelpa-get-package-desc file-path)) ".") | |||||
| (pcase version | |||||
| (`original "") | |||||
| (_ (concat "pre0." time-stamp))))))) | |||||
| (defun quelpa-directory-files (path) | |||||
| "Return list of directory files from PATH recursively." | |||||
| (let ((result '())) | |||||
| (mapc | |||||
| (lambda (file) | |||||
| (if (file-directory-p file) | |||||
| (progn | |||||
| ;; When directory is not empty. | |||||
| (when (cddr (directory-files file)) | |||||
| (dolist (subfile (quelpa-directory-files file)) | |||||
| (add-to-list 'result subfile)))) | |||||
| (add-to-list 'result file))) | |||||
| (mapcar | |||||
| (lambda (file) (expand-file-name file path)) | |||||
| ;; Without first two entries because they are always "." and "..". | |||||
| (cddr (directory-files path)))) | |||||
| result)) | |||||
| (defun quelpa-expand-source-file-list (file-path config) | |||||
| "Return list of source files from FILE-PATH corresponding to | |||||
| CONFIG." | |||||
| (let ((source-files | |||||
| (mapcar | |||||
| (lambda (file) (expand-file-name file file-path)) | |||||
| (package-build--expand-source-file-list file-path config)))) | |||||
| ;; Replace any directories in the source file list with the filenames of the | |||||
| ;; files they contain (so that these files can subsequently be hashed). | |||||
| (dolist (file source-files source-files) | |||||
| (when (file-directory-p file) | |||||
| (setq source-files (remove file source-files)) | |||||
| (setq source-files (append source-files | |||||
| (quelpa-directory-files file))))))) | |||||
| (defun quelpa-slurp-file (file) | |||||
| "Return the contents of FILE as a string, or nil if no such | |||||
| file exists." | |||||
| (when (file-exists-p file) | |||||
| (with-temp-buffer | |||||
| (set-buffer-multibyte nil) | |||||
| (setq-local buffer-file-coding-system 'binary) | |||||
| (insert-file-contents-literally file) | |||||
| (buffer-substring-no-properties (point-min) (point-max))))) | |||||
| (defun quelpa-check-hash (name config file-path dir &optional fetcher) | |||||
| "Check if hash of FILE-PATH is different as in STAMP-FILE. | |||||
| If it is different save the new hash and timestamp to STAMP-FILE | |||||
| and return TIME-STAMP, otherwise return OLD-TIME-STAMP." | |||||
| (unless (file-directory-p dir) | |||||
| (make-directory dir)) | |||||
| (let* (files | |||||
| hashes | |||||
| new-stamp-info | |||||
| new-content-hash | |||||
| (time-stamp | |||||
| (replace-regexp-in-string "\\.0" "." (format-time-string "%Y%m%d.%H%M%S"))) | |||||
| (stamp-file (concat (expand-file-name (symbol-name name) dir) ".stamp")) | |||||
| (old-stamp-info (package-build--read-from-file stamp-file)) | |||||
| (old-content-hash (cdr old-stamp-info)) | |||||
| (old-time-stamp (car old-stamp-info)) | |||||
| (type (if (file-directory-p file-path) 'directory 'file)) | |||||
| (version (plist-get config :version))) | |||||
| (if (not (file-exists-p file-path)) | |||||
| (error (quelpa-message t "`%s' does not exist" file-path)) | |||||
| (if (eq type 'directory) | |||||
| (setq files (quelpa-expand-source-file-list file-path config) | |||||
| hashes (mapcar | |||||
| (lambda (file) | |||||
| (secure-hash | |||||
| 'sha1 (concat file (quelpa-slurp-file file)))) files) | |||||
| new-content-hash (secure-hash 'sha1 (mapconcat 'identity hashes ""))) | |||||
| (setq new-content-hash (secure-hash 'sha1 (quelpa-slurp-file file-path))))) | |||||
| (setq new-stamp-info (cons time-stamp new-content-hash)) | |||||
| (if (and old-content-hash | |||||
| (string= new-content-hash old-content-hash)) | |||||
| (quelpa-file-version file-path type version old-time-stamp) | |||||
| (unless (eq fetcher 'url) | |||||
| (delete-directory dir t) | |||||
| (make-directory dir) | |||||
| (if (eq type 'file) | |||||
| (copy-file file-path dir t t t t) | |||||
| (copy-directory file-path dir t t t))) | |||||
| (package-build--dump new-stamp-info stamp-file) | |||||
| (quelpa-file-version file-path type version time-stamp)))) | |||||
| (defun package-build--checkout-file (name config dir) | |||||
| "Build according to a PATH with config CONFIG into DIR as NAME. | |||||
| Generic local file handler for package-build.el. | |||||
| Handles the following cases: | |||||
| local file: | |||||
| Installs a single-file package from a local file. Use the :path | |||||
| attribute with a PATH like \"/path/to/file.el\". | |||||
| local directory: | |||||
| Installs a multi-file package from a local directory. Use | |||||
| the :path attribute with a PATH like \"/path/to/dir\"." | |||||
| (quelpa-check-hash name config (expand-file-name (plist-get config :path)) dir)) | |||||
| (defun package-build--checkout-url (name config dir) | |||||
| "Build according to an URL with config CONFIG into DIR as NAME. | |||||
| Generic URL handler for package-build.el. | |||||
| Handles the following cases: | |||||
| local file: | |||||
| Installs a single-file package from a local file. Use the :url | |||||
| attribute with an URL like \"file:///path/to/file.el\". | |||||
| remote file: | |||||
| Installs a single-file package from a remote file. Use the :url | |||||
| attribute with an URL like \"http://domain.tld/path/to/file.el\"." | |||||
| (let* ((url (plist-get config :url)) | |||||
| (remote-file-name (file-name-nondirectory | |||||
| (url-filename (url-generic-parse-url url)))) | |||||
| (local-path (expand-file-name remote-file-name dir)) | |||||
| (mm-attachment-file-modes (default-file-modes))) | |||||
| (unless (string= (file-name-extension url) "el") | |||||
| (error (quelpa-message t "<%s> does not end in .el" url))) | |||||
| (unless (file-directory-p dir) | |||||
| (make-directory dir)) | |||||
| (url-copy-file url local-path t) | |||||
| (quelpa-check-hash name config local-path dir 'url))) | |||||
| ;; --- helpers --------------------------------------------------------------- | |||||
| (defun quelpa-message (wait format-string &rest args) | |||||
| "Log a message with FORMAT-STRING and ARGS when `quelpa-verbose' is non-nil. | |||||
| If WAIT is nil don't wait after showing the message. If it is a | |||||
| number, wait so many seconds. If WAIT is t wait the default time. | |||||
| Return t in each case." | |||||
| (when quelpa-verbose | |||||
| (message "Quelpa: %s" (apply 'format format-string args)) | |||||
| (when (or (not noninteractive) wait) ; no wait if emacs is noninteractive | |||||
| (sit-for (or (and (numberp wait) wait) 1.5) t))) | |||||
| t) | |||||
| (defun quelpa-read-cache () | |||||
| "Read from `quelpa-persistent-cache-file' in `quelpa-cache'." | |||||
| (when (and quelpa-persistent-cache-p | |||||
| (file-exists-p quelpa-persistent-cache-file)) | |||||
| (with-temp-buffer | |||||
| (insert-file-contents-literally quelpa-persistent-cache-file) | |||||
| (setq quelpa-cache | |||||
| (read (buffer-substring-no-properties (point-min) (point-max))))))) | |||||
| (defun quelpa-save-cache () | |||||
| "Write `quelpa-cache' to `quelpa-persistent-cache-file'." | |||||
| (when quelpa-persistent-cache-p | |||||
| (let (print-level print-length) | |||||
| (with-temp-file quelpa-persistent-cache-file | |||||
| (insert (prin1-to-string quelpa-cache)))))) | |||||
| (defun quelpa-update-cache (cache-item) | |||||
| ;; try removing existing recipes by name | |||||
| (setq quelpa-cache (cl-remove (car cache-item) | |||||
| quelpa-cache :key #'car)) | |||||
| (push cache-item quelpa-cache) | |||||
| (setq quelpa-cache | |||||
| (cl-sort quelpa-cache #'string< | |||||
| :key (lambda (item) (symbol-name (car item)))))) | |||||
| (defun quelpa-parse-stable (cache-item) | |||||
| ;; in case :stable doesn't originate from PLIST, shadow the | |||||
| ;; default value anyways | |||||
| (when (plist-member (cdr cache-item) :stable) | |||||
| (setq quelpa-stable-p (plist-get (cdr cache-item) :stable))) | |||||
| (when (and quelpa-stable-p (not (plist-get (cdr cache-item) :stable))) | |||||
| (setf (cdr (last cache-item)) '(:stable t)))) | |||||
| (defun quelpa-checkout-melpa () | |||||
| "Fetch or update the melpa source code from Github. | |||||
| If there is no error return non-nil. | |||||
| If there is an error but melpa is already checked out return non-nil. | |||||
| If there is an error and no existing checkout return nil." | |||||
| (or (and (null quelpa-update-melpa-p) | |||||
| (file-exists-p (expand-file-name ".git" quelpa-melpa-dir))) | |||||
| (condition-case err | |||||
| (package-build--checkout-git | |||||
| 'package-build | |||||
| `(:url ,quelpa-melpa-repo-url :files ("*")) | |||||
| quelpa-melpa-dir) | |||||
| (error (quelpa-message t "failed to checkout melpa git repo: `%s'" (error-message-string err)) | |||||
| (file-exists-p (expand-file-name ".git" quelpa-melpa-dir)))))) | |||||
| (defun quelpa-get-melpa-recipe (name) | |||||
| "Read recipe with NAME for melpa git checkout. | |||||
| Return the recipe if it exists, otherwise nil." | |||||
| (cl-loop for store in quelpa-melpa-recipe-stores | |||||
| if (stringp store) | |||||
| for file = (assoc-string name (directory-files store nil "^[^\.]+")) | |||||
| when file | |||||
| return (with-temp-buffer | |||||
| (insert-file-contents-literally | |||||
| (expand-file-name file store)) | |||||
| (read (buffer-string))) | |||||
| else | |||||
| for rcp = (assoc-string name store) | |||||
| when rcp | |||||
| return rcp)) | |||||
| (defun quelpa-setup-p () | |||||
| "Setup what we need for quelpa. | |||||
| Return non-nil if quelpa has been initialized properly." | |||||
| (catch 'quit | |||||
| (dolist (dir (list quelpa-packages-dir quelpa-build-dir)) | |||||
| (unless (file-exists-p dir) (make-directory dir t))) | |||||
| (unless quelpa-initialized-p | |||||
| (quelpa-read-cache) | |||||
| (quelpa-setup-package-structs) | |||||
| (if quelpa-checkout-melpa-p | |||||
| (unless (quelpa-checkout-melpa) (throw 'quit nil))) | |||||
| (setq quelpa-initialized-p t)) | |||||
| t)) | |||||
| (defun quelpa-shutdown () | |||||
| "Do things that need to be done after running quelpa." | |||||
| (quelpa-save-cache) | |||||
| ;; remove the packages dir because we are done with the built pkgs | |||||
| (ignore-errors (delete-directory quelpa-packages-dir t))) | |||||
| (defun quelpa-arg-rcp (arg) | |||||
| "Given recipe or package name, return an alist '(NAME . RCP). | |||||
| If RCP cannot be found it will be set to nil" | |||||
| (pcase arg | |||||
| (`(,a . nil) (quelpa-get-melpa-recipe (car arg))) | |||||
| (`(,a . ,_) arg) | |||||
| ((pred symbolp) (quelpa-get-melpa-recipe arg)))) | |||||
| (defun quelpa-parse-plist (plist) | |||||
| "Parse the optional PLIST argument of `quelpa'. | |||||
| Recognized keywords are: | |||||
| :upgrade | |||||
| If t, `quelpa' tries to do an upgrade. | |||||
| :stable | |||||
| If t, `quelpa' tries building the stable version of a package." | |||||
| (while plist | |||||
| (let ((key (car plist)) | |||||
| (value (cadr plist))) | |||||
| (pcase key | |||||
| (:upgrade (setq quelpa-upgrade-p value)) | |||||
| (:stable (setq quelpa-stable-p value)))) | |||||
| (setq plist (cddr plist)))) | |||||
| (defun quelpa-package-install-file (file) | |||||
| "Workaround problem with `package-install-file'. | |||||
| `package-install-file' uses `insert-file-contents-literally' | |||||
| which causes problems when the file inserted has crlf line | |||||
| endings (Windows). So here we replace that with | |||||
| `insert-file-contents' for non-tar files." | |||||
| (if (eq system-type 'windows-nt) | |||||
| (cl-letf* ((insert-file-contents-literally-orig | |||||
| (symbol-function 'insert-file-contents-literally)) | |||||
| ((symbol-function 'insert-file-contents-literally) | |||||
| (lambda (file) | |||||
| (if (string-match "\\.tar\\'" file) | |||||
| (funcall insert-file-contents-literally-orig file) | |||||
| (insert-file-contents file))))) | |||||
| (package-install-file file)) | |||||
| (package-install-file file))) | |||||
| (defun quelpa-package-install (arg) | |||||
| "Build and install package from ARG (a recipe or package name). | |||||
| If the package has dependencies recursively call this function to | |||||
| install them." | |||||
| (let* ((rcp (quelpa-arg-rcp arg)) | |||||
| (file (and rcp (quelpa-build-package rcp)))) | |||||
| (when file | |||||
| (let* ((pkg-desc (quelpa-get-package-desc file)) | |||||
| (requires (package-desc-reqs pkg-desc))) | |||||
| (when requires | |||||
| (mapc (lambda (req) | |||||
| (unless (equal 'emacs (car req)) | |||||
| (quelpa-package-install (car req)))) | |||||
| requires)) | |||||
| (quelpa-package-install-file file))))) | |||||
| (defun quelpa-interactive-candidate () | |||||
| "Query the user for a recipe and return the name." | |||||
| (when (quelpa-setup-p) | |||||
| (let ((recipes (directory-files | |||||
| (expand-file-name "recipes" quelpa-melpa-dir) | |||||
| ;; this regexp matches all files except dotfiles | |||||
| nil "^[^.].+$"))) | |||||
| (intern (completing-read "Choose MELPA recipe: " | |||||
| recipes nil t))))) | |||||
| ;; --- public interface ------------------------------------------------------ | |||||
| ;;;###autoload | |||||
| (defun quelpa-expand-recipe (recipe-name) | |||||
| "Expand a given recipe name into full recipe. | |||||
| If called interactively, let the user choose a recipe name and | |||||
| insert the result into the current buffer." | |||||
| (interactive (list (quelpa-interactive-candidate))) | |||||
| (when (quelpa-setup-p) | |||||
| (let* ((recipe (quelpa-get-melpa-recipe recipe-name))) | |||||
| (when recipe | |||||
| (if (called-interactively-p 'any) | |||||
| (prin1 recipe (current-buffer))) | |||||
| recipe)))) | |||||
| ;;;###autoload | |||||
| (defun quelpa-self-upgrade (&optional args) | |||||
| "Upgrade quelpa itself. | |||||
| ARGS are additional options for the quelpa recipe." | |||||
| (interactive) | |||||
| (when (quelpa-setup-p) | |||||
| (quelpa (append quelpa-recipe args) :upgrade t))) | |||||
| ;;;###autoload | |||||
| (defun quelpa-upgrade () | |||||
| "Upgrade all packages found in `quelpa-cache'. | |||||
| This provides an easy way to upgrade all the packages for which | |||||
| the `quelpa' command has been run in the current Emacs session." | |||||
| (interactive) | |||||
| (when (quelpa-setup-p) | |||||
| (let ((quelpa-upgrade-p t)) | |||||
| (quelpa-self-upgrade) | |||||
| (setq quelpa-cache | |||||
| (cl-remove-if-not #'package-installed-p quelpa-cache :key #'car)) | |||||
| (mapc (lambda (item) | |||||
| (when (package-installed-p (car (quelpa-arg-rcp item))) | |||||
| (quelpa item))) | |||||
| quelpa-cache)))) | |||||
| ;;;###autoload | |||||
| (defun quelpa (arg &rest plist) | |||||
| "Build and install a package with quelpa. | |||||
| ARG can be a package name (symbol) or a melpa recipe (list). | |||||
| PLIST is a plist that may modify the build and/or fetch process. | |||||
| If called interactively, `quelpa' will prompt for a MELPA package | |||||
| to install. | |||||
| When `quelpa' is called interactively with a prefix argument (e.g | |||||
| C-u M-x quelpa) it will try to upgrade the given package even if | |||||
| the global var `quelpa-upgrade-p' is set to nil." | |||||
| (interactive (list (quelpa-interactive-candidate))) | |||||
| (run-hooks 'quelpa-before-hook) | |||||
| (when (quelpa-setup-p) ;if init fails we do nothing | |||||
| (let* ((quelpa-upgrade-p (if current-prefix-arg t quelpa-upgrade-p)) ;shadow `quelpa-upgrade-p' | |||||
| (quelpa-stable-p quelpa-stable-p) ;shadow `quelpa-stable-p' | |||||
| (cache-item (if (symbolp arg) (list arg) arg))) | |||||
| (quelpa-parse-plist plist) | |||||
| (quelpa-parse-stable cache-item) | |||||
| (quelpa-package-install arg) | |||||
| (quelpa-update-cache cache-item))) | |||||
| (quelpa-shutdown) | |||||
| (run-hooks 'quelpa-after-hook)) | |||||
| (provide 'quelpa) | |||||
| ;;; quelpa.el ends here | |||||
| @ -0,0 +1,161 @@ | |||||
| # Spacemacs-theme | |||||
| [](http://melpa.org/#/spacemacs-theme)  | |||||
| [] (https://gitter.im/nashamri/spacemacs-theme?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | |||||
|  | |||||
| Spacemacs theme is an Emacs color theme that started as a theme for [spacemacs](https://github.com/syl20bnr/spacemacs). | |||||
| The theme comes with dark and light variants and it should work well with 256 color terminals. | |||||
| ## Screenshots | |||||
|  | |||||
| ## Highlights | |||||
| The theme has good support for org mode. | |||||
|  | |||||
| ## Installation | |||||
| You can install it from MELPA by: | |||||
| ``` | |||||
| M-x package-install RET spacemacs-theme | |||||
| ``` | |||||
| ## Supported modes | |||||
| Some of the supported modes are: | |||||
| * company | |||||
| * ein | |||||
| * erc | |||||
| * gnus | |||||
| * helm | |||||
| * ido | |||||
| * info | |||||
| * magit | |||||
| * neotree | |||||
| * org | |||||
| * and others :) more are coming! | |||||
| ## Customizations | |||||
| The theme has some options that can be tweaked via `M-x customize`: | |||||
| * `spacemacs-theme-comment-bg`: | |||||
| This toggles a background color for the comment lines. | |||||
| * `spacemacs-theme-org-agenda-height`: | |||||
| This toggles the use of varying org agenda heights. | |||||
| * `spacemacs-theme-org-height`: | |||||
| This toggles the use of varying org headings heights. | |||||
| * `spacemacs-theme-org-highlight`: | |||||
| This toggles highlighting of org headings. | |||||
| * `spacemacs-theme-custom-colors`: | |||||
| This allows for specifying a list of custom colors to override spacemacs theme colors. More details in the next section. | |||||
| ### Override theme's colors | |||||
| The theme can be customized by overriding one of the theme local variables by setting a list in the `spacemacs-theme-custom-colors` variable. | |||||
| Here's a list of all the local variables and roles: | |||||
| | var | role | | |||||
| |---------------|---------------------------------------------------------------------------------------------------| | |||||
| | act1 | One of mode-line's active colors. | | |||||
| | act2 | The other active color of mode-line. | | |||||
| | base | The basic color of normal text. | | |||||
| | base-dim | A dimmer version of the normal text color. | | |||||
| | bg1 | The background color. | | |||||
| | bg2 | A darker background color. Used to highlight current line. | | |||||
| | bg3 | Yet another darker shade of the background color. | | |||||
| | bg4 | The darkest background color. | | |||||
| | border | A border line color. Used in mode-line borders. | | |||||
| | cblk | A code block color. Used in org's code blocks. | | |||||
| | cblk-bg | The background color of a code block. | | |||||
| | cblk-ln | A code block header line. | | |||||
| | cblk-ln-bg | The background of a code block header line. | | |||||
| | cursor | The cursor/point color. | | |||||
| | const | A constant. | | |||||
| | comment | A comment. | | |||||
| | comment-bg | The background color of a comment. To disable this, `customize` `spacemacs-theme-comment-bg`. | | |||||
| | comp | A complementary color. | | |||||
| | err | errors. | | |||||
| | func | functions. | | |||||
| | head1 | Level 1 of a heading. Used in org's headings. | | |||||
| | head1-bg | The background of level 2 headings. To disable this, `customize` `spacemacs-theme-org-highlight`. | | |||||
| | head2 | Level 2 headings. | | |||||
| | head2-bg | Level 2 headings background. | | |||||
| | head3 | Level 3 headings. | | |||||
| | head3-bg | Level 3 headings background. | | |||||
| | head4 | Level 4 headings. | | |||||
| | head4-bg | Level 4 headings background. | | |||||
| | highlight | A highlighted area. | | |||||
| | highlight-dim | A dimmer highlighted area. | | |||||
| | keyword | A keyword or a builtin color. | | |||||
| | lnum | Line numbers. | | |||||
| | mat | A matched color. Used in matching parens, brackets and tags. | | |||||
| | meta | A meta line. Used in org's meta line. | | |||||
| | str | A string. | | |||||
| | suc | To indicate success. Opposite of error. | | |||||
| | ttip | Tooltip color. | | |||||
| | ttip-sl | Tooltip selection color. | | |||||
| | ttip-bg | Tooltip background color. | | |||||
| | type | A type color. | | |||||
| | var | A variable color. | | |||||
| | war | A warning color. | | |||||
| There is also explicit colors variables that can be customized: | |||||
| * aqua | |||||
| * aqua-bg | |||||
| * green | |||||
| * green-bg | |||||
| * green-bg-s | |||||
| * cyan | |||||
| * red | |||||
| * red-bg | |||||
| * red-bg-s | |||||
| * blue | |||||
| * blue-bg | |||||
| * violet | |||||
| * yellow | |||||
| * yellow-bg | |||||
| The `green` and `red` colors have two background versions. The `green-bg` and `red-bg` are normal light background colors. | |||||
| The `green-bg-s` and `red-bg-s` are a stronger version and are used in `ediff` and places were text is added or deleted. | |||||
| Here are some screenshots of the various variables: | |||||
|  | |||||
|  | |||||
|  | |||||
| If you are using [spacemacs](https://github.com/syl20bnr/spacemacs), you can put this snippet in your `dotspacemacs/user-init` to override these colors: | |||||
| ``` | |||||
| (custom-set-variables '(spacemacs-theme-custom-colors | |||||
| '((act1 . "#ff0000") | |||||
| (act2 . "#0000ff") | |||||
| (base . "#ffffff")))) | |||||
| ``` | |||||
| This will override `act1`, `act1` and `base` to use the specified colors. | |||||
| # Like the theme and want to use it in other places? | |||||
| Then check out this project [base16-builder](https://github.com/auduchinok/base16-builder). | |||||
| @ -0,0 +1,786 @@ | |||||
| ;;; spacemacs-common.el --- Color theme with a dark and light versions. | |||||
| ;; Copyright (C) 2015-2016 Nasser Alshammari | |||||
| ;; Author: Nasser Alshammari | |||||
| ;; URL: <https://github.com/nashamri/spacemacs-theme> | |||||
| ;; | |||||
| ;; Version: 0.1 | |||||
| ;; Keywords: color, theme | |||||
| ;; Package-Requires: ((emacs "24")) | |||||
| ;; Initially created with the help of emacs-theme-generator, <https://github.com/mswift42/theme-creator>. | |||||
| ;; This program is free software: you can redistribute it and/or modify | |||||
| ;; it under the terms of the GNU General Public License as published by | |||||
| ;; the Free Software Foundation, either version 3 of the License, or | |||||
| ;; (at your option) any later version. | |||||
| ;; This program is distributed in the hope that it will be useful, | |||||
| ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| ;; GNU General Public License for more details. | |||||
| ;; You should have received a copy of the GNU General Public License | |||||
| ;; along with this program. If not, see <http://www.gnu.org/licenses/>. | |||||
| ;; This file is not part of Emacs. | |||||
| ;;; Commentary: | |||||
| ;; This is a color theme for spacemacs <https://github.com/syl20bnr/spacemacs>. | |||||
| ;; It comes with two versions, dark and light and should work well in | |||||
| ;; a 256 color terminal. | |||||
| ;;; Code: | |||||
| (defmacro dyn-let (varlist fn setfaces setvars) | |||||
| (list 'let (append varlist (funcall fn)) setfaces setvars)) | |||||
| (defgroup spacemacs-theme nil | |||||
| "Spacemacs-theme options." | |||||
| :group 'faces) | |||||
| (defcustom spacemacs-theme-comment-bg t | |||||
| "Use a background for comment lines." | |||||
| :type 'boolean | |||||
| :group 'spacemacs-theme) | |||||
| (defcustom spacemacs-theme-org-agenda-height t | |||||
| "Use varying text heights for org agenda." | |||||
| :type 'boolean | |||||
| :group 'spacemacs-theme) | |||||
| (defcustom spacemacs-theme-org-height t | |||||
| "Use varying text heights for org headings." | |||||
| :type 'boolean | |||||
| :group 'spacemacs-theme) | |||||
| (defcustom spacemacs-theme-org-highlight nil | |||||
| "Highlight org headings." | |||||
| :type 'boolean | |||||
| :group 'spacemacs-theme) | |||||
| (defcustom spacemacs-theme-custom-colors nil | |||||
| "Specify a list of custom colors" | |||||
| :type 'alist | |||||
| :group 'spacemacs-theme) | |||||
| (defun true-color-p () | |||||
| (or | |||||
| (display-graphic-p) | |||||
| (= (tty-display-color-cells) 16777216))) | |||||
| (defun custom-colors-override () | |||||
| (mapcar (lambda (x) (list (car x) (cdr x))) | |||||
| spacemacs-theme-custom-colors)) | |||||
| (defun create-spacemacs-theme (variant theme-name) | |||||
| (dyn-let ((class '((class color) (min-colors 89))) ;; ~~ Dark ~~ ~~ Light ~~ | |||||
| ;; GUI TER GUI TER | |||||
| ;; generic | |||||
| (act1 (if (eq variant 'dark) (if (true-color-p) "#222226" "#121212") (if (true-color-p) "#e7e5eb" "#d7dfff"))) | |||||
| (act2 (if (eq variant 'dark) (if (true-color-p) "#5d4d7a" "#444444") (if (true-color-p) "#d3d3e7" "#afafd7"))) | |||||
| (base (if (eq variant 'dark) (if (true-color-p) "#b2b2b2" "#b2b2b2") (if (true-color-p) "#655370" "#5f5f87"))) | |||||
| (base-dim (if (eq variant 'dark) (if (true-color-p) "#686868" "#585858") (if (true-color-p) "#a094a2" "#afafd7"))) | |||||
| (bg1 (if (eq variant 'dark) (if (true-color-p) "#292b2e" "#262626") (if (true-color-p) "#fbf8ef" "#ffffff"))) | |||||
| (bg2 (if (eq variant 'dark) (if (true-color-p) "#212026" "#1c1c1c") (if (true-color-p) "#efeae9" "#e4e4e4"))) | |||||
| (bg3 (if (eq variant 'dark) (if (true-color-p) "#100a14" "#121212") (if (true-color-p) "#e3dedd" "#d0d0d0"))) | |||||
| (bg4 (if (eq variant 'dark) (if (true-color-p) "#0a0814" "#080808") (if (true-color-p) "#d2ceda" "#bcbcbc"))) | |||||
| (border (if (eq variant 'dark) (if (true-color-p) "#5d4d7a" "#111111") (if (true-color-p) "#b3b9be" "#b3b9be"))) | |||||
| (cblk (if (eq variant 'dark) (if (true-color-p) "#cbc1d5" "#b2b2b2") (if (true-color-p) "#655370" "#5f5f87"))) | |||||
| (cblk-bg (if (eq variant 'dark) (if (true-color-p) "#2f2b33" "#262626") (if (true-color-p) "#e8e3f0" "#ffffff"))) | |||||
| (cblk-ln (if (eq variant 'dark) (if (true-color-p) "#827591" "#af5faf") (if (true-color-p) "#9380b2" "#af5fdf"))) | |||||
| (cblk-ln-bg (if (eq variant 'dark) (if (true-color-p) "#373040" "#333333") (if (true-color-p) "#ddd8eb" "#dfdfff"))) | |||||
| (cursor (if (eq variant 'dark) (if (true-color-p) "#e3dedd" "#d0d0d0") (if (true-color-p) "#100a14" "#121212"))) | |||||
| (const (if (eq variant 'dark) (if (true-color-p) "#a45bad" "#d75fd7") (if (true-color-p) "#4e3163" "#8700af"))) | |||||
| (comment (if (eq variant 'dark) (if (true-color-p) "#2aa1ae" "#008787") (if (true-color-p) "#2aa1ae" "#008787"))) | |||||
| (comment-bg (if (eq variant 'dark) (if (true-color-p) "#292e34" "#262626") (if (true-color-p) "#ecf3ec" "#ffffff"))) | |||||
| (comp (if (eq variant 'dark) (if (true-color-p) "#c56ec3" "#d75fd7") (if (true-color-p) "#6c4173" "#8700af"))) | |||||
| (err (if (eq variant 'dark) (if (true-color-p) "#e0211d" "#e0211d") (if (true-color-p) "#e0211d" "#e0211d"))) | |||||
| (func (if (eq variant 'dark) (if (true-color-p) "#bc6ec5" "#d75fd7") (if (true-color-p) "#6c3163" "#8700af"))) | |||||
| (head1 (if (eq variant 'dark) (if (true-color-p) "#4f97d7" "#268bd2") (if (true-color-p) "#3a81c3" "#268bd2"))) | |||||
| (head1-bg (if (eq variant 'dark) (if (true-color-p) "#293239" "#262626") (if (true-color-p) "#edf1ed" "#ffffff"))) | |||||
| (head2 (if (eq variant 'dark) (if (true-color-p) "#2d9574" "#2aa198") (if (true-color-p) "#2d9574" "#2aa198"))) | |||||
| (head2-bg (if (eq variant 'dark) (if (true-color-p) "#293235" "#262626") (if (true-color-p) "#edf2e9" "#ffffff"))) | |||||
| (head3 (if (eq variant 'dark) (if (true-color-p) "#67b11d" "#67b11d") (if (true-color-p) "#67b11d" "#5faf00"))) | |||||
| (head3-bg (if (eq variant 'dark) (if (true-color-p) "#293235" "#262626") (if (true-color-p) "#edf2e9" "#ffffff"))) | |||||
| (head4 (if (eq variant 'dark) (if (true-color-p) "#b1951d" "#875f00") (if (true-color-p) "#b1951d" "#875f00"))) | |||||
| (head4-bg (if (eq variant 'dark) (if (true-color-p) "#32322c" "#262626") (if (true-color-p) "#f6f1e1" "#ffffff"))) | |||||
| (highlight (if (eq variant 'dark) (if (true-color-p) "#444155" "#444444") (if (true-color-p) "#d3d3e7" "#d7d7ff"))) | |||||
| (highlight-dim (if (eq variant 'dark) (if (true-color-p) "#3b314d" "#444444") (if (true-color-p) "#e7e7fc" "#d7d7ff"))) | |||||
| (keyword (if (eq variant 'dark) (if (true-color-p) "#4f97d7" "#268bd2") (if (true-color-p) "#3a81c3" "#268bd2"))) | |||||
| (lnum (if (eq variant 'dark) (if (true-color-p) "#44505c" "#444444") (if (true-color-p) "#a8a8bf" "#af87af"))) | |||||
| (mat (if (eq variant 'dark) (if (true-color-p) "#86dc2f" "#86dc2f") (if (true-color-p) "#ba2f59" "#af005f"))) | |||||
| (meta (if (eq variant 'dark) (if (true-color-p) "#9f8766" "#af875f") (if (true-color-p) "#da8b55" "#df5f5f"))) | |||||
| (str (if (eq variant 'dark) (if (true-color-p) "#2d9574" "#2aa198") (if (true-color-p) "#2d9574" "#2aa198"))) | |||||
| (suc (if (eq variant 'dark) (if (true-color-p) "#86dc2f" "#86dc2f") (if (true-color-p) "#42ae2c" "#00af00"))) | |||||
| (ttip (if (eq variant 'dark) (if (true-color-p) "#9a9aba" "#888888") (if (true-color-p) "#8c799f" "#5f5f87"))) | |||||
| (ttip-sl (if (eq variant 'dark) (if (true-color-p) "#5e5079" "#333333") (if (true-color-p) "#c8c6dd" "#afafff"))) | |||||
| (ttip-bg (if (eq variant 'dark) (if (true-color-p) "#34323e" "#444444") (if (true-color-p) "#e2e0ea" "#dfdfff"))) | |||||
| (type (if (eq variant 'dark) (if (true-color-p) "#ce537a" "#df005f") (if (true-color-p) "#ba2f59" "#af005f"))) | |||||
| (var (if (eq variant 'dark) (if (true-color-p) "#7590db" "#8787d7") (if (true-color-p) "#715ab1" "#af5fd7"))) | |||||
| (war (if (eq variant 'dark) (if (true-color-p) "#dc752f" "#dc752f") (if (true-color-p) "#dc752f" "#dc752f"))) | |||||
| ;; colors | |||||
| (aqua (if (eq variant 'dark) (if (true-color-p) "#2d9574" "#2aa198") (if (true-color-p) "#2d9574" "#2aa198"))) | |||||
| (aqua-bg (if (eq variant 'dark) (if (true-color-p) "#293235" "#262626") (if (true-color-p) "#edf2e9" "#ffffff"))) | |||||
| (green (if (eq variant 'dark) (if (true-color-p) "#67b11d" "#67b11d") (if (true-color-p) "#67b11d" "#5faf00"))) | |||||
| (green-bg (if (eq variant 'dark) (if (true-color-p) "#293235" "#262626") (if (true-color-p) "#edf2e9" "#ffffff"))) | |||||
| (green-bg-s (if (eq variant 'dark) (if (true-color-p) "#29422d" "#262626") (if (true-color-p) "#dae6d0" "#ffffff"))) | |||||
| (cyan (if (eq variant 'dark) (if (true-color-p) "#28def0" "#00ffff") (if (true-color-p) "#21b8c7" "#008080"))) | |||||
| (red (if (eq variant 'dark) (if (true-color-p) "#f2241f" "#d70000") (if (true-color-p) "#f2241f" "#d70008"))) | |||||
| (red-bg (if (eq variant 'dark) (if (true-color-p) "#3c2a2c" "#262626") (if (true-color-p) "#faede4" "#ffffff"))) | |||||
| (red-bg-s (if (eq variant 'dark) (if (true-color-p) "#512e31" "#262626") (if (true-color-p) "#eed9d2" "#ffffff"))) | |||||
| (blue (if (eq variant 'dark) (if (true-color-p) "#4f97d7" "#268bd2") (if (true-color-p) "#3a81c3" "#268bd2"))) | |||||
| (blue-bg (if (eq variant 'dark) (if (true-color-p) "#293239" "#262626") (if (true-color-p) "#edf1ed" "#d7d7ff"))) | |||||
| (magenta (if (eq variant 'dark) (if (true-color-p) "#a31db1" "#af00df") (if (true-color-p) "#a31db1" "#800080"))) | |||||
| (yellow (if (eq variant 'dark) (if (true-color-p) "#b1951d" "#875f00") (if (true-color-p) "#b1951d" "#875f00"))) | |||||
| (yellow-bg (if (eq variant 'dark) (if (true-color-p) "#32322c" "#262626") (if (true-color-p) "#f6f1e1" "#ffffff"))) | |||||
| ) | |||||
| custom-colors-override | |||||
| (custom-theme-set-faces | |||||
| theme-name | |||||
| ;;;;; basics | |||||
| `(cursor ((,class (:background ,cursor)))) | |||||
| `(custom-button ((,class :background ,bg2 :foreground ,base :box (:line-width 2 :style released-button)))) | |||||
| `(default ((,class (:background ,bg1 :foreground ,base)))) | |||||
| `(default-italic ((,class (:italic t)))) | |||||
| `(error ((,class (:foreground ,err)))) | |||||
| `(eval-sexp-fu-flash ((,class (:background ,suc :foreground ,bg1)))) | |||||
| `(eval-sexp-fu-flash-error ((,class (:background ,err :foreground ,bg1)))) | |||||
| `(font-lock-builtin-face ((,class (:foreground ,keyword)))) | |||||
| `(font-lock-comment-face ((,class (:foreground ,comment :background ,(when spacemacs-theme-comment-bg comment-bg))))) | |||||
| `(font-lock-constant-face ((,class (:foreground ,const)))) | |||||
| `(font-lock-doc-face ((,class (:foreground ,comment)))) | |||||
| `(font-lock-function-name-face ((,class (:foreground ,func :inherit bold)))) | |||||
| `(font-lock-keyword-face ((,class (:inherit bold :foreground ,keyword)))) | |||||
| `(font-lock-negation-char-face ((,class (:foreground ,const)))) | |||||
| `(font-lock-preprocessor-face ((,class (:foreground ,func)))) | |||||
| `(font-lock-reference-face ((,class (:foreground ,const)))) | |||||
| `(font-lock-string-face ((,class (:foreground ,str)))) | |||||
| `(font-lock-type-face ((,class (:foreground ,type :inherit bold)))) | |||||
| `(font-lock-variable-name-face ((,class (:foreground ,var)))) | |||||
| `(font-lock-warning-face ((,class (:foreground ,war :background ,bg1)))) | |||||
| `(fringe ((,class (:background ,bg1 :foreground ,base)))) | |||||
| `(header-line ((,class :background ,bg4))) | |||||
| `(highlight ((,class (:foreground ,base :background ,highlight)))) | |||||
| `(hl-line ((,class (:background ,bg2)))) | |||||
| `(isearch ((,class (:foreground ,bg1 :background ,mat)))) | |||||
| `(lazy-highlight ((,class (:background ,green-bg-s :weight normal)))) | |||||
| `(link ((,class (:foreground ,comment :underline t)))) | |||||
| `(link-visited ((,class (:foreground ,comp :underline t)))) | |||||
| `(match ((,class (:background ,highlight :foreground ,mat)))) | |||||
| `(minibuffer-prompt ((,class (:inherit bold :foreground ,keyword)))) | |||||
| `(page-break-lines ((,class (:foreground ,act2)))) | |||||
| `(region ((,class (:background ,highlight)))) | |||||
| `(secondary-selection ((,class (:background ,bg3)))) | |||||
| `(shadow ((,class (:foreground ,base-dim)))) | |||||
| `(success ((,class (:foreground ,suc)))) | |||||
| `(tooltip ((,class (:background ,ttip-sl :foreground ,base :bold nil :italic nil :underline nil)))) | |||||
| `(vertical-border ((,class (:foreground ,border)))) | |||||
| `(warning ((,class (:foreground ,war)))) | |||||
| ;;;;; ahs | |||||
| `(ahs-face ((,class (:background ,highlight)))) | |||||
| `(ahs-plugin-whole-buffer-face ((,class (:background ,mat :foreground ,bg1)))) | |||||
| ;;;;; anzu-mode | |||||
| `(anzu-mode-line ((,class (:foreground ,yellow :inherit bold)))) | |||||
| ;;;;; auto-complete | |||||
| `(ac-completion-face ((,class (:background ,ttip-bg :foreground ,ttip)))) | |||||
| ;;;;; avy | |||||
| `(avy-lead-face ((,class (:background ,blue-bg :foreground ,magenta)))) | |||||
| `(avy-lead-face-0 ((,class (:background ,blue-bg :foreground ,blue)))) | |||||
| `(avy-lead-face-1 ((,class (:background ,blue-bg :foreground ,magenta)))) | |||||
| `(avy-lead-face-2 ((,class (:background ,blue-bg :foreground ,blue)))) | |||||
| ;;;;; cider | |||||
| `(cider-enlightened ((,class (:background nil :box (:color ,yellow :line-width -1 :style nil) :foreground ,yellow)))) | |||||
| `(cider-enlightened-local ((,class (:foreground ,yellow)))) | |||||
| `(cider-instrumented-face ((,class (:background nil :box (:color ,red :line-width -1 :style nil) :foreground ,red)))) | |||||
| `(cider-result-overlay-face ((,class (:background nil :box (:color ,blue :line-width -1 :style nil) :foreground ,blue)))) | |||||
| `(cider-test-error-face ((,class (:background ,war :foreground ,bg1)))) | |||||
| `(cider-test-failure-face ((,class (:background ,err :foreground ,bg1)))) | |||||
| `(cider-test-success-face ((,class (:background ,suc :foreground ,bg1)))) | |||||
| `(cider-traced-face ((,class :box (:color ,cyan :line-width -1 :style nil)))) | |||||
| ;;;;; company | |||||
| `(company-echo-common ((,class (:background ,base :foreground ,bg1)))) | |||||
| `(company-preview ((,class (:background ,ttip-bg :foreground ,ttip)))) | |||||
| `(company-preview-common ((,class (:background ,ttip-bg :foreground ,base)))) | |||||
| `(company-preview-search ((,class (:inherit match)))) | |||||
| `(company-scrollbar-bg ((,class (:background ,bg2)))) | |||||
| `(company-scrollbar-fg ((,class (:background ,act2)))) | |||||
| `(company-template-field ((,class (:inherit region)))) | |||||
| `(company-tooltip ((,class (:background ,ttip-bg :foreground ,ttip)))) | |||||
| `(company-tooltip-annotation ((,class (:foreground ,keyword)))) | |||||
| `(company-tooltip-common ((,class (:background ,ttip-bg :foreground ,base)))) | |||||
| `(company-tooltip-common-selection ((,class (:foreground ,base)))) | |||||
| `(company-tooltip-mouse ((,class (:inherit highlight)))) | |||||
| `(company-tooltip-search ((,class (:inherit match)))) | |||||
| `(company-tooltip-selection ((,class (:background ,ttip-sl :foreground ,base)))) | |||||
| ;;;;; diff | |||||
| `(diff-added ((,class :background nil :foreground ,green))) | |||||
| `(diff-changed ((,class :background nil :foreground ,keyword))) | |||||
| `(diff-header ((,class :background ,cblk-ln-bg :foreground ,func))) | |||||
| `(diff-file-header ((,class :background ,cblk-ln-bg :foreground ,cblk))) | |||||
| `(diff-indicator-added ((,class :background nil :foreground ,green))) | |||||
| `(diff-indicator-changed ((,class :background nil :foreground ,keyword))) | |||||
| `(diff-indicator-removed ((,class :background nil :foreground ,red))) | |||||
| `(diff-refine-added ((,class :background ,green :foreground ,bg4))) | |||||
| `(diff-refine-changed ((,class :background ,keyword :foreground ,bg4))) | |||||
| `(diff-refine-removed ((,class :background ,red :foreground ,bg4))) | |||||
| `(diff-removed ((,class :background nil :foreground ,red))) | |||||
| ;;;;; diff-hl | |||||
| `(diff-hl-change ((,class :background ,blue-bg :foreground ,blue))) | |||||
| `(diff-hl-delete ((,class :background ,red-bg :foreground ,red))) | |||||
| `(diff-hl-insert ((,class :background ,green-bg :foreground ,green))) | |||||
| ;;;;; dired | |||||
| `(dired-directory ((,class (:foreground ,keyword :background ,bg1 :inherit bold)))) | |||||
| `(dired-flagged ((,class (:foreground ,red)))) | |||||
| `(dired-header ((,class (:foreground ,comp :inherit bold)))) | |||||
| `(dired-ignored ((,class (:inherit shadow)))) | |||||
| `(dired-mark ((,class (:foreground ,comp :inherit bold)))) | |||||
| `(dired-marked ((,class (:foreground ,magenta :inherit bold)))) | |||||
| `(dired-perm-write ((,class (:foreground ,base :underline t)))) | |||||
| `(dired-symlink ((,class (:foreground ,cyan :background ,bg1 :inherit bold)))) | |||||
| `(dired-warning ((,class (:foreground ,war)))) | |||||
| ;;;;; ediff | |||||
| `(ediff-current-diff-A ((,class(:background ,red-bg-s :foreground ,red)))) | |||||
| `(ediff-current-diff-Ancestor ((,class(:background ,aqua-bg :foreground ,aqua)))) | |||||
| `(ediff-current-diff-B ((,class(:background ,green-bg-s :foreground ,green)))) | |||||
| `(ediff-current-diff-C ((,class(:background ,blue-bg :foreground ,blue)))) | |||||
| `(ediff-even-diff-A ((,class(:background ,bg3)))) | |||||
| `(ediff-even-diff-Ancestor ((,class(:background ,bg3)))) | |||||
| `(ediff-even-diff-B ((,class(:background ,bg3)))) | |||||
| `(ediff-even-diff-C ((,class(:background ,bg3)))) | |||||
| `(ediff-fine-diff-A ((,class(:background nil :inherit bold)))) | |||||
| `(ediff-fine-diff-Ancestor ((,class(:background nil :inherit bold)))) | |||||
| `(ediff-fine-diff-B ((,class(:background nil :inherit bold)))) | |||||
| `(ediff-fine-diff-C ((,class(:background nil :inherit bold)))) | |||||
| `(ediff-odd-diff-A ((,class(:background ,bg4)))) | |||||
| `(ediff-odd-diff-Ancestor ((,class(:background ,bg4)))) | |||||
| `(ediff-odd-diff-B ((,class(:background ,bg4)))) | |||||
| `(ediff-odd-diff-C ((,class(:background ,bg4)))) | |||||
| ;;;;; ein | |||||
| `(ein:cell-input-area((,class (:background ,bg2)))) | |||||
| `(ein:cell-input-prompt ((,class (:foreground ,suc)))) | |||||
| `(ein:cell-output-prompt ((,class (:foreground ,err)))) | |||||
| `(ein:notification-tab-normal ((,class (:foreground ,keyword)))) | |||||
| `(ein:notification-tab-selected ((,class (:foreground ,suc :inherit bold)))) | |||||
| ;;;;; eldoc | |||||
| `(eldoc-highlight-function-argument ((,class (:foreground ,mat :inherit bold)))) | |||||
| ;;;;; elfeed | |||||
| `(elfeed-search-date-face ((,class (:foreground ,head2)))) | |||||
| `(elfeed-search-feed-face ((,class (:foreground ,blue)))) | |||||
| `(elfeed-search-tag-face ((,class (:foreground ,func)))) | |||||
| `(elfeed-search-title-face ((,class (:foreground ,base-dim)))) | |||||
| `(elfeed-search-unread-title-face ((,class (:foreground ,base)))) | |||||
| ;;;;; enh-ruby | |||||
| `(enh-ruby-op-face ((,class (:background ,bg1 :foreground ,base)))) | |||||
| `(enh-ruby-string-delimiter-face ((,class (:foreground ,str)))) | |||||
| ;;;;; erc | |||||
| `(erc-input-face ((,class (:foreground ,func)))) | |||||
| `(erc-my-nick-face ((,class (:foreground ,keyword)))) | |||||
| `(erc-nick-default-face ((,class (:foreground ,keyword)))) | |||||
| `(erc-nick-prefix-face ((,class (:foreground ,yellow)))) | |||||
| `(erc-notice-face ((,class (:foreground ,str)))) | |||||
| `(erc-prompt-face ((,class (:foreground ,mat :inherit bold)))) | |||||
| `(erc-timestamp-face ((,class (:foreground ,keyword)))) | |||||
| ;;;;; eshell | |||||
| `(eshell-ls-archive ((,class (:foreground ,red :inherit bold)))) | |||||
| `(eshell-ls-backup ((,class (:inherit font-lock-comment-face)))) | |||||
| `(eshell-ls-clutter ((,class (:inherit font-lock-comment-face)))) | |||||
| `(eshell-ls-directory ((,class (:foreground ,keyword :inherit bold)))) | |||||
| `(eshell-ls-executable ((,class (:foreground ,suc :inherit bold)))) | |||||
| `(eshell-ls-missing ((,class (:inherit font-lock-warning-face)))) | |||||
| `(eshell-ls-product ((,class (:inherit font-lock-doc-face)))) | |||||
| `(eshell-ls-special ((,class (:foreground ,yellow :inherit bold)))) | |||||
| `(eshell-ls-symlink ((,class (:foreground ,cyan :inherit bold)))) | |||||
| `(eshell-ls-unreadable ((,class (:foreground ,base)))) | |||||
| `(eshell-prompt ((,class (:foreground ,keyword :inherit bold)))) | |||||
| ;;;;; evil | |||||
| `(evil-ex-substitute-matches ((,class (:background ,red-bg :foreground ,red)))) | |||||
| `(evil-ex-substitute-replacement ((,class (:background ,green-bg :foreground ,green)))) | |||||
| ;;;;; flycheck | |||||
| `(flycheck-error | |||||
| ((,(append '((supports :underline (:style line))) class) | |||||
| (:underline (:style line :color ,err))) | |||||
| (,class (:foreground ,base :background ,err :inherit bold :underline t)))) | |||||
| `(flycheck-error-list-checker-name ((,class (:foreground ,keyword)))) | |||||
| `(flycheck-fringe-error ((,class (:foreground ,err :inherit bold)))) | |||||
| `(flycheck-fringe-info ((,class (:foreground ,keyword :inherit bold)))) | |||||
| `(flycheck-fringe-warning ((,class (:foreground ,war :inherit bold)))) | |||||
| `(flycheck-info | |||||
| ((,(append '((supports :underline (:style line))) class) | |||||
| (:underline (:style line :color ,keyword))) | |||||
| (,class (:foreground ,base :background ,keyword :inherit bold :underline t)))) | |||||
| `(flycheck-warning | |||||
| ((,(append '((supports :underline (:style line))) class) | |||||
| (:underline (:style line :color ,war))) | |||||
| (,class (:foreground ,base :background ,war :inherit bold :underline t)))) | |||||
| ;;;;; jabber | |||||
| `(jabber-activity-face ((,class (:inherit bold :foreground ,red)))) | |||||
| `(jabber-activity-personal-face ((,class (:inherit bold :foreground ,blue)))) | |||||
| `(jabber-chat-error ((,class (:inherit bold :foreground ,red)))) | |||||
| `(jabber-chat-prompt-foreign ((,class (:inherit bold :foreground ,red)))) | |||||
| `(jabber-chat-prompt-local ((,class (:inherit bold :foreground ,blue)))) | |||||
| `(jabber-chat-prompt-system ((,class (:inherit bold :foreground ,green)))) | |||||
| `(jabber-chat-text-foreign ((,class (:foreground ,base)))) | |||||
| `(jabber-chat-text-local ((,class (:foreground ,base)))) | |||||
| `(jabber-rare-time-face ((,class (:foreground ,green)))) | |||||
| `(jabber-roster-user-away ((,class (:foreground ,yellow)))) | |||||
| `(jabber-roster-user-chatty ((,class (:inherit bold :foreground ,green)))) | |||||
| `(jabber-roster-user-dnd ((,class (:foreground ,red)))) | |||||
| `(jabber-roster-user-error ((,class (:foreground ,err)))) | |||||
| `(jabber-roster-user-offline ((,class (:foreground ,base)))) | |||||
| `(jabber-roster-user-online ((,class (:inherit bold :foreground ,green)))) | |||||
| `(jabber-roster-user-xa ((,class (:foreground ,aqua)))) | |||||
| ;;;;; git-gutter-fr | |||||
| `(git-gutter-fr:added ((,class (:foreground ,green :inherit bold)))) | |||||
| `(git-gutter-fr:deleted ((,class (:foreground ,war :inherit bold)))) | |||||
| `(git-gutter-fr:modified ((,class (:foreground ,keyword :inherit bold)))) | |||||
| ;;;;; git-timemachine | |||||
| `(git-timemachine-minibuffer-detail-face ((,class (:foreground ,blue :inherit bold :background ,blue-bg)))) | |||||
| ;;;;; gnus | |||||
| `(gnus-emphasis-highlight-words ((,class (:background ,suc :foreground ,bg1)))) | |||||
| `(gnus-header-content ((,class (:foreground ,keyword)))) | |||||
| `(gnus-header-from ((,class (:foreground ,var)))) | |||||
| `(gnus-header-name ((,class (:foreground ,comp)))) | |||||
| `(gnus-header-subject ((,class (:foreground ,func :inherit bold)))) | |||||
| `(gnus-summary-cancelled ((,class (:background ,war :foreground ,bg1)))) | |||||
| ;;;;; guide-key | |||||
| `(guide-key/highlight-command-face ((,class (:foreground ,base)))) | |||||
| `(guide-key/key-face ((,class (:foreground ,keyword)))) | |||||
| `(guide-key/prefix-command-face ((,class (:foreground ,keyword :inherit bold)))) | |||||
| ;;;;; helm | |||||
| `(helm-bookmark-directory ((,class (:inherit helm-ff-directory)))) | |||||
| `(helm-bookmark-file ((,class (:foreground ,base)))) | |||||
| `(helm-bookmark-gnus ((,class (:foreground ,comp)))) | |||||
| `(helm-bookmark-info ((,class (:foreground ,comp)))) | |||||
| `(helm-bookmark-man ((,class (:foreground ,comp)))) | |||||
| `(helm-bookmark-w3m ((,class (:foreground ,comp)))) | |||||
| `(helm-buffer-directory ((,class (:foreground ,base :background ,bg1)))) | |||||
| `(helm-buffer-file ((,class (:foreground ,base :background ,bg1)))) | |||||
| `(helm-buffer-not-saved ((,class (:foreground ,comp :background ,bg1)))) | |||||
| `(helm-buffer-process ((,class (:foreground ,keyword :background ,bg1)))) | |||||
| `(helm-buffer-saved-out ((,class (:foreground ,base :background ,bg1)))) | |||||
| `(helm-buffer-size ((,class (:foreground ,base :background ,bg1)))) | |||||
| `(helm-candidate-number ((,class (:background ,bg1 :foreground ,keyword :inherit bold)))) | |||||
| `(helm-ff-directory ((,class (:foreground ,keyword :background ,bg1 :inherit bold)))) | |||||
| `(helm-ff-dotted-directory ((,class (:foreground ,keyword :background ,bg1 :inherit bold)))) | |||||
| `(helm-ff-dotted-symlink-directory ((,class (:foreground ,cyan :background ,bg1 :inherit bold)))) | |||||
| `(helm-ff-executable ((,class (:foreground ,suc :background ,bg1 :weight normal)))) | |||||
| `(helm-ff-file ((,class (:foreground ,base :background ,bg1 :weight normal)))) | |||||
| `(helm-ff-invalid-symlink ((,class (:foreground ,red :background ,bg1 :inherit bold)))) | |||||
| `(helm-ff-prefix ((,class (:foreground ,bg1 :background ,keyword :weight normal)))) | |||||
| `(helm-ff-symlink ((,class (:foreground ,cyan :background ,bg1 :inherit bold)))) | |||||
| `(helm-grep-cmd-line ((,class (:foreground ,base :background ,bg1)))) | |||||
| `(helm-grep-file ((,class (:foreground ,base :background ,bg1)))) | |||||
| `(helm-grep-finish ((,class (:foreground ,base :background ,bg1)))) | |||||
| `(helm-grep-lineno ((,class (:foreground ,type :background ,bg1 :inherit bold)))) | |||||
| `(helm-grep-match ((,class (:foreground nil :background nil :inherit helm-match)))) | |||||
| `(helm-header ((,class (:foreground ,base :background ,bg1 :underline nil :box nil)))) | |||||
| `(helm-header-line-left-margin ((,class (:foreground ,keyword :background ,nil)))) | |||||
| `(helm-match ((,class (:background ,head1-bg :foreground ,head1)))) | |||||
| `(helm-match-item ((,class (:background ,head1-bg :foreground ,head1)))) | |||||
| `(helm-moccur-buffer ((,class (:foreground ,var :background ,bg1)))) | |||||
| `(helm-selection ((,class (:background ,highlight)))) | |||||
| `(helm-selection-line ((,class (:background ,bg2)))) | |||||
| `(helm-separator ((,class (:foreground ,comp :background ,bg1)))) | |||||
| `(helm-source-header ((,class (:background ,comp :foreground ,bg1 :inherit bold)))) | |||||
| `(helm-time-zone-current ((,class (:foreground ,keyword :background ,bg1)))) | |||||
| `(helm-time-zone-home ((,class (:foreground ,comp :background ,bg1)))) | |||||
| `(helm-visible-mark ((,class (:foreground ,keyword :background ,bg3)))) | |||||
| ;;;;; helm-swoop | |||||
| `(helm-swoop-target-line-block-face ((,class (:foreground ,base :background ,highlight)))) | |||||
| `(helm-swoop-target-line-face ((,class (:background ,highlight)))) | |||||
| `(helm-swoop-target-word-face ((,class (:background ,highlight :foreground ,mat)))) | |||||
| ;;;;; highlights | |||||
| `(hi-green ((,class (:foreground ,green :background ,green-bg)))) | |||||
| `(hi-yellow ((,class (:foreground ,yellow :background ,yellow-bg)))) | |||||
| ;;;;; highlight-indentation | |||||
| `(highlight-indentation-face ((,class (:background ,comment-bg)))) | |||||
| ;;;;; highlight-symbol | |||||
| `(highlight-symbol-face ((,class (:background ,bg2)))) | |||||
| ;;;;; hydra | |||||
| `(hydra-face-blue ((,class (:foreground ,blue)))) | |||||
| `(hydra-face-red ((,class (:foreground ,red)))) | |||||
| ;;;;; ido | |||||
| `(ido-first-match ((,class (:foreground ,comp :inherit bold)))) | |||||
| `(ido-only-match ((,class (:foreground ,mat :inherit bold)))) | |||||
| `(ido-subdir ((,class (:foreground ,keyword)))) | |||||
| `(ido-vertical-match-face ((,class (:foreground ,comp :underline nil)))) | |||||
| ;;;;; info | |||||
| `(info-header-xref ((,class (:foreground ,func :underline t)))) | |||||
| `(info-menu ((,class (:foreground ,suc)))) | |||||
| `(info-node ((,class (:foreground ,func :inherit bold)))) | |||||
| `(info-quoted-name ((,class (:foreground ,keyword)))) | |||||
| `(info-reference-item ((,class (:background nil :underline t :inherit bold)))) | |||||
| `(info-string ((,class (:foreground ,str)))) | |||||
| `(info-title-1 ((,class (:height 1.4 :inherit bold)))) | |||||
| `(info-title-2 ((,class (:height 1.3 :inherit bold)))) | |||||
| `(info-title-3 ((,class (:height 1.3)))) | |||||
| `(info-title-4 ((,class (:height 1.2)))) | |||||
| ;;;;; ivy | |||||
| `(ivy-current-match ((,class (:background ,highlight :inherit bold)))) | |||||
| `(ivy-minibuffer-match-face-1 ((,class (:inherit bold)))) | |||||
| `(ivy-minibuffer-match-face-2 ((,class (:foreground ,head1 :underline t)))) | |||||
| `(ivy-minibuffer-match-face-3 ((,class (:foreground ,head4 :underline t)))) | |||||
| `(ivy-minibuffer-match-face-4 ((,class (:foreground ,head3 :underline t)))) | |||||
| `(ivy-remote ((,class (:foreground ,cyan)))) | |||||
| ;;;;; latex | |||||
| `(font-latex-bold-face ((,class (:foreground ,comp)))) | |||||
| `(font-latex-italic-face ((,class (:foreground ,keyword :italic t)))) | |||||
| `(font-latex-match-reference-keywords ((,class (:foreground ,const)))) | |||||
| `(font-latex-match-variable-keywords ((,class (:foreground ,var)))) | |||||
| `(font-latex-sectioning-0-face ((,class (:inherit bold :foreground ,head3 :height ,(if spacemacs-theme-org-height 1.3 1.0) :background ,(when spacemacs-theme-org-highlight head3-bg))))) | |||||
| `(font-latex-sectioning-1-face ((,class (:inherit bold :foreground ,head4 :height ,(if spacemacs-theme-org-height 1.3 1.0) :background ,(when spacemacs-theme-org-highlight head4-bg))))) | |||||
| `(font-latex-sectioning-2-face ((,class (:inherit bold :foreground ,head1 :height ,(if spacemacs-theme-org-height 1.3 1.0) :background ,(when spacemacs-theme-org-highlight head1-bg))))) | |||||
| `(font-latex-sectioning-3-face ((,class (:inherit bold :foreground ,head2 :height ,(if spacemacs-theme-org-height 1.2 1.0) :background ,(when spacemacs-theme-org-highlight head2-bg))))) | |||||
| `(font-latex-sectioning-4-face ((,class (:bold nil :foreground ,head3 :height ,(if spacemacs-theme-org-height 1.1 1.0) :background ,(when spacemacs-theme-org-highlight head3-bg))))) | |||||
| `(font-latex-sectioning-5-face ((,class (:bold nil :foreground ,head4 :background ,(when spacemacs-theme-org-highlight head4-bg))))) | |||||
| `(font-latex-string-face ((,class (:foreground ,str)))) | |||||
| `(font-latex-warning-face ((,class (:foreground ,war)))) | |||||
| ;;;;; linum-mode | |||||
| `(linum ((,class (:foreground ,lnum :background ,bg2)))) | |||||
| ;;;;; linum-relative | |||||
| `(linum-relative-current-face ((,class (:foreground ,comp)))) | |||||
| ;;;;; magit | |||||
| `(magit-blame-culprit ((,class :background ,yellow-bg :foreground ,yellow))) | |||||
| `(magit-blame-date ((,class :background ,yellow-bg :foreground ,green))) | |||||
| `(magit-blame-hash ((,class :background ,yellow-bg :foreground ,func))) | |||||
| `(magit-blame-header ((,class :background ,yellow-bg :foreground ,green))) | |||||
| `(magit-blame-heading ((,class :background ,yellow-bg :foreground ,green))) | |||||
| `(magit-blame-name ((,class :background ,yellow-bg :foreground ,yellow))) | |||||
| `(magit-blame-sha1 ((,class :background ,yellow-bg :foreground ,func))) | |||||
| `(magit-blame-subject ((,class :background ,yellow-bg :foreground ,yellow))) | |||||
| `(magit-blame-summary ((,class :background ,yellow-bg :foreground ,yellow))) | |||||
| `(magit-blame-time ((,class :background ,yellow-bg :foreground ,green))) | |||||
| `(magit-branch ((,class (:foreground ,const :inherit bold)))) | |||||
| `(magit-branch-current ((,class (:background ,blue-bg :foreground ,blue :inherit bold :box t)))) | |||||
| `(magit-branch-local ((,class (:background ,blue-bg :foreground ,blue :inherit bold)))) | |||||
| `(magit-branch-remote ((,class (:background ,aqua-bg :foreground ,aqua :inherit bold)))) | |||||
| `(magit-diff-context-highlight ((,class (:background ,bg2 :foreground ,base)))) | |||||
| `(magit-diff-file-header ((,class (:background ,comment-bg :foreground ,comment)))) | |||||
| `(magit-diff-file-heading ((,class (:background ,comment-bg :foreground ,comment)))) | |||||
| `(magit-diff-file-heading-highlight ((,class (:background ,comment-bg :foreground ,comment)))) | |||||
| `(magit-diff-hunk-header ((,class (:background ,ttip-bg :foreground ,ttip)))) | |||||
| `(magit-diff-hunk-heading ((,class (:background ,ttip-bg :foreground ,ttip)))) | |||||
| `(magit-diff-hunk-heading-highlight ((,class (:background ,ttip-bg :foreground ,ttip)))) | |||||
| `(magit-hash ((,class (:foreground ,var)))) | |||||
| `(magit-hunk-heading ((,class (:background ,bg3)))) | |||||
| `(magit-hunk-heading-highlight ((,class (:background ,bg3)))) | |||||
| `(magit-item-highlight ((,class :background ,bg2))) | |||||
| `(magit-log-author ((,class (:foreground ,func)))) | |||||
| `(magit-log-head-label-head ((,class (:background ,yellow :foreground ,bg1 :inherit bold)))) | |||||
| `(magit-log-head-label-local ((,class (:background ,keyword :foreground ,bg1 :inherit bold)))) | |||||
| `(magit-log-head-label-remote ((,class (:background ,suc :foreground ,bg1 :inherit bold)))) | |||||
| `(magit-log-head-label-tags ((,class (:background ,magenta :foreground ,bg1 :inherit bold)))) | |||||
| `(magit-log-head-label-wip ((,class (:background ,cyan :foreground ,bg1 :inherit bold)))) | |||||
| `(magit-log-sha1 ((,class (:foreground ,str)))) | |||||
| `(magit-process-ng ((,class (:foreground ,war :inherit bold)))) | |||||
| `(magit-process-ok ((,class (:foreground ,func :inherit bold)))) | |||||
| `(magit-reflog-amend ((,class (:foreground ,magenta)))) | |||||
| `(magit-reflog-checkout ((,class (:foreground ,blue)))) | |||||
| `(magit-reflog-cherry-pick ((,class (:foreground ,green)))) | |||||
| `(magit-reflog-commit ((,class (:foreground ,green)))) | |||||
| `(magit-reflog-merge ((,class (:foreground ,green)))) | |||||
| `(magit-reflog-other ((,class (:foreground ,cyan)))) | |||||
| `(magit-reflog-rebase ((,class (:foreground ,magenta)))) | |||||
| `(magit-reflog-remote ((,class (:foreground ,cyan)))) | |||||
| `(magit-reflog-reset ((,class (:foreground ,red)))) | |||||
| `(magit-section-heading ((,class (:foreground ,keyword :inherit bold)))) | |||||
| `(magit-section-highlight ((,class (:background ,bg2)))) | |||||
| `(magit-section-title ((,class (:background ,bg1 :foreground ,keyword :inherit bold)))) | |||||
| ;;;;; man | |||||
| `(Man-overstrike ((,class (:foreground ,head1 :inherit bold)))) | |||||
| `(Man-reverse ((,class (:foreground ,highlight)))) | |||||
| `(Man-underline ((,class (:foreground ,comp :underline t)))) | |||||
| ;;;;; markdown | |||||
| `(markdown-header-face-1 ((,class (:inherit bold :foreground ,head1 :height ,(if spacemacs-theme-org-height 1.3 1.0) :background ,(when spacemacs-theme-org-highlight head1-bg))))) | |||||
| `(markdown-header-face-2 ((,class (:inherit bold :foreground ,head2 :height ,(if spacemacs-theme-org-height 1.2 1.0) :background ,(when spacemacs-theme-org-highlight head2-bg))))) | |||||
| `(markdown-header-face-3 ((,class (:bold nil :foreground ,head3 :height ,(if spacemacs-theme-org-height 1.1 1.0) :background ,(when spacemacs-theme-org-highlight head3-bg))))) | |||||
| `(markdown-header-face-4 ((,class (:bold nil :foreground ,head4 :background ,(when spacemacs-theme-org-highlight head4-bg))))) | |||||
| `(markdown-header-face-5 ((,class (:bold nil :foreground ,head1)))) | |||||
| `(markdown-header-face-6 ((,class (:bold nil :foreground ,head2)))) | |||||
| ;;;;; mode-line | |||||
| `(mode-line ((,class (:foreground ,base :background ,act1 :box (:color ,border :line-width 1))))) | |||||
| `(mode-line-buffer-id ((,class (:inherit bold :foreground ,func)))) | |||||
| `(mode-line-inactive ((,class (:foreground ,base :background ,bg1 :box (:color ,border :line-width 1))))) | |||||
| ;;;;; mu4e | |||||
| `(mu4e-cited-1-face ((,class (:foreground ,base)))) | |||||
| `(mu4e-cited-7-face ((,class (:foreground ,base)))) | |||||
| `(mu4e-header-key-face ((,class (:foreground ,head2 :inherit bold)))) | |||||
| `(mu4e-header-marks-face ((,class (:foreground ,comp)))) | |||||
| `(mu4e-unread-face ((,class (:foreground ,yellow :inherit bold)))) | |||||
| `(mu4e-view-url-number-face ((,class (:foreground ,comp)))) | |||||
| ;;;;; notmuch | |||||
| `(notmuch-search-date ((,class (:foreground ,func)))) | |||||
| `(notmuch-search-flagged-face ((,class (:weight extra-bold)))) | |||||
| `(notmuch-search-non-matching-authors ((,class (:foreground ,base-dim)))) | |||||
| `(notmuch-search-unread-face ((,class (:background ,highlight-dim :box ,border)))) | |||||
| `(notmuch-tag-face ((,class (:foreground ,keyword)))) | |||||
| `(notmuch-tag-flagged ((,class (:foreground ,war)))) | |||||
| ;;;;; neotree | |||||
| `(neo-dir-link-face ((,class (:foreground ,keyword :inherit bold)))) | |||||
| `(neo-expand-btn-face ((,class (:foreground ,base)))) | |||||
| `(neo-file-link-face ((,class (:foreground ,base)))) | |||||
| `(neo-root-dir-face ((,class (:foreground ,func :inherit bold)))) | |||||
| ;;;;; org | |||||
| `(org-agenda-clocking ((,class (:background ,highlight :foreground ,comp)))) | |||||
| `(org-agenda-date ((,class (:foreground ,var :height ,(if spacemacs-theme-org-agenda-height 1.1 1.0))))) | |||||
| `(org-agenda-date-today ((,class (:foreground ,keyword :inherit bold :height ,(if spacemacs-theme-org-agenda-height 1.3 1.0))))) | |||||
| `(org-agenda-date-weekend ((,class (:inherit bold :foreground ,var)))) | |||||
| `(org-agenda-done ((,class (:foreground ,suc :height ,(if spacemacs-theme-org-agenda-height 1.2 1.0))))) | |||||
| `(org-agenda-structure ((,class (:inherit bold :foreground ,comp)))) | |||||
| `(org-block ((,class (:background ,cblk-bg :foreground ,cblk)))) | |||||
| `(org-block-begin-line ((,class (:background ,cblk-ln-bg :foreground ,cblk-ln)))) | |||||
| `(org-block-end-line ((,class (:background ,cblk-ln-bg :foreground ,cblk-ln)))) | |||||
| `(org-clock-overlay ((,class (:foreground ,comp)))) | |||||
| `(org-code ((,class (:foreground ,cyan)))) | |||||
| `(org-column ((,class (:background ,highlight)))) | |||||
| `(org-column-title ((,class (:background ,highlight)))) | |||||
| `(org-date ((,class (:underline t :foreground ,var)))) | |||||
| `(org-date-selected ((,class (:background ,func :foreground ,bg1)))) | |||||
| `(org-document-info-keyword ((,class (:foreground ,meta)))) | |||||
| `(org-document-title ((,class (:foreground ,func :inherit bold :height ,(if spacemacs-theme-org-height 1.4 1.0) :underline t)))) | |||||
| `(org-done ((,class (:foreground ,suc :inherit bold :background ,green-bg)))) | |||||
| `(org-ellipsis ((,class (:foreground ,keyword)))) | |||||
| `(org-footnote ((,class (:underline t :foreground ,base)))) | |||||
| `(org-hide ((,class (:foreground ,base)))) | |||||
| `(org-kbd ((,class (:inherit region :foreground ,base :box (:line-width 1 :style released-button))))) | |||||
| `(org-level-1 ((,class (:inherit bold :foreground ,head1 :height ,(if spacemacs-theme-org-height 1.3 1.0) :background ,(when spacemacs-theme-org-highlight head1-bg))))) | |||||
| `(org-level-2 ((,class (:inherit bold :foreground ,head2 :height ,(if spacemacs-theme-org-height 1.2 1.0) :background ,(when spacemacs-theme-org-highlight head2-bg))))) | |||||
| `(org-level-3 ((,class (:bold nil :foreground ,head3 :height ,(if spacemacs-theme-org-height 1.1 1.0) :background ,(when spacemacs-theme-org-highlight head3-bg))))) | |||||
| `(org-level-4 ((,class (:bold nil :foreground ,head4 :background ,(when spacemacs-theme-org-highlight head4-bg))))) | |||||
| `(org-level-5 ((,class (:bold nil :foreground ,head1)))) | |||||
| `(org-level-6 ((,class (:bold nil :foreground ,head2)))) | |||||
| `(org-level-7 ((,class (:bold nil :foreground ,head3)))) | |||||
| `(org-level-8 ((,class (:bold nil :foreground ,head4)))) | |||||
| `(org-link ((,class (:underline t :foreground ,comment)))) | |||||
| `(org-meta-line ((,class (:foreground ,meta)))) | |||||
| `(org-mode-line-clock-overrun ((,class (:foreground ,err)))) | |||||
| `(org-priority ((,class (:foreground ,war :inherit bold)))) | |||||
| `(org-quote ((,class (:inherit org-block :slant italic)))) | |||||
| `(org-scheduled ((,class (:foreground ,comp)))) | |||||
| `(org-scheduled-today ((,class (:foreground ,func :height ,(if spacemacs-theme-org-agenda-height 1.2 1.0))))) | |||||
| `(org-sexp-date ((,class (:foreground ,base)))) | |||||
| `(org-special-keyword ((,class (:foreground ,func)))) | |||||
| `(org-table ((,class (:foreground ,base :background ,head1-bg)))) | |||||
| `(org-time-grid ((,class (:foreground ,str)))) | |||||
| `(org-todo ((,class (:foreground ,war :inherit bold :background ,yellow-bg)))) | |||||
| `(org-verbatim ((,class (:foreground ,keyword)))) | |||||
| `(org-verse ((,class (:inherit org-block :slant italic)))) | |||||
| `(org-warning ((,class (:foreground ,err)))) | |||||
| ;;;;; perspective | |||||
| `(persp-selected-face ((,class (:inherit bold :foreground ,func)))) | |||||
| ;;;;; popup | |||||
| `(popup-enu-selection-face ((,class (:background ,ttip-sl :foreground ,base)))) | |||||
| `(popup-face ((,class (:background ,ttip-bg :foreground ,ttip)))) | |||||
| `(popup-isearch-match ((,class (:inherit match)))) | |||||
| `(popup-menu-face ((,class (:background ,ttip-bg :foreground ,base)))) | |||||
| `(popup-menu-mouse-face ((,class (:inherit highlight)))) | |||||
| `(popup-scroll-bar-background-face ((,class (:background ,bg2)))) | |||||
| `(popup-scroll-bar-foreground-face ((,class (:background ,act2)))) | |||||
| `(popup-tip-face ((,class (:background ,ttip-sl :foreground ,base :bold nil :italic nil :underline nil)))) | |||||
| ;;;;; powerline | |||||
| `(powerline-active1 ((,class (:background ,act2 :foreground ,base)))) | |||||
| `(powerline-active2 ((,class (:background ,act2 :foreground ,base)))) | |||||
| `(powerline-inactive1 ((,class (:background ,bg2 :foreground ,base)))) | |||||
| `(powerline-inactive2 ((,class (:background ,bg2 :foreground ,base)))) | |||||
| ;;;;; rainbow-delimiters | |||||
| `(rainbow-delimiters-depth-1-face ((,class :foreground ,keyword))) | |||||
| `(rainbow-delimiters-depth-2-face ((,class :foreground ,func))) | |||||
| `(rainbow-delimiters-depth-3-face ((,class :foreground ,str))) | |||||
| `(rainbow-delimiters-depth-4-face ((,class :foreground ,green))) | |||||
| `(rainbow-delimiters-depth-5-face ((,class :foreground ,yellow))) | |||||
| `(rainbow-delimiters-depth-6-face ((,class :foreground ,keyword))) | |||||
| `(rainbow-delimiters-depth-7-face ((,class :foreground ,func))) | |||||
| `(rainbow-delimiters-depth-8-face ((,class :foreground ,str))) | |||||
| `(rainbow-delimiters-mismatched-face ((,class :foreground ,err :overline t))) | |||||
| `(rainbow-delimiters-unmatched-face ((,class :foreground ,err :overline t))) | |||||
| ;;;;; rcirc | |||||
| `(rcirc-bright-nick ((,class (:background ,aqua-bg :foreground ,cyan)))) | |||||
| `(rcirc-dim-nick ((,class (:foreground ,base-dim)))) | |||||
| `(rcirc-keyword ((,class (:background ,green-bg-s :foreground ,green)))) | |||||
| `(rcirc-timestamp ((,class (:foreground ,keyword)))) | |||||
| `(rcirc-track-keyword ((,class (:background ,green :foreground ,bg1)))) | |||||
| `(rcirc-url ((,class (:inherit link)))) | |||||
| ;;;;; shm | |||||
| `(shm-current-face ((,class (:background ,green-bg-s)))) | |||||
| `(shm-quarantine-face ((,class (:background ,red-bg-s)))) | |||||
| ;;;;; show-paren | |||||
| `(show-paren-match ((,class (:background ,green-bg-s)))) | |||||
| `(show-paren-mismatch ((,class (:background ,red-bg-s)))) | |||||
| ;;;;; smartparens | |||||
| `(sp-pair-overlay-face ((,class (:background ,highlight :foreground nil)))) | |||||
| `(sp-show-pair-match-face ((,class (:foreground ,mat :inherit bold :underline t)))) | |||||
| ;;;;; spaceline | |||||
| `(spaceline-flycheck-error ((,class (:foreground ,err)))) | |||||
| `(spaceline-flycheck-info ((,class (:foreground ,keyword)))) | |||||
| `(spaceline-flycheck-warning((,class (:foreground ,war)))) | |||||
| `(spaceline-python-venv ((,class (:foreground ,comp)))) | |||||
| ;;;;; spacemacs-specific | |||||
| `(spacemacs-transient-state-title-face ((,class (:background nil :foreground ,comp :box nil :inherit bold)))) | |||||
| ;;;;; swiper | |||||
| `(swiper-line-face ((,class (:background ,highlight :inherit bold)))) | |||||
| `(swiper-match-face-1 ((,class (:inherit bold)))) | |||||
| `(swiper-match-face-2 ((,class (:foreground ,head1 :underline t)))) | |||||
| `(swiper-match-face-3 ((,class (:foreground ,head4 :underline t)))) | |||||
| `(swiper-match-face-4 ((,class (:foreground ,head3 :underline t)))) | |||||
| ;;;;; tabbar | |||||
| `(tabbar-button ((,class (:inherit tabbar-default )))) | |||||
| `(tabbar-button-highlight ((,class (:inherit tabbar-default)))) | |||||
| `(tabbar-default ((,class (:background ,bg1 :foreground ,head1 :height 0.9)))) | |||||
| `(tabbar-highlight ((,class (:underline t)))) | |||||
| `(tabbar-selected ((,class (:inherit tabbar-default :foreground ,func :weight bold)))) | |||||
| `(tabbar-separator ((,class (:inherit tabbar-default)))) | |||||
| `(tabbar-unselected ((,class (:inherit tabbar-default :background ,bg1 :slant italic :weight light)))) | |||||
| ;;;;; term | |||||
| `(term ((,class (:foreground ,base :background ,bg1)))) | |||||
| `(term-color-black ((,class (:foreground ,bg4)))) | |||||
| `(term-color-blue ((,class (:foreground ,keyword)))) | |||||
| `(term-color-cyan ((,class (:foreground ,cyan)))) | |||||
| `(term-color-green ((,class (:foreground ,green)))) | |||||
| `(term-color-magenta ((,class (:foreground ,magenta)))) | |||||
| `(term-color-red ((,class (:foreground ,red)))) | |||||
| `(term-color-white ((,class (:foreground ,base)))) | |||||
| `(term-color-yellow ((,class (:foreground ,yellow)))) | |||||
| ;;;;; web-mode | |||||
| `(web-mode-builtin-face ((,class (:inherit ,font-lock-builtin-face)))) | |||||
| `(web-mode-comment-face ((,class (:inherit ,font-lock-comment-face)))) | |||||
| `(web-mode-constant-face ((,class (:inherit ,font-lock-constant-face)))) | |||||
| `(web-mode-doctype-face ((,class (:inherit ,font-lock-comment-face)))) | |||||
| `(web-mode-function-name-face ((,class (:inherit ,font-lock-function-name-face)))) | |||||
| `(web-mode-html-attr-name-face ((,class (:foreground ,func)))) | |||||
| `(web-mode-html-attr-value-face ((,class (:foreground ,keyword)))) | |||||
| `(web-mode-html-tag-face ((,class (:foreground ,keyword)))) | |||||
| `(web-mode-keyword-face ((,class (:foreground ,keyword)))) | |||||
| `(web-mode-string-face ((,class (:foreground ,str)))) | |||||
| `(web-mode-symbol-face ((,class (:foreground ,type)))) | |||||
| `(web-mode-type-face ((,class (:inherit ,font-lock-type-face)))) | |||||
| `(web-mode-warning-face ((,class (:inherit ,font-lock-warning-face)))) | |||||
| ;;;;; which-key | |||||
| `(which-key-command-description-face ((,class (:foreground ,base)))) | |||||
| `(which-key-group-description-face ((,class (:foreground ,keyword)))) | |||||
| `(which-key-key-face ((,class (:foreground ,func :inherit bold)))) | |||||
| `(which-key-separator-face ((,class (:background nil :foreground ,str)))) | |||||
| `(which-key-special-key-face ((,class (:background ,func :foreground ,bg1)))) | |||||
| ;;;;; which-function-mode | |||||
| `(which-func ((,class (:foreground ,func)))) | |||||
| ;;;;; whitespace-mode | |||||
| `(whitespace-empty ((,class (:background nil :foreground ,yellow)))) | |||||
| `(whitespace-indentation ((,class (:background nil :foreground ,war)))) | |||||
| `(whitespace-line ((,class (:background nil :foreground ,comp)))) | |||||
| `(whitespace-newline ((,class (:background nil :foreground ,comp)))) | |||||
| `(whitespace-space ((,class (:background nil :foreground ,act2)))) | |||||
| `(whitespace-space-after-tab ((,class (:background nil :foreground ,yellow)))) | |||||
| `(whitespace-space-before-tab ((,class (:background nil :foreground ,yellow)))) | |||||
| `(whitespace-tab ((,class (:background nil)))) | |||||
| `(whitespace-trailing ((,class (:background ,err :foreground ,war)))) | |||||
| ;;;;; other, need more work | |||||
| `(ac-completion-face ((,class (:underline t :foreground ,keyword)))) | |||||
| `(ffap ((,class (:foreground ,base)))) | |||||
| `(flx-highlight-face ((,class (:foreground ,comp :underline nil)))) | |||||
| `(icompletep-determined ((,class :foreground ,keyword))) | |||||
| `(js2-external-variable ((,class (:foreground ,comp)))) | |||||
| `(js2-function-param ((,class (:foreground ,const)))) | |||||
| `(js2-jsdoc-html-tag-delimiter ((,class (:foreground ,str)))) | |||||
| `(js2-jsdoc-html-tag-name ((,class (:foreground ,keyword)))) | |||||
| `(js2-jsdoc-value ((,class (:foreground ,str)))) | |||||
| `(js2-private-function-call ((,class (:foreground ,const)))) | |||||
| `(js2-private-member ((,class (:foreground ,base)))) | |||||
| `(js3-error-face ((,class (:underline ,war)))) | |||||
| `(js3-external-variable-face ((,class (:foreground ,var)))) | |||||
| `(js3-function-param-face ((,class (:foreground ,keyword)))) | |||||
| `(js3-instance-member-face ((,class (:foreground ,const)))) | |||||
| `(js3-jsdoc-tag-face ((,class (:foreground ,keyword)))) | |||||
| `(js3-warning-face ((,class (:underline ,keyword)))) | |||||
| `(slime-repl-inputed-output-face ((,class (:foreground ,comp)))) | |||||
| `(trailing-whitespace ((,class :foreground nil :background ,err))) | |||||
| `(undo-tree-visualizer-current-face ((,class :foreground ,keyword))) | |||||
| `(undo-tree-visualizer-default-face ((,class :foreground ,base))) | |||||
| `(undo-tree-visualizer-register-face ((,class :foreground ,comp))) | |||||
| `(undo-tree-visualizer-unmodified-face ((,class :foreground ,var)))) | |||||
| (custom-theme-set-variables | |||||
| theme-name | |||||
| `(ansi-color-names-vector [,bg4 ,red ,green ,yellow ,blue ,magenta ,cyan ,base])) | |||||
| )) | |||||
| ;;;###autoload | |||||
| (when load-file-name | |||||
| (add-to-list 'custom-theme-load-path | |||||
| (file-name-as-directory (file-name-directory load-file-name)))) | |||||
| (provide 'spacemacs-common) | |||||
| ;; Local Variables: | |||||
| ;; no-byte-compile: t | |||||
| ;; End: | |||||
| ;;; spacemacs-common.el ends here | |||||
| @ -0,0 +1,7 @@ | |||||
| (require 'spacemacs-common) | |||||
| (deftheme spacemacs-dark "Spacemacs theme, the dark version") | |||||
| (create-spacemacs-theme 'dark 'spacemacs-dark) | |||||
| (provide-theme 'spacemacs-dark) | |||||
| @ -0,0 +1,7 @@ | |||||
| (require 'spacemacs-common) | |||||
| (deftheme spacemacs-light "Spacemacs theme, the light version") | |||||
| (create-spacemacs-theme 'light 'spacemacs-light) | |||||
| (provide-theme 'spacemacs-light) | |||||
| @ -1,6 +1,6 @@ | |||||
| ;;; packages.el --- test layer configuration file for Spacemacs. | ;;; packages.el --- test layer configuration file for Spacemacs. | ||||
| ;; | ;; | ||||
| ;; Copyright (c) 2012-2016 Sylvain Benner & Contributors | |||||
| ;; Copyright (c) 2012-2017 Sylvain Benner & Contributors | |||||
| ;; | ;; | ||||
| ;; This file is not part of GNU Emacs. | ;; This file is not part of GNU Emacs. | ||||
| ;; | ;; | ||||
| @ -0,0 +1,330 @@ | |||||
| #+TITLE: Beginners tutorial | |||||
| * Beginners tutorial :TOC_4_gh:noexport: | |||||
| - [[#why-spacemacs][Why Spacemacs?]] | |||||
| - [[#install][Install]] | |||||
| - [[#1-install-emacs][1. Install Emacs]] | |||||
| - [[#2-install-git][2. Install Git]] | |||||
| - [[#3-install-spacemacs][3. Install Spacemacs]] | |||||
| - [[#note-for-windows-users][Note for Windows users]] | |||||
| - [[#4-install-the-default-font][4. Install the default font]] | |||||
| - [[#5-open-spacemacs-and-choose-default-editing-style][5. Open Spacemacs and choose default editing style]] | |||||
| - [[#getting-started][Getting started]] | |||||
| - [[#keybinding-notation][Keybinding notation]] | |||||
| - [[#modal-text-editing---why-and-how][Modal text editing - why and how?]] | |||||
| - [[#start-the-vim-tutorial][Start the Vim tutorial]] | |||||
| - [[#using-the-spacebar-to-launch-commands][Using the spacebar to launch commands]] | |||||
| - [[#buffers-windows-and-frames][Buffers, windows and frames]] | |||||
| - [[#accessing-files][Accessing files]] | |||||
| - [[#configuring-spacemacs][Configuring Spacemacs]] | |||||
| - [[#adding-language-support-and-other-features-using-layers][Adding language support and other features: using layers]] | |||||
| - [[#changing-the-colour-theme][Changing the colour theme]] | |||||
| - [[#starting-maximized][Starting maximized]] | |||||
| - [[#quitting][Quitting]] | |||||
| - [[#additional-features-tips-and-troubleshooting][Additional features, tips and troubleshooting]] | |||||
| - [[#org-mode][Org mode]] | |||||
| - [[#version-control---the-intelligent-way][Version control - the intelligent way]] | |||||
| - [[#daemon-mode-and-instant-startup-linux][Daemon mode and instant startup (Linux)]] | |||||
| - [[#swap-caps-lock-and-esc-keys-on-your-keyboard][Swap caps lock and esc keys on your keyboard]] | |||||
| - [[#troubleshooting-and-further-info][Troubleshooting and further info]] | |||||
| * Why Spacemacs? | |||||
| - Unparallelled text and structure editing for all types of writing tasks: | |||||
| creative writing, blogging, note-taking, todo-lists, scientific papers... | |||||
| - Powerful modes for programming in dozens of programming languages | |||||
| - Deeply customizable yet beginner-friendly | |||||
| * Install | |||||
| Spacemacs is a beginner-friendly and powerful extension of a popular text | |||||
| editor called Emacs. To install Spacemacs you need to first install base Emacs | |||||
| and then download the Spacemacs extension files, which is most easily done by | |||||
| using a program called Git. The steps are easy and outlined below. | |||||
| ** 1. [[https://github.com/syl20bnr/spacemacs#prerequisites][Install Emacs]] | |||||
| ** 2. [[https://git-scm.com/downloads][Install Git]] | |||||
| ** 3. Install Spacemacs | |||||
| Open a terminal or command prompt, paste the following code to it: | |||||
| #+BEGIN_SRC sh | |||||
| git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d | |||||
| #+END_SRC | |||||
| Press enter to execute the code and the program you installed in the previous | |||||
| step, Git, will download the Spacemacs extension files. | |||||
| *** Note for Windows users | |||||
| If you use windows, you have to modify the git command by inserting the correct | |||||
| path to your .emacs.d folder. The dot before the folder means that it is hidden, | |||||
| so you'll have to search for hidden files to find the folder. When you have | |||||
| found the folder, substitute the original path with the correct one. The proper | |||||
| code would look something like this: | |||||
| #+BEGIN_SRC sh | |||||
| git clone https://github.com/syl20bnr/spacemacs /path/to/your/.emacs.d | |||||
| #+END_SRC | |||||
| ** 4. Install the default font | |||||
| The default font used by Spacemacs is Source Code Pro by Adobe. It is | |||||
| recommended to [[https://github.com/adobe-fonts/source-code-pro#font-installation-instructions][install]] it on your system to ensure correct visual | |||||
| representation. Also a "Fallback font" for nicer-looking symbols in the modeline | |||||
| (bottom bar) is recommended. These depend on the system: | |||||
| - gnu/linux: Nanum | |||||
| - MacOS: Arial Unicode MS | |||||
| - Windows: MS Gothic or Lucida Sans Unicode | |||||
| If the modeline doesn't look as great as in the pictures, make sure you have the | |||||
| correct fallback font installed on your system. | |||||
| ** 5. Open Spacemacs and choose default editing style | |||||
| Open Spacemacs by clicking the Emacs icon in your applications menu. The first | |||||
| time Spacemacs launches, it will load and install packages and prompt you for | |||||
| your preferred editing style. You have two options: Vim ("Among the stars aboard | |||||
| the Evil flagship") and Emacs. If you haven't used Emacs before or are unsure | |||||
| about the differences of the editing styles, we recommend selecting the default, | |||||
| Vim, by pressing enter. Using this configuration is introduced more thoroughly | |||||
| in the next section. If you are already familiar with Emacs or do not plan to | |||||
| switch into modal editing style, select Emacs with the left and right arrow | |||||
| keys. There is also a third option, "Hybrid", for more advanced users willing to | |||||
| use both styles. All of these choices can be easily changed later by editing the | |||||
| dotspacemacs-editing-style variable in the dotfile (see [[#configuring-spacemacs][Configuring Spacemacs]]), | |||||
| so if modal editing does not sweep you away, you can switch to the Emacs style | |||||
| later. | |||||
| Next, you will be prompted for the distribution you would like to start with. | |||||
| The standard distribution is recommended, press enter to select it. | |||||
| Now Spacemacs will download and install required packages. This will take some | |||||
| minutes depending on your connection. After everything is installed (you will | |||||
| see the text "n packages loaded in x s" appear in the list under the Spacemacs | |||||
| logo), restart Spacemacs. | |||||
| Now your installation process is complete, congratulations! For troubleshooting, | |||||
| see the last section. | |||||
| * Getting started | |||||
| ** Keybinding notation | |||||
| The power of Spacemacs lies in its efficient keybindings. Because it is built on | |||||
| Emacs, we will use Emacs conventions for keybinding notation. The most important | |||||
| modifier keys are: | |||||
| ~SPC~ = ~Space~, used as the leader key in Vim editing style. | |||||
| ~C-~ = ~Ctrl~ | |||||
| ~M-~ (for "meta") = ~Alt~ | |||||
| ~S-~ = ~Shift~ | |||||
| The modifier keys can be used either in a sequence or as key chords by pressing | |||||
| two keys at the same time. ~SPC 1~ is notation for a key sequence and means | |||||
| pressing ~Space~ first and pressing ~1~ after it. Key chords are notated by | |||||
| writing a ~-~ between the keys. Thus ~C-c~ means pressing ~Ctrl~ and the letter | |||||
| ~c~ simultaneously. Key chords and sequences can also be combined: ~C-c a~ means | |||||
| "First press ~Ctrl~ and ~c~ simultaneously, then press ~a~". ~C-c C-a~ means | |||||
| "First press ~Ctrl~ and ~c~ simultaneously, then press ~Ctrl~ and ~a~ | |||||
| simultaneously". | |||||
| This document assumes you chose the "Vim" editing style and notates accordingly. | |||||
| If you chose the Emacs editing style, just substitute ~SPC~ with ~M-m~ in all | |||||
| the commands that begin with ~SPC~. | |||||
| (Note: Other modifier keys such as ~Super~, notated with a small-case ~s-~, can | |||||
| be set up but this is rarely necessary in Spacemacs). | |||||
| ** Modal text editing - why and how? | |||||
| Writing (or programming) is typically not a simple linear process of adding | |||||
| words and lines until finished. At least as important part of the work consists | |||||
| of editing the text: deleting and rewriting parts, moving sentences around or | |||||
| jumping to an earlier point to fix a discrepancy. | |||||
| The crudest way to, for example, delete a certain line is moving the mouse to | |||||
| the line in question, clicking on the line and then deleting it by pressing | |||||
| backspace repeatedly. This is slow and inefficient, both because you have to | |||||
| take your hands from your keyboard and because repeatedly pressing backspace | |||||
| takes time. The more time you spend pressing keys, the more time and energy is | |||||
| wasted. | |||||
| To speed up editing, many editors use key chords for common editing tasks: | |||||
| ~Control-c~ for copying and so on. However, these types of shortcuts tend to | |||||
| have two problems. First, you have to press two keys at the same time, which is | |||||
| harder to coordinate and thus slower than pressing keys in a sequence. Second, | |||||
| you typically have to use your weakest fingers (pinkies) extensively and bend | |||||
| your wrists in unergonomic positions, which is uncomfortable for many and risks | |||||
| developing carpal tunnel syndrome in the long run. | |||||
| By contrast, Spacemacs uses modal editing. Modal editing means that different | |||||
| modes are used for editing and writing text. While this can sound complicated at | |||||
| first, in practice it can be learned quickly and once learned is unparallelled | |||||
| in speed and ergonomy. Our earlier example of deleting a certain line of text (a | |||||
| very common edit task) can be achieved in Spacemacs by simply navigating to the | |||||
| line in question with the keys ~j~ and ~k~ (navigation keys) and pressing ~d~ | |||||
| (for "delete") two times! | |||||
| You might have noticed that this was achieved entirely without moving your | |||||
| fingers from your home row (the row where your fingers lie in rest when | |||||
| touch-typing) and without using modifier keys. | |||||
| ** Start the Vim tutorial | |||||
| The modal editing features of Spacemacs originate from a text editor called Vi, | |||||
| and thus the modal editing tutorial is called eVIl tutor. Press ~SPC h T~ (that | |||||
| is, the spacebar followed by ~h~ and ~T~) to familiarize yourself with | |||||
| modal editig. | |||||
| ** Using the spacebar to launch commands | |||||
| Now that you are familiar with writing and editing text it is time to put the | |||||
| "Space" into Spacemacs. Because the spacebar is the most accessible key on the | |||||
| keyboard and is pressed by the strongest fingers (the thumbs), it is a natural | |||||
| choice for launching commands. You can think of it as the start menu of | |||||
| Spacemacs. | |||||
| A short instant after the spacebar is pressed a menu pops up. This interactive | |||||
| menu shows you what submenus and commands can be accessed by subsequent | |||||
| keypresses. Browsing around this menu is a great way of finding new features in | |||||
| Spacemacs, so keep on eye on the different options! ~ESC~ usually breaks the | |||||
| combination you don't want to use. | |||||
| ** Buffers, windows and frames | |||||
| Because Emacs (the extension of which Spacemacs is) was developed in the 80's | |||||
| before the advent of modern graphical user interfaces, Emacs has | |||||
| a different name of what we normally call "windows": in Emacs these are | |||||
| called "frames". A frame is what pops up when you launch Spacemacs from your | |||||
| desktop shortcut. A frame contains windows and buffers. | |||||
| Windows are the visual spaces a frame is divided into. The default | |||||
| is one, but windows can be split to allow editing multiple files in one frame. | |||||
| Let's try this. Press ~SPC~ to bring up the menu. You can see different letters | |||||
| having different submenus associated with them, usually with a mnemonic for | |||||
| easier recall. The letter w is assigned for "windows": press it. A new menu | |||||
| opens with further options. Write the character / to split the currently active | |||||
| window vertically into two. | |||||
| Now you should see two windows of this tutorial, and the one on the left should | |||||
| be active, as can be seen from the modeline in the bottom or by moving the | |||||
| cursor around using the navigation keys. This isn't very useful, as we | |||||
| would probably want to see a different file on the right. | |||||
| First, activate the window on the right with ~SPC 2~. Now that the window on the | |||||
| right is active, we can open a different buffer for a different file. We'll use | |||||
| the scratch buffer, which can be used like a notepad. Be warned, unlike other | |||||
| buffers it doesn't prompt you whether you want to save the changes you've made | |||||
| when quitting the program! Press ~SPC b~ to open the buffers menu and then | |||||
| switch to the scratch buffer by pressing s. Now you have two different buffers | |||||
| in two different windows open, great! You can write something on the scratch | |||||
| buffer, and when you're done, make sure that the scratch window is active and | |||||
| close it by pressing ~SPC w d~. | |||||
| Now the tutorial window fills the whole frame. But you only closed the window, | |||||
| not the scratch buffer, so the buffer is still open beneath the surface. You can | |||||
| quickly switch between the current buffer and the last with ~SPC TAB~: use this | |||||
| a couple of times to switch between the tutorial and the scratch buffer. ~SPC b~ | |||||
| has more options for switching between buffers, for example ~SPC b b~ opens a | |||||
| searchable list of all currently open buffers and ~SPC b d~ closes the current | |||||
| buffer. | |||||
| ** Accessing files | |||||
| Files can be accessed under the ~SPC f~ mnemonic. You can navigate to any file | |||||
| with ~SPC f f~ and open it by pressing enter. Accessing recently opened files is | |||||
| a very common task and is done with ~SPC f r~. An edited file is saved with | |||||
| ~SPC f s~. | |||||
| * Configuring Spacemacs | |||||
| :PROPERTIES: | |||||
| :CUSTOM_ID: configuring-spacemacs | |||||
| :END: | |||||
| ** Adding language support and other features: using layers | |||||
| Spacemacs divides its configuration into self-contained units called | |||||
| configuration layers. These layers are stacked on top of each other to achieve a | |||||
| custom configuration. | |||||
| By default Spacemacs uses a dotfile called ~/.spacemacs to control which layers | |||||
| to load. Within this file you can also configure certain features. First, split | |||||
| the window vertically to view both this tutorial and the dotfile simultaneously | |||||
| (~SPC w /~). Open the dotfile by pressing ~SPC f e d~. Navigate to the line | |||||
| starting with "dotspacemacs-configuration-layers". The following lines have | |||||
| further instructions: uncomment org and git layers if you want to be | |||||
| familiarized with them. More layers for different languages and tools can be | |||||
| found on [[https://github.com/syl20bnr/spacemacs/tree/master/layers][github]] or by pressing ~SPC h SPC~. The added layers will be installed | |||||
| upon restart of Spacemacs. | |||||
| Mac users: add the osx layer to use the OS X keybindings! | |||||
| ** Changing the colour theme | |||||
| You can toggle the theme by ~SPC T n~. This cycles between currently | |||||
| activated themes. You can find more by adding the themes-megapack layer and | |||||
| activate them by writing their names in the dotspacemacs-themes list. | |||||
| ** Starting maximized | |||||
| Editing the dotspacemacs-maximized-at-startup variable from nil to t will start | |||||
| Spacemacs maximized. | |||||
| ** Quitting | |||||
| Save the changes you've made to the dotfile with ~SPC f s~ and then quit emacs | |||||
| by ~SPC q q~. You can return to this tutorial by clicking it on the home screen! | |||||
| * Additional features, tips and troubleshooting | |||||
| ** Org mode | |||||
| Org mode is one of the best features of Spacemacs and enough reason to warrant | |||||
| its use. Org mode's official description tells that it is "for keeping notes, | |||||
| maintaining todo lists, planning projects, and authoring documents with a fast | |||||
| and effective plain-text system", but this gives only a small inkling of its | |||||
| versatility. If you do any kind of writing at all, chances are that Org mode | |||||
| will make it easier and more fun. This tutorial was written in Org mode. | |||||
| Install the Org layer and open this tutorial. Press ~S-TAB~ repeatedly and | |||||
| observe that this cycles the visibility of the contents of different headlines. | |||||
| Press t in normal mode and observe that you can add TODO tags on headlines. | |||||
| Press ~M-k~ or ~M-j~ in normal mode and see how you can quickly move parts of | |||||
| the document around. | |||||
| This is not even scratching the surface of Org mode, so you should look into its | |||||
| [[https://github.com/syl20bnr/spacemacs/blob/master/layers/%252Bemacs/org/README.org][documentation]] for more information. Googling for Org mode tutorials is also very | |||||
| helpful in finding out the most useful features of it! | |||||
| ** Version control - the intelligent way | |||||
| Version control means keeping track of the changes and edits you have made to | |||||
| your document. Often version control is done by saving different versions of the | |||||
| document with different names, such as "document version 13" and so on. This is | |||||
| crude in many ways: if you want to, for example, re-add something you deleted, | |||||
| you have to manually open several past versions of the document to find the one | |||||
| with the deleted part, and then copy-paste it to the most recent file. More | |||||
| complicated edits will be harder still. Fortunately, there is a much better way. | |||||
| Git is the most popular version control system for programmers, but it can be as | |||||
| useful for people that are writing school or scientific papers, fiction or blog | |||||
| posts as well. | |||||
| Install the git layer, restart Spacemacs and open a file you want to version | |||||
| control. You can check the status of your file by pressing ~SPC g s~. Select the | |||||
| folder your file is in. You will be prompted whether you want to create a | |||||
| repository in the folder. Select yes. You will see a list of "Untracked files": | |||||
| navigate to the file you want to track and press s to "stage changes". You might | |||||
| be prompted to save the file: save it if necessary. Now the new file needs to be | |||||
| commited: press c and c again. Two windows pop up: one showing the changes | |||||
| you've made since the last edit (in this case, the whole document) and another | |||||
| prompting for a commit message. Write "Initial commit", press ESC to exit back | |||||
| to normal mode and press ~, c~ confirm and quit the commit | |||||
| message. To abort, press ~, a~. | |||||
| Now you know how to make a commit. The commits are saved in | |||||
| the (hidden) .git folder in the same folder the tracked file(s) are in. You can | |||||
| make further commits the same way. | |||||
| ** Daemon mode and instant startup (Linux) | |||||
| Emacs can be used in daemon mode: a daemon runs in the background and launches | |||||
| clients. This way new frames launch instantly without delay. [[https://www.emacswiki.org/emacs/EmacsAsDaemon][Emacswiki]] tells | |||||
| more about the daemon and how to set it to launch automatically on startup. | |||||
| ** Swap caps lock and esc keys on your keyboard | |||||
| This is useful outside of Spacemacs as well! | |||||
| ** Troubleshooting and further info | |||||
| ~SPC ?~ shows you the keybindings in the current major mode, which is often | |||||
| helpful. For troubleshooting, please refer to the FAQ by pressing ~SPC f e f~ or | |||||
| [[https://github.com/syl20bnr/spacemacs/blob/master/doc/FAQ.org][online]]. More help is found under ~SPC h~, and with ~SPC h ~SPC~ you can access | |||||
| the comprehensive Spacemacs documentation, including this tutorial and the layer | |||||
| documents. | |||||
| The [[https://gitter.im/syl20bnr/spacemacs][Gitter chat]] can be used to ask questions if the answer cannot be found in | |||||
| the documentation. For a detailed review of Spacemacs' features one can also | |||||
| watch the [[https://www.youtube.com/playlist?list=PLrJ2YN5y27KLhd3yNs2dR8_inqtEiEweE][Spacemacs ABC series]] by Eivind Fonn on Youtube. Some of the | |||||
| keybindings have changed since the videos were uploaded but seeing someone in | |||||
| action helps spot helpful tricks that would otherwise be missed. | |||||
| @ -0,0 +1,85 @@ | |||||
| ;;; helm-spacemacs-help.el --- Spacemacs layer exploration with `helm'. | |||||
| ;; Author: Sylvain Benner <sylvain.benner@gmail.com> | |||||
| ;; Keywords: helm, spacemacs | |||||
| ;; Version: 0.1 | |||||
| ;; Package-Requires: ((helm "1.5")) | |||||
| ;; This file is free software; you can redistribute it and/or modify | |||||
| ;; it under the terms of the GNU General Public License as published by | |||||
| ;; the Free Software Foundation; either version 3, or (at your option) | |||||
| ;; any later version. | |||||
| ;; This file is distributed in the hope that it will be useful, | |||||
| ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| ;; GNU General Public License for more details. | |||||
| ;; You should have received a copy of the GNU General Public License | |||||
| ;; along with GNU Emacs; see the file COPYING. If not, write to | |||||
| ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||||
| ;; Boston, MA 02110-1301, USA. | |||||
| ;;; Commentary: | |||||
| ;; This package adds a convenient way to discover Spacemacs FAQs in a | |||||
| ;; a helm buffer. | |||||
| ;; These sources are not part of `helm-spacemacs-help' feature because | |||||
| ;; of its `org' dependency which triggers lots of `require'. | |||||
| ;;; Code: | |||||
| (require 'helm-spacemacs-help) | |||||
| (require 'helm-org) | |||||
| (defvar helm-spacemacs-help--faq-filename | |||||
| (concat spacemacs-docs-directory "FAQ.org") | |||||
| "Location of the FAQ file.") | |||||
| ;;;###autoload | |||||
| (defun helm-spacemacs-help-faq () | |||||
| "Helm session to search for the FAQ." | |||||
| (interactive) | |||||
| (helm-spacemacs-help-mode) | |||||
| (helm :buffer "*helm: spacemacs*" | |||||
| :sources `(,(helm-spacemacs-help//faq-source)))) | |||||
| (defun helm-spacemacs-help//faq-source () | |||||
| "Construct the helm source for the FAQ." | |||||
| `((name . "FAQ") | |||||
| (candidates . ,(helm-spacemacs-help//faq-candidates)) | |||||
| (candidate-number-limit) | |||||
| (action . (("Go to question" . helm-spacemacs-help//faq-goto-marker))))) | |||||
| (defun helm-spacemacs-help//faq-candidate (cand) | |||||
| (let ((str (substring-no-properties (car cand)))) | |||||
| (when (string-match "\\`.*/\\([^/]*\\)/\\(.*\\)\\'" str) | |||||
| (cons (concat (propertize | |||||
| (match-string 1 str) | |||||
| 'face 'font-lock-type-face) | |||||
| ": " (match-string 2 str)) | |||||
| (cdr cand))))) | |||||
| (defun helm-spacemacs-help//faq-candidates () | |||||
| (let* ((helm-org-format-outline-path nil) | |||||
| (cands (helm-org-get-candidates (list helm-spacemacs-help--faq-filename))) | |||||
| section result) | |||||
| (dolist (c cands) | |||||
| (let ((str (substring-no-properties (car c)))) | |||||
| (when (string-match "\\`\\* \\(.*\\)\\'" str) | |||||
| (setq section (match-string 1 str))) | |||||
| (when (string-match "\\`\\*\\* \\(.*\\)\\'" str) | |||||
| (push (cons (concat (propertize section 'face 'font-lock-type-face) | |||||
| ": " (match-string 1 str)) | |||||
| (cdr c)) | |||||
| result)))) | |||||
| result)) | |||||
| (defun helm-spacemacs-help//faq-goto-marker (marker) | |||||
| (find-file helm-spacemacs-help--faq-filename) | |||||
| (goto-char marker) | |||||
| (org-show-context) | |||||
| (org-show-entry)) | |||||
| (provide 'helm-spacemacs-faq) | |||||
| ;;; helm-spacemacs-faq.el ends here | |||||