Commit 975502c4 authored by syl20bnr's avatar syl20bnr
Browse files

Merge branch 'develop' (v0.22.0)

parents 1d9fe7bd 3ef6aa29
......@@ -329,7 +329,7 @@ This is a simple `contrib` configuration layer listing a bunch of themes,
you can find it [here][themes-megapack].
To install it, just add `themes-megapack` to your `~/.spacemacs`. You have now
installed around 100 themes you are free to try with <kbd>SPC h t</kbd>
installed around 100 themes you are free to try with <kbd>SPC T h</kbd>
(helm-themes).
## Managing private configuration layers
......@@ -539,16 +539,23 @@ the variable `dotspacemacs-default-theme`. For instance, to specify `zenburn`:
dotspacemacs-default-theme 'zenburn)
```
Key Binding | Description
---------------------|------------------------------------------------------------
<kbd>SPC c t</kbd> | cycle between `Spacemacs` themes
<kbd>SPC h t</kbd> | select a theme using a `helm` buffer
`Spacemacs` available themes:
Some themes are supported by `Spacemacs`:
- [Solarized][solarized-theme]
- [Monokai][monokai-theme]
- [Zenburn][zenburn-theme]
It is possible to set any other themes but their compatibility with `Spacemacs`
is not guaranteed (i.e. there may be some missing faces etc...).
Key Binding | Description
---------------------|------------------------------------------------------------
<kbd>SPC T n</kbd> | switch to next theme supported by `Spacemacs`.
<kbd>SPC h t</kbd> | select a theme using a `helm` buffer.
**Note:** Due to the inner working of themes in Emacs, switching theme during
the same session may have some weird side effects. Although these side effects
should be pretty rare (especially when switching to a supported theme).
# UI elements
`Spacemacs` has a minimalistic and distraction free UI with a lot of subtle
......@@ -1010,15 +1017,15 @@ under point. The highlights can be stacked.
Key Binding | Description
-----------------------|----------------------------------------------------------------
<kbd>SPC h c</kbd> | clear the highlightings
<kbd>SPC h g c</kbd> | clear the highlightings globally (all opened buffers)
<kbd>SPC h h</kbd> | highlight all occurrence of the word at point
<kbd>SPC h g h</kbd> | highlight all occurrence of the word at point globally (all opened buffers)
<kbd>SPC h n</kbd> | next highlighted occurrence
<kbd>SPC h N</kbd> | previous highlighted occurrence
<kbd>SPC h p</kbd> | toggle auto-highlight of the enclosing parenthesis
<kbd>SPC h r</kbd> | restore saved highlights in the current buffer
<kbd>SPC h s</kbd> | save current highlights
<kbd>SPC h c</kbd> | clear the highlightings
<kbd>SPC h g c</kbd> | clear the highlightings globally (all opened buffers)
<kbd>SPC h h</kbd> | highlight all occurrence of the word at point
<kbd>SPC h g h</kbd> | highlight all occurrence of the word at point globally (all opened buffers)
<kbd>SPC h n</kbd> | next highlighted occurrence
<kbd>SPC h N</kbd> | previous highlighted occurrence
<kbd>SPC h p</kbd> | toggle auto-highlight of the enclosing parenthesis
<kbd>SPC h r</kbd> | restore saved highlights in the current buffer
<kbd>SPC h s</kbd> | save current highlights
### Auto-highlight symbols
......@@ -1028,21 +1035,21 @@ Key Binding | Description
Key Binding | Description
-----------------------|----------------------------------------------------------------
<kbd>SPC s e</kbd> | edit all occurrences of the current symbol
<kbd>SPC t h</kbd> | toggle the auto highlighting
<kbd>SPC s e</kbd> | edit all occurrences of the current symbol
<kbd>SPC t h</kbd> | toggle the auto highlighting
Navigation between the highlighted symbols can be done with the commands:
Key Binding | Description
-----------------------|------------------------------------------------------------
<kbd>*</kbd> | initiate navigation micro-state
<kbd>SPC s b</kbd> | go to the last searched occurrence of the last highlighted symbol
<kbd>SPC s n</kbd> | go to next occurrence and initiate navigation micro-state
<kbd>SPC s N</kbd> | go to previous occurrence and initiate navigation micro-state
<kbd>SPC s r b</kbd> | change range to `whole buffer`
<kbd>SPC s r d</kbd> | change range to `display area`
<kbd>SPC s r f</kbd> | change range to `function`
<kbd>SPC s R</kbd> | change range to default (`whole buffer`)
<kbd>SPC s b</kbd> | go to the last searched occurrence of the last highlighted symbol
<kbd>SPC s n</kbd> | go to next occurrence and initiate navigation micro-state
<kbd>SPC s N</kbd> | go to previous occurrence and initiate navigation micro-state
<kbd>SPC s r b</kbd> | change range to `whole buffer`
<kbd>SPC s r d</kbd> | change range to `display area`
<kbd>SPC s r f</kbd> | change range to `function`
<kbd>SPC s R</kbd> | change range to default (`whole buffer`)
In 'Spacemacs' highlight symbol micro-state:
......@@ -1585,10 +1592,10 @@ In `org`, [evil-org-mode][] is activated.
Key Binding | Description
----------------------|------------------------------------------------------------
<kbd>SPC m a</kbd> | org-agenda
<kbd>SPC m A</kbd> | org-archive-subtree
<kbd>SPC m C</kbd> | evil-org-recompute-clocks
<kbd>SPC m t</kbd> | org-show-todo-tree
<kbd>SPC m c</kbd> | org-archive-subtree
<kbd>SPC m l</kbd> | evil-org-open-links
<kbd>SPC m o</kbd> | evil-org-recompute-clocks
<kbd>gh</kbd> | outline-up-heading
<kbd>gj</kbd> | org-forward-heading-same-level
<kbd>gk</kbd> | org-backward-heading-same-level
......
......@@ -195,6 +195,14 @@ Especially to grow the number of configuration layers, for instance to support n
If you are ready to contribute please consult the [contribution guidelines][CONTRIBUTE.md]
first.
# FAQ
- Why manually installed packages with `package-install` are automatically
deleted by `Spacemacs` when it starts ?
To declare new packages you have to create a new configuration layer, see
the quick start guide [here](https://github.com/syl20bnr/spacemacs#configuration).
[Twitter]: http://i.imgur.com/tXSoThF.png
[philosophy]: https://github.com/syl20bnr/spacemacs/blob/master/DOCUMENTATION.md#philosophy
[goals]: https://github.com/syl20bnr/spacemacs/blob/master/DOCUMENTATION.md#goals
......
......@@ -6,16 +6,13 @@ checkboxed todo items (http://orgmode.org/manual/Checkboxes.html)
or regular *TODO items that get saved to a TODO.org file in the
root of the repository.
# Keybindings
``` elisp
(evil-leader/set-key
"oct" 'ort/capture-todo
"occ" 'ort/capture-todo-check
"ogt" 'ort/goto-todos
)
```
Key Binding | Description
----------------------|------------------------------------------------------------
<kbd>SPC c c</kbd> | ort/capture-todo-check
<kbd>SPC c t</kbd> | ort/capture-todo
<kbd>SPC g t</kbd> | ort/goto-todos
Using the `C-u` command prefix with either of these commands will
Using the `<SPC> u` command prefix with either of these commands will
capture/visit the todos in your `user-emacs-directory` instead.
......@@ -7,8 +7,9 @@
ort/capture-todo-check
ort/goto-todos)
:init
(evil-leader/set-key
"oct" 'ort/capture-todo
"occ" 'ort/capture-todo-check
"ogt" 'ort/goto-todos
)))
(progn
(evil-leader/set-key-for-mode 'org-mode
"mct" 'ort/capture-todo
"mcc" 'ort/capture-todo-check
"mgt" 'ort/goto-todos
))))
# RegeXp Translator Mode
This contrib layer sets up pcre2el or rxt (RegeXp Translator or RegeXp Tools) which is a utility for working with regular expressions in Emacs, to parse, convert, and font-lock PCRE, Emacs and rx regexps.
Using pcre2el you can convert an Emacs Regexp to pcre (and back) (oh and output as rx too.)
## Generate all matching strings (productions)
Occasionally you come across a regexp which is designed to match a finite set of strings, e.g. a set of keywords, and it would be useful to recover the original set. (In Emacs you can generate such regexps using `regexp-opt'). The commands `rxt-convert-to-strings' (`C-c /′'), `rxt-pcre-to-strings' (`C-c / p ′') or `rxt-elisp-to-strings' (`C-c / e ′') accomplish this by generating all the matching strings ("productions") of a regexp. (The productions are copied to the kill ring as a Lisp list).
An example in Lisp code:
: (regexp-opt '("cat" "caterpillar" "catatonic"))
: ;; => "\\(?:cat\\(?:atonic\\|erpillar\\)?\\)"
: (rxt-elisp-to-strings "\\(?:cat\\(?:atonic\\|erpillar\\)?\\)")
: ;; => '("cat" "caterpillar" "catatonic")
##RE-Builder support
The Emacs RE-Builder is a useful visual tool which allows using several different built-in syntaxes via =reb-change-syntax= (=C-c TAB=). It supports Elisp read and literal syntax and =rx=, but it can only convert from the symbolic forms to Elisp, not the other way. This package hacks the RE-Builder to also work with emulated PCRE syntax, and to convert transparently between Elisp, PCRE and rx syntaxes. PCRE mode reads a delimited Perl-like literal of the form =/ ... /=, and it should correctly support using the =x= and =s= flags.
##Use from Lisp
Example of using the conversion functions:
(rxt-pcre-to-elisp "(abc|def)\\w+\\d+")
;; => "\\(\\(?:abc\\|def\\)\\)[_[:alnum:]]+[[:digit:]]+"
## Keybindings
pcre2el defines keybindings under `C-c /` so we'll define them under out perspective map `<SPC> R`
(defvar pcre2el-packages
'(
pcre2el
))
(defun pcre2el/init-pcre2el ()
(use-package pcre2el
:defer t
:commands rxt-fontify-regexp-at-point
:init
(progn
;;
(spacemacs/declare-prefix "R" "pcre2el")
(evil-leader/set-key
"R/" 'rxt-explain
"Rc" 'rxt-convert-syntax
"Rx" 'rxt-convert-to-rx
"R'" 'rxt-convert-to-strings
"Rpe" 'rxt-pcre-to-elisp
"R%" 'pcre-query-replace-regexp
"Rpx" 'rxt-pcre-to-rx
"Rps" 'rxt-pcre-to-sre
"Rp'" 'rxt-pcre-to-strings
"Rp/" 'rxt-explain-pcre
"Re/" 'rxt-explain-elisp
"Rep" 'rxt-elisp-to-pcre
"Rex" 'rxt-elisp-to-rx
"Res" 'rxt-elisp-to-sre
"Re'" 'rxt-elisp-to-strings
"Ret" 'rxt-toggle-elisp-rx
"Rt" 'rxt-toggle-elisp-rx
"Rh" 'rxt-fontify-regexp-at-point))))
......@@ -34,10 +34,8 @@ which require an initialization must be listed explicitly in the list.")
(custom-persp "@org"
(find-file (first org-agenda-files))))
(define-prefix-command 'perspectives-prefix)
(evil-leader/set-key "P" 'perspectives-prefix)
(define-prefix-command 'perspectives-custom-prefix)
(evil-leader/set-key "Po" 'perspectives-custom-prefix)
(spacemacs/declare-prefix "P" "perspectives")
(spacemacs/declare-prefix "Po" "custom-perspectives")
(evil-leader/set-key
"Pa" 'persp-add-buffer
"PA" 'persp-set-buffer
......
......@@ -98,18 +98,6 @@ NAME."
(replace-match name t)))
(save-buffer)))
(defun config-system/declare-layer (sym &optional contrib)
"Declare a layer with SYM name (symbol). If CONTRIB is non nil then the layer
is a contribution layer."
(let* ((sym-name (symbol-name sym))
(base-dir (if contrib
(ht-get config-system-layer-paths sym)
user-emacs-directory))
(dir (format "%s%s/" base-dir sym-name))
(ext-dir (format "%sextensions/" dir)))
(push (cons sym (list :contrib contrib :dir dir :ext-dir ext-dir))
config-system-config-layers)))
(defun config-system//get-contrib-category-dirs ()
"Return a list of all absolute paths to the contribution categories stored
in `config-system-contrib-categories'"
......@@ -146,6 +134,20 @@ declared at the layer level."
(spacemacs/message "-> Discovered configuration layer: %s" f)
(puthash (intern f) dir config-system-layer-paths))))))
(defun config-system/declare-layer (sym &optional contrib)
"Declare a layer with SYM name (symbol). If CONTRIB is non nil then the layer
is a contribution layer."
(let* ((sym-name (symbol-name sym))
(base-dir (if contrib
(ht-get config-system-layer-paths sym)
user-emacs-directory))
(dir (format "%s%s/" base-dir sym-name))
(ext-dir (format "%sextensions/" dir)))
(if (file-exists-p dir)
(push (cons sym (list :contrib contrib :dir dir :ext-dir ext-dir))
config-system-config-layers)
(spacemacs/message "Warning: layer %s does not exist!" sym-name))))
(defun config-system/load-layers ()
"Load all declared layers."
(config-system/load-layer-files '("funcs.el" "config.el"))
......@@ -168,7 +170,7 @@ declared at the layer level."
(load file)))))))
(defsubst config-system//add-layer-to-hash (pkg layer hash)
"Add LAYER to the list which the value stored in HASH with key PKG."
"Add LAYER to the list value stored in HASH with key PKG."
(let ((list (ht-get hash pkg)))
(puthash pkg (add-to-list 'list layer t) hash)))
......@@ -208,20 +210,25 @@ config-system-all-post-extensions "
(load pkg-file)
(dolist (pkg (eval (intern (format "%s-packages" (symbol-name sym)))))
(config-system//add-excluded-packages sym)
(config-system//add-layer-to-hash pkg sym config-system-all-packages)))
(config-system//add-layer-to-hash
pkg sym config-system-all-packages)))
;; extensions
(when (file-exists-p ext-file)
(load ext-file)
(dolist (pkg (eval (intern (format "%s-pre-extensions"
(symbol-name sym)))))
(config-system//add-excluded-packages sym)
(config-system//add-layer-to-hash pkg sym
config-system-all-pre-extensions))
(dolist (pkg (eval (intern (format "%s-post-extensions"
(symbol-name sym)))))
(config-system//add-excluded-packages sym)
(config-system//add-layer-to-hash pkg sym
config-system-all-post-extensions))))))
(let ((list-pre (intern (format "%s-pre-extensions"
(symbol-name sym))))
(list-post (intern (format "%s-post-extensions"
(symbol-name sym)))))
(when (boundp list-pre)
(dolist (pkg (eval list-pre))
(config-system//add-excluded-packages sym)
(config-system//add-layer-to-hash
pkg sym config-system-all-pre-extensions)))
(when (boundp list-post)
(dolist (pkg (eval list-post))
(config-system//add-excluded-packages sym)
(config-system//add-layer-to-hash
pkg sym config-system-all-post-extensions))))))))
(config-system//filter-out-excluded-packages)
;; number of chuncks for the loading screen
(let ((total (+ (ht-size config-system-all-packages)
......
(setq spacemacs/key-binding-prefixes '(("a" . "applications")
("as" . "applications-shells")
("b" . "buffers")
("bm" . "buffers-move")
("c" . "comments")
("e" . "errors")
("f" . "files")
("fe" . "files-emacs/spacemacs")
("g" . "git/versions-control")
("gc" . "smeargle")
("h" . "helm/help/highlight")
("hd" . "help-describe")
("i" . "insertion")
("j" . "join/split")
("n" . "narrow/numbers")
("p" . "projects")
("p4" . "perforce")
("r" . "registers/rings")
("s" . "search/symbol")
("sr" . "symbol-range")
("S" . "spelling")
("t" . "toggles")
("tm" . "toggles-modeline")
("T" . "themes")
("w" . "windows")
("wp" . "windows-popup")
("ws" . "windows-size")
("x" . "text")
("xd" . "text-delete")
("xg" . "text-google-translate")
("xm" . "text-move")
("xt" . "text-transpose")
("xw" . "text-words")
("z" . "z")))
;; ---------------------------------------------------------------------------
;; Navigation
;; ---------------------------------------------------------------------------
......
......@@ -14,7 +14,6 @@
emoji-cheat-sheet
evil-plugins
helm-rcirc
o-blog
solarized-theme
spray
))
......@@ -57,10 +56,6 @@
:init
(evil-leader/set-key "irc" 'helm-rcirc-auto-join-channels)))
(defun spacemacs/init-o-blog ()
(use-package o-blog
:defer t))
(defun spacemacs/init-revive ()
(use-package revive
:disabled t
......
......@@ -48,6 +48,16 @@
(defun system-is-mswindows ()
(string-equal system-type "windows-nt"))
(defvar spacemacs/prefix-command-string "group:"
"Prefix string for prefix commands.")
(defun spacemacs/declare-prefix (prefix name)
"Declare a prefix PREFIX. PREFIX is a string describing
a key sequence. NAME is a symbol name used as the prefix command."
(let ((command (intern (concat spacemacs/prefix-command-string name))))
(define-prefix-command command)
(evil-leader/set-key prefix command)))
;; From http://stackoverflow.com/a/18796138
;; Cycle through this set of themes
(defvar spacemacs-themes '(solarized-light
......
......@@ -39,7 +39,7 @@
"br" 'rename-current-buffer-file
"bw" 'toggle-read-only)
;; Cycling settings -----------------------------------------------------------
(evil-leader/set-key "ct" 'spacemacs/cycle-spacemacs-theme)
(evil-leader/set-key "Tn" 'spacemacs/cycle-spacemacs-theme)
;; describe functions ---------------------------------------------------------
(evil-leader/set-key
"hdf" 'describe-function
......
......@@ -619,43 +619,8 @@ determine the state to enable when escaping from the insert state.")
evil-leader/leader "SPC"
evil-leader/non-normal-prefix "s-")
;; give name to spacemacs prefixes
(dolist (x '(("a" . "applications")
("as" . "applications-shells")
("b" . "buffers")
("bm" . "buffers-move")
("c" . "comments")
("e" . "errors")
("f" . "files")
("fe" . "files-emacs/spacemacs")
("g" . "git/versions-control")
("gc" . "smeargle")
("h" . "helm/help/highlight")
("hd" . "help-describe")
("i" . "insert")
("j" . "join/split")
("n" . "narrow/numbers")
("p" . "projects")
("p4" . "perforce")
("r" . "registers/rings")
("s" . "search/symbol")
("sr" . "symbol-range")
("S" . "spelling")
("t" . "toggles")
("tm" . "toggles-modeline")
("w" . "windows")
("wp" . "windows-popup")
("ws" . "windows-size")
("x" . "text")
("xd" . "text-delete")
("xg" . "text-google-translate")
("xm" . "text-move")
("xt" . "text-transpose")
("xw" . "text-words")
("z" . "z")))
(let ((key (car x))
(prefix-command (intern (format "%s-prefix" (cdr x)))))
(define-prefix-command prefix-command)
(evil-leader/set-key key prefix-command)))
(mapc (lambda (x) (spacemacs/declare-prefix (car x) (cdr x)))
spacemacs/key-binding-prefixes)
(global-evil-leader-mode))
:config
(progn
......@@ -736,9 +701,9 @@ determine the state to enable when escaping from the insert state.")
(evil-leader/set-key-for-mode 'org-mode
"t" nil "mt" 'org-show-todo-tree
"a" nil "ma" 'org-agenda
"c" nil "mc" 'org-archive-subtree
"c" nil "mA" 'org-archive-subtree
"l" nil "ml" 'evil-org-open-links
"o" nil "mo" 'evil-org-recompute-clocks)
"o" nil "mC" 'evil-org-recompute-clocks)
(spacemacs//diminish evil-org-mode " Ⓔ"))))
(defun spacemacs/init-evil-search-highlight-persist ()
......@@ -1135,6 +1100,8 @@ determine the state to enable when escaping from the insert state.")
;; graphical envrionment
;; guide-key-tip/enabled (if window-system t)
guide-key-tip/enabled nil)
(setq guide-key/highlight-command-regexp
(cons spacemacs/prefix-command-string font-lock-warning-face))
(guide-key-mode 1)
(spacemacs//diminish guide-key-mode " Ⓖ"))))
......@@ -1350,7 +1317,7 @@ determine the state to enable when escaping from the insert state.")
(use-package helm-themes
:defer t
:init
(evil-leader/set-key "ht" 'helm-themes)))
(evil-leader/set-key "Th" 'helm-themes)))
(defun spacemacs/init-hl-anything ()
(use-package hl-anything
......@@ -1588,7 +1555,9 @@ determine the state to enable when escaping from the insert state.")
:mode ("\\.org$" . org-mode)
:defer t
:init
(setq org-log-done t)
(progn
(setq org-log-done t)
(add-hook 'org-mode-hook 'org-indent-mode))
:config
(progn
(require 'org-install)
......@@ -1597,9 +1566,10 @@ determine the state to enable when escaping from the insert state.")
(use-package org-bullets
:config
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
(use-package org-trello
:config
(add-hook 'org-mode-hook 'org-trello-mode))))
;; (use-package org-trello
;; :config
;; (add-hook 'org-mode-hook 'org-trello-mode))
))
(eval-after-load "org-agenda"
'(progn
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment