Browse Source

Update spacemacs to v0.200.9

master
Brett Langdon 9 years ago
parent
commit
542ea91642
No known key found for this signature in database GPG Key ID: A2ECAB73CE12147F
399 changed files with 8472 additions and 2340 deletions
  1. +1
    -0
      emacs.d/.gitignore
  2. +18
    -1
      emacs.d/.travis-build.sh
  3. +5
    -4
      emacs.d/.travis.yml
  4. +227
    -15
      emacs.d/CHANGELOG.org
  5. +14
    -5
      emacs.d/CONTRIBUTING.org
  6. +8
    -1
      emacs.d/README.md
  7. +1
    -1
      emacs.d/core/aprilfool/zemacs.el
  8. +1
    -1
      emacs.d/core/core-command-line.el
  9. +355
    -128
      emacs.d/core/core-configuration-layer.el
  10. +156
    -1
      emacs.d/core/core-debug.el
  11. +1
    -1
      emacs.d/core/core-display-init.el
  12. +1
    -1
      emacs.d/core/core-documentation.el
  13. +32
    -15
      emacs.d/core/core-dotspacemacs.el
  14. +1
    -1
      emacs.d/core/core-emacs-backports.el
  15. +1
    -1
      emacs.d/core/core-fonts-support.el
  16. +20
    -9
      emacs.d/core/core-funcs.el
  17. +16
    -3
      emacs.d/core/core-jump.el
  18. +5
    -5
      emacs.d/core/core-keybindings.el
  19. +8
    -2
      emacs.d/core/core-load-paths.el
  20. +1
    -1
      emacs.d/core/core-micro-state.el
  21. +1
    -1
      emacs.d/core/core-release-management.el
  22. +494
    -433
      emacs.d/core/core-spacemacs-buffer.el
  23. +42
    -161
      emacs.d/core/core-spacemacs.el
  24. +195
    -143
      emacs.d/core/core-themes-support.el
  25. +1
    -1
      emacs.d/core/core-toggle.el
  26. +1
    -1
      emacs.d/core/core-transient-state.el
  27. +2
    -2
      emacs.d/core/core-use-package-ext.el
  28. +6
    -0
      emacs.d/core/info/quickhelp.txt
  29. +1
    -1
      emacs.d/core/info/release-notes/0.102.txt
  30. +12
    -0
      emacs.d/core/info/release-notes/0.200.9.txt
  31. +20
    -0
      emacs.d/core/info/release-notes/af-2.01.txt
  32. +2
    -2
      emacs.d/core/libs/ht.el
  33. +360
    -0
      emacs.d/core/libs/ido-vertical-mode.el
  34. +1536
    -0
      emacs.d/core/libs/package-build.el
  35. +654
    -0
      emacs.d/core/libs/quelpa.el
  36. +161
    -0
      emacs.d/core/libs/spacemacs-theme/README.md
  37. +786
    -0
      emacs.d/core/libs/spacemacs-theme/spacemacs-common.el
  38. +7
    -0
      emacs.d/core/libs/spacemacs-theme/spacemacs-dark-theme.el
  39. +7
    -0
      emacs.d/core/libs/spacemacs-theme/spacemacs-light-theme.el
  40. +12
    -2
      emacs.d/core/templates/.spacemacs.template
  41. +1
    -1
      emacs.d/core/templates/packages.el.template
  42. +2
    -2
      emacs.d/core/tools/spacefmt/spacefmt.el
  43. +1
    -1
      emacs.d/core/tools/spacefmt/tests/config.el
  44. +330
    -0
      emacs.d/doc/BEGINNERS_TUTORIAL.org
  45. +5
    -3
      emacs.d/doc/CONVENTIONS.org
  46. +146
    -41
      emacs.d/doc/DOCUMENTATION.org
  47. +7
    -1
      emacs.d/doc/FAQ.org
  48. +12
    -5
      emacs.d/doc/LAYERS.org
  49. +3
    -3
      emacs.d/doc/QUICK_START.org
  50. +28
    -13
      emacs.d/doc/VIMUSERS.org
  51. +6
    -7
      emacs.d/init.el
  52. +1
    -1
      emacs.d/layers/+chat/erc/README.org
  53. +1
    -1
      emacs.d/layers/+chat/erc/config.el
  54. +1
    -1
      emacs.d/layers/+chat/erc/funcs.el
  55. +1
    -1
      emacs.d/layers/+chat/erc/local/erc-sasl/erc-sasl.el
  56. +1
    -1
      emacs.d/layers/+chat/erc/packages.el
  57. +1
    -1
      emacs.d/layers/+chat/jabber/funcs.el
  58. +1
    -1
      emacs.d/layers/+chat/jabber/packages.el
  59. +1
    -1
      emacs.d/layers/+chat/rcirc/config.el
  60. +1
    -1
      emacs.d/layers/+chat/rcirc/funcs.el
  61. +1
    -1
      emacs.d/layers/+chat/slack/README.org
  62. +1
    -1
      emacs.d/layers/+chat/slack/packages.el
  63. +1
    -1
      emacs.d/layers/+checkers/spell-checking/README.org
  64. +1
    -1
      emacs.d/layers/+checkers/spell-checking/config.el
  65. +1
    -1
      emacs.d/layers/+checkers/spell-checking/funcs.el
  66. +13
    -4
      emacs.d/layers/+checkers/spell-checking/packages.el
  67. +3
    -3
      emacs.d/layers/+checkers/syntax-checking/README.org
  68. +1
    -1
      emacs.d/layers/+checkers/syntax-checking/config.el
  69. +1
    -1
      emacs.d/layers/+checkers/syntax-checking/funcs.el
  70. +1
    -1
      emacs.d/layers/+checkers/syntax-checking/packages.el
  71. +7
    -7
      emacs.d/layers/+completion/auto-completion/README.org
  72. +1
    -1
      emacs.d/layers/+completion/auto-completion/config.el
  73. +2
    -2
      emacs.d/layers/+completion/auto-completion/funcs.el
  74. +5
    -1
      emacs.d/layers/+completion/auto-completion/packages.el
  75. +10
    -1
      emacs.d/layers/+completion/helm/funcs.el
  76. +85
    -0
      emacs.d/layers/+completion/helm/local/helm-spacemacs-help/helm-spacemacs-faq.el
  77. +5
    -59
      emacs.d/layers/+completion/helm/local/helm-spacemacs-help/helm-spacemacs-help.el
  78. +23
    -22
      emacs.d/layers/+completion/helm/packages.el
  79. +2
    -2
      emacs.d/layers/+completion/ivy/config.el
  80. +8
    -1
      emacs.d/layers/+completion/ivy/funcs.el
  81. +1
    -1
      emacs.d/layers/+completion/ivy/layers.el
  82. +2
    -7
      emacs.d/layers/+completion/ivy/local/ivy-spacemacs-help/ivy-spacemacs-help.el
  83. +7
    -3
      emacs.d/layers/+completion/ivy/packages.el
  84. +3
    -4
      emacs.d/layers/+distributions/spacemacs-base/config.el
  85. +242
    -50
      emacs.d/layers/+distributions/spacemacs-base/funcs.el
  86. +106
    -37
      emacs.d/layers/+distributions/spacemacs-base/keybindings.el
  87. +1
    -1
      emacs.d/layers/+distributions/spacemacs-base/local/centered-buffer-mode/centered-buffer-mode.el
  88. +7
    -7
      emacs.d/layers/+distributions/spacemacs-base/local/evil-evilified-state/evil-evilified-state.el
  89. +1
    -1
      emacs.d/layers/+distributions/spacemacs-base/local/holy-mode/holy-mode.el
  90. +1
    -1
      emacs.d/layers/+distributions/spacemacs-base/local/hybrid-mode/hybrid-mode.el
  91. +22
    -13
      emacs.d/layers/+distributions/spacemacs-base/packages.el
  92. +1
    -1
      emacs.d/layers/+distributions/spacemacs-bootstrap/config.el
  93. +1
    -1
      emacs.d/layers/+distributions/spacemacs-bootstrap/funcs.el
  94. +16
    -6
      emacs.d/layers/+distributions/spacemacs-bootstrap/packages.el
  95. +6
    -1
      emacs.d/layers/+distributions/spacemacs/layers.el
  96. +1
    -1
      emacs.d/layers/+emacs/better-defaults/config.el
  97. +1
    -12
      emacs.d/layers/+emacs/better-defaults/funcs.el
  98. +1
    -2
      emacs.d/layers/+emacs/better-defaults/keybindings.el
  99. +10
    -2
      emacs.d/layers/+emacs/better-defaults/packages.el
  100. +16
    -5
      emacs.d/layers/+emacs/ibuffer/README.org

+ 1
- 0
emacs.d/.gitignore View File

@ -44,6 +44,7 @@ python-*-docs-html
/session.* /session.*
/srecode-map.el /srecode-map.el
/recentf /recentf
.mc-lists.el
# Private directory # Private directory
private/ private/


+ 18
- 1
emacs.d/.travis-build.sh View File

@ -21,7 +21,7 @@ fi
if [ $TRAVIS_SECURE_ENV_VARS = false ] && if [ $TRAVIS_SECURE_ENV_VARS = false ] &&
[ $TRAVIS_PULL_REQUEST != false ] && [ $TRAVIS_PULL_REQUEST != false ] &&
[ $TRAVIS_BRANCH = "master" ]; then
[ "$TRAVIS_BRANCH" = "master" ]; then
printf '=%.0s' {1..70} printf '=%.0s' {1..70}
printf "\n し(*・∀・)/ Thanks for the contribution! \(・∀・*)ノ\n" printf "\n し(*・∀・)/ Thanks for the contribution! \(・∀・*)ノ\n"
@ -32,6 +32,23 @@ if [ $TRAVIS_SECURE_ENV_VARS = false ] &&
exit 1 exit 1
fi fi
if [ "${FORMATTING}" = "space-test" ]; then
cd "${TRAVIS_BUILD_DIR}"
echo "Testing for trailing and all sorts of broken white spaces"
echo "TRAVIS_COMMIT_RANGE: ${TRAVIS_COMMIT_RANGE}"
first_commit=`echo ${TRAVIS_COMMIT_RANGE} | sed -r 's/\..*//'`
git reset -q "${first_commit}"
## git reset -q HEAD~1
git diff --check > space_test_result
if [[ -s space_test_result ]]; then
cat space_test_result
exit 1
fi
echo "No bad spaces detected"
exit 0
fi
# Emacs tests
echo "Pwd $(pwd)" echo "Pwd $(pwd)"
rm -rf ~/.emacs.d rm -rf ~/.emacs.d
ln -sf `pwd` ~/.emacs.d ln -sf `pwd` ~/.emacs.d


+ 5
- 4
emacs.d/.travis.yml View File

@ -7,19 +7,20 @@ branches:
- develop - develop
before_install: before_install:
- curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh
- evm install $EVM_EMACS --use --skip
- if [ ! -z "$EVM_EMACS" ]; then curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh; fi
- if [ ! -z "$EVM_EMACS" ]; then evm install $EVM_EMACS --use --skip; fi
env: env:
- EVM_EMACS=emacs-24.4-travis - EVM_EMACS=emacs-24.4-travis
- EVM_EMACS=emacs-24.5-travis - EVM_EMACS=emacs-24.5-travis
- EVM_EMACS=emacs-25.1-travis
- EVM_EMACS=emacs-git-snapshot-travis - EVM_EMACS=emacs-git-snapshot-travis
- FORMATTING=space-test
matrix: matrix:
fast_finish: true fast_finish: true
allow_failures: allow_failures:
env:
- EVM_EMACS=emacs-git-snapshot-travis
- env: EVM_EMACS=emacs-git-snapshot-travis
script: script:
- ./.travis-build.sh - ./.travis-build.sh

+ 227
- 15
emacs.d/CHANGELOG.org View File

@ -1,4 +1,216 @@
* Release 0.200.x * Release 0.200.x
** 0.200.9 (2017/04/06)
*** Fixes
- Fix theme loading with terminal Emacs (thanks to wang0z)
** 0.200.8 (2017/04/01)
*** Convention changes
- Update debug conventions
- Step in and Step out are now, ~i~ and ~o~ respectively
- Inspect a value is now ~v~
- Next step is now ~s~
*** Dotspacemacs changes
- Improve variable =dotspacemacs-line-numbers=. The variable can now take a
property list with the following keywords supported: =:relative t= to turn on
relative lines, =:disabled-for-modes mode1 mode2 ...= to disable line numbers
in specific major modes and =:size-limit-kb n= to disable line numbers when
the size of the buffer is greater than n (thanks to deb0ch)
*** Core changes
- Import =quela=, =package-build=, =ido-vertical-mode= and =spacemacs-theme= in
=core/libs=
- Speedup ~SPC h SPC~ loading.
- Force installation of =org-contrib-plus= instead of =org= effectively avoiding
to install Org twice.
- Display some additional information message in mode-line at startup.
- Throw an error instead of a warning if emacs version is too old
(thanks to deb0ch)
- Refactor =rotate-windows= (thanks to bmag)
- Don’t toggle maximized window at startup if already maximized
(thanks to TheBB)
- Set default value of =dotspacemacs-enable-paste-transient-state= to nil to
reflect its value in the doftile template (tanks to toupeira)
- which-key: Update usage of replacement alists (thanks to justbur)
- which-key: Fix transient state descriptions (thanks to justbur)
- which-key: Implement combined select window keys (thanks to justbur)
- Maximize frame earlier in the startup process (thanks to deb0ch)
- Fix unbound holy-mode error (thanks to TheBB)
- Fix error on footer insertion when window is narrow (thanks to deb0ch)
- Fix encoding of =;= in issue report body (thanks to d12frosted)
- Fix variable is void: system-info in spacemacs/report-issue
- Fix delayed warning display in emacs 25.5
- Fix computation of package installation lazyness
- Fix false warning about duplicate layers at startup. (thanks to puzl)
- Fix indentation rules for declare-prefix functions
- Add support for interpreter-mode-alist to layer lazy installation
- Add support for local elpa repositories
- Always return `t` from use-package pre/post hooks. (thanks to Stebalien)
- Jump-handers =:async= keyword can now take a predicate function
- home buffer: update quickhelp.txt in [?] (thanks to kccai)
- Filter out private vars in dotspacemacs/get-variable-string-list
- Add support for go to definition in other window with ~SPC m g G~
- Scope minor-mode specific key bindings under major-mode leader
*** Distribution layer changes
- New key binding ~SPC w +~ to toggle between vertical and horizontal windows
layout (thanks to nixmaniack, bmag)
- New key binding ~SPC w TAB~ to go to last selected window (thanks to adelq)
- New key binding ~gf~ in compilation mode to find file at point
(thanks to FrancescElies)
- New key binding ~gD~ to jump to definition in another window
(thanks to quicknir)
- New key binding ~SPC x l S~ to reverse sort lines (duianto)
- New key bindings ~SPC x l c~ and ~SPC x l C~ to sort lines by column (duianto)
- New key binding ~SPC f T~ to jump to currently opened file in =neotree=
(thanks to arjun-urs)
- New key binding ~'~ in =neotree= to take a quick look at the currently
selected file (thanks to sdwolf)
- Overhaul the buffer transient state on ~SPC b .~ (thanks to quicknir)
- Improve =spacemacs/count-word-analysis= by including information from
=count-words= function
- Use use =winum.el= instead of =window-numbering.el= for window numbers
(thanks to deb0ch)
- Add copy key to neotree under ~C~ (thanks to lanejo01)
- Move generation of tags from ~SPC p C-g~ to easier ~SPC p G~ (thanks to TheBB)
- Add duplicate-line-or-region on ~SPC x l d~ (thanks to deb0ch)
- Integrate =auto-highlight-symbol= with =evil= as well as =isearch=
(thanks to TheBB)
- Change default fringe color for centered-buffer-mode.
- Use =helm= or =ivy= as completion framework for =dumb-jump= (thanks to deuill)
- Hide PROPERTIES drawers in space-doc-mode (thanks to nikolaiam)
- Disable auto-revert of =buffer-menu-mode= (thanks to bgamari)
- Fix spacemacs/rename-current-buffer-file on non-file buffers
(thanks to lislon)
*** Layer changes
**** Ansible
- Add support for =ansible-vault= (auto-de/encryption of files)
- Add support for =company= with =company-ansible= package
**** Auto-completion
- Add new package =fuzzy= for =auto-complete=.
**** Better defaults
- Add new package =unfill= (thanks to d12frosted)
**** Chinese
- Move =pyim= into the =.cache= directory (thanks to DCPRevere)
**** Chrome
+ Add package =flymd=. Flymd is a realtime markdown preview (hodge)
**** Clojure
- Update debugger key bindings to meet new conventions
- Add new key bindings to convert collections (thanks to benedekfazekas)
- Fix calls to =cider-test-xxxx= functions (thanks to mahinshaw)
**** Common Lisp
- Add neew key binding ~SPC m h i~ to inspect a definition
- Set jump handler to =slime-edit-definition= (thanks to phoe)
**** CSharp
- Fix Omnisharp jump handler by marking it async (thanks to razzmatazz)
**** Elixir
- Add support for =credo= (denin)
- Prevent from inserting too many "end"s in Elixir (thanks to michalmuskala)
**** Emacs Lisp
- Fix cursor position for =eval-last-sexp=.
- Add ~SPC m e c~ to evaluate current sexp. Evaluation of current =setq= or
=defun= form is under ~SPC m e C~.
- Add support for =debugger= and =edebug=, see tutorial in =README.org= file.
**** Extra-langs
- Add extension =.wl= for =wolfram-mode= (kenkangxgwe)
**** Finance
- Add new key bindings for ledger account reconciliation (thanks to timjaeger)
**** Games
- Add =sudoku= game. (thanks to et2010)
**** Go
- Fix void reference to =go--position-bytes= (thanks to db47h)
**** Haskell
- Update debugger key bindings to meet new conventions
**** Html
- Defer =company-web= loading (ralesi)
**** IBuffer
- New key bindings ~g r~ to update buffer, ~g j~ to move to next filter group
and ~g k~ to move to previous filter group (thanks to donm)
**** IPthon-notebook
- Fix =axes.color_cycle= warning in matplotlibrc (thanks to Retorz)
**** Ivy
- Rebind ~SPC f b~ to =counsel-bookmark= (thanks to gilbertw1)
- Add confirmation between deleting a file with ~d~ (thanks to d12frosted)
- Add C-c C-e to edit counsel-ag search results (thanks to aaronjensen)
- Correctly close =ivy= layout transient state when pressing ~b~
(thanks to gilbertw1)
**** Javascript
- Fix jump handler using =tern= by marking it async (thanks to coreygrunewald)
**** LaTeX
- Add new key bindings for folding functions (thanks to nashamri)
**** Markdown
- Add new key binding ~SPC m i t~ to insert a Table of Contents
- Fix activation of =mmm-mode=
- Add support for ini files
- Hide =MMM= linter in mode-line
**** Org
- New key binding ~,~ for =org-edit-src-exit= (thanks to david-sawatzke)
- New key binding ~SPC m i a~ for =org-attach= (thanks to smile12341234)
- Move ~SPC m e~ to ~SPC m e e~ for =org-export-dispatch=
- Fix ~o~ on folded headings (thanks to dschoepe)
**** Prodigy
- Add new key binding ~R~ to refresh buffer (thanks to FrancescElies)
- Add new key binding ~gf~ to go to file at point (thanks to FrancescElies)
**** Python
- New layer variable =python-auto-set-local-pyvenv-virtualenv= to autoload
a virtual env with a =.venv= file (thanks to korayal)
- Simplify python test runner setup (thanks to TheBB)
- Fix debug string for python3 (thanks to yangguang760)
- Fix python path with virtualenv on Windows in Python nose package
(thanks to brenttaylor)
- Fix python-enable-yapf-format-on-save (thanks to magia)
**** Restclient
- Add package =ob-restclient= to add =org-babel= support to =restclient=
- Add helm support to jump to variable or request with ~SPC m j~ (thanks to tko)
- Add autocompletion for methods and headers (thanks to tko)
- Add key bindings for jump to next / previous query with ~SPC m n~ and
~SPC m p~ (thanks to tko)
**** Ruby-On-Rails
- Use projectile-rails-global-mode if available (thanks to asok)
**** Rust
- Add binding for describing symbol at point under ~SPC m h h~
(thanks to NJBS)
- Add key binding to run current Rust file under ~SPC m q~
(thanks to swaroopch)
- Make Racer respect =help-window-select= (thanks to bmag)
**** Scala
- Update debugger key bindings to meet new conventions
- Update deprecated =ensime= variable name =user-emacs-ensime-directory=
(thanks to brakhane)
- Remove sbt-hydra rename wrapper (thanks to jdnavarro)
**** Scheme
- Fix void-variable =company-backends-scheme-mode= (thanks to pnagy)
**** Semantic
- Make Semantic fast (thanks to tudho)
**** Shaders
- Add support for =company= with =glsl-company= package (thanks to d12frosted)
**** Spell-checking
- Defer loading of =flyspell-correct-helm= and =flyspell-correct=
(thanks to ralesi and d12frosted)
**** Themes
- Add sourcerer theme to themes-megapack (thanks to gilbertw1)
- Added new base16 themes (thanks to bezhermoso and metamode)
- Add madhat2r theme to megapack (thanks to madhat2r)
**** Typescript
- Fix eldoc initialization in typescript layer. (thanks to Stebalien)
**** Version control
- New layer variable =version-control-diff-side= to set the fringe
side where to display version control info (thanks to emmanueltouzery)
- Add a transient state for =smerge-mode= on ~SPC g r~ (thanks to perfectayush)
**** Ymcd
- Add ycmd-eldoc to ycmd layer (thanks to quicknir)
*** Improvements
- Improve home buffer responsiveness, add centering for release notes and lists
(thanks to deb0ch)
- Add keybindings to move buffers by window number with ~SPC b #~ where
~#~ is a number between 0 and 9 (thanks to quicknir)
- Add toggle to display time in modeline on ~SPC t m t~. Toggle of the modeline
is now in ~SPC t m T~. (thanks to jupl)
- Add toggle for syntax highlighting on ~SPC t h s~ (thanks to jupl)
- Message instead of warn on failed auto-evilify (thanks to TheBB)
- Warn if both helm and ivy are enabled (thanks to TheBB)
- Add new documentation file =doc/BEGINNERS_TUTORIAL.org= (nikolaiam)
- Various documentation improvements (thanks to antonshwab, benbotwin, bmag,
cyberxndr, d12frosted, duianto, erictapen, FrancescElies, idoo, jr0cket,
jgertm, jumarko, jwintz, LemmingAvalanche, lpenz, Melon-Bread, mineo,
nightuser, nikolaiam, primeos, rodonn, roryokane, rski, skade, smile12341234,
stratosgear, Trevoke, xiaohanyu, Wiliamvdv, zetok, zhexuany)
** 0.200.7 (2017/01/02) ** 0.200.7 (2017/01/02)
*** Fixes *** Fixes
- More robust fix for error helm :config: ‘fuzzy-match’ not supported in async sources - More robust fix for error helm :config: ‘fuzzy-match’ not supported in async sources
@ -75,7 +287,7 @@
- Fix usage of =go-rename= on symlinked projects (thanks to grncdr) - Fix usage of =go-rename= on symlinked projects (thanks to grncdr)
**** Helm **** Helm
- Add key binding ~M-RET~ (meta-return) to open the file =packages.el= - Add key binding ~M-RET~ (meta-return) to open the file =packages.el=
of a layer in =helm-spacemacs-help= under ~SPC h SPC~ (thansk to CestDiego)
of a layer in =helm-spacemacs-help= under ~SPC h SPC~ (thanks to CestDiego)
**** Html **** Html
- Fix hooks for CSS-mode since it now derives from =prog-mode= in Emacs 25 - Fix hooks for CSS-mode since it now derives from =prog-mode= in Emacs 25
(thanks to TheBB) (thanks to TheBB)
@ -1196,11 +1408,11 @@
*** Core team members *** Core team members
**** Current **** Current
- Sylvain Benner (syl20bnr) - Sylvain Benner (syl20bnr)
- Boris (d12frosted)
- Eivind Fonn (TheBB)
- Boris (thanks to d12frosted)
- Eivind Fonn (thanks to TheBB)
**** Old **** Old
- Fabien Dubosson (StreakyCobra) - Fabien Dubosson (StreakyCobra)
- Justin Burkett (justbur)
- Justin Burkett (thanks to justbur)
* Release 0.105.x * Release 0.105.x
** 0.105.22 (2016/08/19) ** 0.105.22 (2016/08/19)
*** Fixes *** Fixes
@ -1483,7 +1695,7 @@ Improve loading robustness:
- Improve =describe-system-info= function with completion engine info - Improve =describe-system-info= function with completion engine info
(ivy completion engine will be available in 0.106) (thanks to StreakyCobra) (ivy completion engine will be available in 0.106) (thanks to StreakyCobra)
- Add link to =BountySource= page to =README.md= (thanks to houli) - Add link to =BountySource= page to =README.md= (thanks to houli)
- Move =request= storage folder to =.cache= directory
- Move =request= storage folder to =.cache= directory
*** Layer changes *** Layer changes
**** Markdown **** Markdown
- Add support for javascript code blocks syntax highlighting - Add support for javascript code blocks syntax highlighting
@ -1532,9 +1744,9 @@ Improve loading robustness:
*** Fixes *** Fixes
**** Core **** Core
- Fix home buffer obfuscating opened file when Emacs starts (thanks to justbur) - Fix home buffer obfuscating opened file when Emacs starts (thanks to justbur)
**** Ruby layer
**** Ruby layer
- Fix =rbenv= loading (thanks to TheBB) - Fix =rbenv= loading (thanks to TheBB)
**** Spacemacs layouts
**** Spacemacs layouts
- Fix jumping to last layout when the last layout is the default layout - Fix jumping to last layout when the last layout is the default layout
(thanks to TheBB) (thanks to TheBB)
**** Yasnippet **** Yasnippet
@ -1927,7 +2139,7 @@ Improve loading robustness:
- Add =company-css= backend in =web-mode= (thanks to TheBB) - Add =company-css= backend in =web-mode= (thanks to TheBB)
- Enable Emmet tab expansion in hybrid mode (thanks to geo7) - Enable Emmet tab expansion in hybrid mode (thanks to geo7)
- Expand to className when using Emmet, for =instance div.react-class= - Expand to className when using Emmet, for =instance div.react-class=
expands to =<div className = "react-class"></div>= (thanks to CestDegio)
expands to =< div className = "react-class"></div>= (thanks to CestDegio)
- Mark =css-indent-offset= as safe local variable (thanks to lunaryorn) - Mark =css-indent-offset= as safe local variable (thanks to lunaryorn)
- Fix =smartparens= loading (thanks to TheBB) - Fix =smartparens= loading (thanks to TheBB)
- Fix erroneous micro-state key binding (thanks to StreakyCobra) - Fix erroneous micro-state key binding (thanks to StreakyCobra)
@ -2212,9 +2424,9 @@ Improve loading robustness:
vijaykiran, xfq, xtian, ZachLiss) vijaykiran, xfq, xtian, ZachLiss)
*** Core team members *** Core team members
- Sylvain Benner (syl20bnr) - Sylvain Benner (syl20bnr)
- Eivind Fonn (TheBB)
- Eivind Fonn (thanks to TheBB)
- Fabien Dubosson (StreakyCobra) - Fabien Dubosson (StreakyCobra)
- Justin Burkett (justbur)
- Justin Burkett (thanks to justbur)
* Release 0.104.x * Release 0.104.x
** 0.104.8 (2015/12/16) ** 0.104.8 (2015/12/16)
*** Hotfix *** Hotfix
@ -2268,7 +2480,7 @@ Improve loading robustness:
**** Markdown **** Markdown
- Fix ~SPC m c r~ binding (thanks to tko) - Fix ~SPC m c r~ binding (thanks to tko)
*** Core *** Core
- Silence =ad-handle-definition= about advised functions getting redefined
- Silence =ad-handle-definition= about advised functions getting redefined
- Improve evilification rules, now ~:~ is rebound to ~|~, ~/~ is rebound to ~\~ - Improve evilification rules, now ~:~ is rebound to ~|~, ~/~ is rebound to ~\~
and ~SPC~ is rebound to ~​'​~ and ~SPC~ is rebound to ~​'​~
*** Other fixes and improvements *** Other fixes and improvements
@ -2653,7 +2865,7 @@ Improve loading robustness:
prefix (thanks to katshinka) prefix (thanks to katshinka)
+ Add more cycling options for time-stamps, headlines, items, properties with + Add more cycling options for time-stamps, headlines, items, properties with
~SPC m L~, ~SPC m K~, etc... (thanks to katshinka) ~SPC m L~, ~SPC m K~, etc... (thanks to katshinka)
+ Add key bindings ~SPC m .~ to insert time-stamps (thanks to katshinka)
+ Add key bindings ~SPC m .~ to insert time-stamps (thanks to katshinka)
+ Set =toc-org-max-depth= to 10. + Set =toc-org-max-depth= to 10.
+ Move ~SPC m o~ to ~SPC m l~ since ~SPC m o~ is now reserved for users + Move ~SPC m o~ to ~SPC m l~ since ~SPC m o~ is now reserved for users
(thanks to TheBB) (thanks to TheBB)
@ -2836,7 +3048,7 @@ Improve loading robustness:
**** Git **** Git
- Fix ~F~ in Vim style in =Magit= status buffer, now ~F~ is correctly - Fix ~F~ in Vim style in =Magit= status buffer, now ~F~ is correctly
bound to =pull= popup menu bound to =pull= popup menu
- Fix intermittent erroneous ~k~ key binding in =Magit= status buffer.
- Fix intermittent erroneous ~k~ key binding in =Magit= status buffer.
*** Core *** Core
- Fix mandatory dependency on =evil-escape= - Fix mandatory dependency on =evil-escape=
- Fix evilification of =evil-escape= starter key - Fix evilification of =evil-escape= starter key
@ -3006,7 +3218,7 @@ Improve loading robustness:
- Add font-locking for code blocks (thanks to kennethlove) - Add font-locking for code blocks (thanks to kennethlove)
- Add support for a bunch of languages for code blocks (thanks to dexafree) - Add support for a bunch of languages for code blocks (thanks to dexafree)
**** Ocaml **** Ocaml
- Don't auto-close backticks (thanks to edwintorok)
- Don't auto-close backticks (thanks to edwintorok)
**** Org **** Org
- Fontify code blocks (thanks to tuhdo) - Fontify code blocks (thanks to tuhdo)
- Add =toc-org= package (thanks to CestDiego) - Add =toc-org= package (thanks to CestDiego)
@ -3605,7 +3817,7 @@ a batch of packages.
- Fix =flycheck= loading - Fix =flycheck= loading
- Move ~SPC m t~ to ~SPC m h t~ according to Spacemacs conventions (thanks - Move ~SPC m t~ to ~SPC m h t~ according to Spacemacs conventions (thanks
to jeremyjh) to jeremyjh)
- Add C-- =cmm-mode= (thanks to bgamari)
- Add C-- =cmm-mode= (thanks to bgamari)
*** Helm *** Helm
- Add =helm-colors= key binding on ~SPC C l~ (thanks to tuhdo) - Add =helm-colors= key binding on ~SPC C l~ (thanks to tuhdo)
- Make =helm-ff-doted-directory= consistent (thanks to tuhdo) - Make =helm-ff-doted-directory= consistent (thanks to tuhdo)


+ 14
- 5
emacs.d/CONTRIBUTING.org View File

@ -25,18 +25,24 @@ Thanks! :heart: :heart: :heart:
- [[#credits][Credits]] - [[#credits][Credits]]
* Asking for help * Asking for help
:PROPERTIES:
:CUSTOM_ID: asking-for-help
:END:
If you want to ask an usage question, be sure to look first into some places as If you want to ask an usage question, be sure to look first into some places as
it may hold the answer: it may hold the answer:
- [[doc/FAQ.org][The FAQ]]. Some of the most frequently asked questions are answered there.
- [[doc/DOCUMENTATION.org][The documentation]]. It's the general documentation of Spacemacs.
- You may also read the =README.org= of the [[layers/][relevant layer(s)]].
- [[file:doc/FAQ.org][The FAQ]]. Some of the most frequently asked questions are answered there.
- [[file:doc/DOCUMENTATION.org][The documentation]]. It's the general documentation of Spacemacs.
- You may also read the =README.org= of the [[file:layers/][relevant layer(s)]].
If your question is not answered there, then please come into our [[https://gitter.im/syl20bnr/spacemacs][gitter chat]] to If your question is not answered there, then please come into our [[https://gitter.im/syl20bnr/spacemacs][gitter chat]] to
discuss it with us :relaxed:. We will direct you to a solution, or ask you to discuss it with us :relaxed:. We will direct you to a solution, or ask you to
open an issue if it is needed. open an issue if it is needed.
* Reporting issues * Reporting issues
:PROPERTIES:
:CUSTOM_ID: reporting-issues
:END:
Issues have to be reported on our [[https://github.com/syl20bnr/spacemacs/issues][issues tracker]]. Please: Issues have to be reported on our [[https://github.com/syl20bnr/spacemacs/issues][issues tracker]]. Please:
- Check that the issue has not already been reported. - Check that the issue has not already been reported.
@ -56,6 +62,9 @@ Issues have to be reported on our [[https://github.com/syl20bnr/spacemacs/issues
step guide. step guide.
* Contributing code * Contributing code
:PROPERTIES:
:CUSTOM_ID: contributing-code
:END:
Code contributions are welcome. Please read the following sections carefully. In Code contributions are welcome. Please read the following sections carefully. In
any case, feel free to join us on the [[https://gitter.im/syl20bnr/spacemacs][gitter chat]] to ask questions about any case, feel free to join us on the [[https://gitter.im/syl20bnr/spacemacs][gitter chat]] to ask questions about
contributing! contributing!
@ -164,7 +173,7 @@ The file header for =elisp= files should look like the following template:
#+BEGIN_EXAMPLE #+BEGIN_EXAMPLE
;;; FILENAME --- NAME Layer packages File for Spacemacs ;;; FILENAME --- NAME Layer packages File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: YOUR_NAME <YOUR_EMAIL> ;; Author: YOUR_NAME <YOUR_EMAIL>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -198,7 +207,7 @@ can be done from the =dotspacemacs/user-config= function of your =.spacemacs=
file and don't require any contribution to Spacemacs. file and don't require any contribution to Spacemacs.
If you think it worth contributing a new key bindings then be sure to read If you think it worth contributing a new key bindings then be sure to read
the [[doc/CONVENTIONS.org][CONVENTIONS.org]] file to find the best key bindings, then create a
the [[file:doc/CONVENTIONS.org][CONVENTIONS.org]] file to find the best key bindings, then create a
Pull-Request with your changes. Pull-Request with your changes.
*ALWAYS* document your new keybindings or keybindings changes inside the *ALWAYS* document your new keybindings or keybindings changes inside the


+ 8
- 1
emacs.d/README.md View File

@ -13,7 +13,7 @@
| |
<b><a href="CONTRIBUTING.org">contribute</a></b> <b><a href="CONTRIBUTING.org">contribute</a></b>
| |
<b><a href="http://spacemacs.org/doc/DOCUMENTATION#orgheadline187">achievements</a></b>
<b><a href="http://spacemacs.org/doc/DOCUMENTATION#achievements">achievements</a></b>
| |
<b><a href="http://spacemacs.org/doc/FAQ">FAQ</a></b> <b><a href="http://spacemacs.org/doc/FAQ">FAQ</a></b>
</p> </p>
@ -157,6 +157,13 @@ providing Spacemacs icon.
See [emacs-plus](https://github.com/d12frosted/homebrew-emacs-plus) for more See [emacs-plus](https://github.com/d12frosted/homebrew-emacs-plus) for more
information. information.
*Note*: to have the title bar match your theme background color,
consider using instead:
``` sh
$ brew install emacs-plus --HEAD --with-natural-title-bars
```
*Note:* after you have completed the [install process](#install) below, it is *Note:* after you have completed the [install process](#install) below, it is
also recommended to add the [osx layer][] to your [dotfile][]. Install also recommended to add the [osx layer][] to your [dotfile][]. Install
instructions are available in the [osx layer][] documentation. instructions are available in the [osx layer][] documentation.


+ 1
- 1
emacs.d/core/aprilfool/zemacs.el View File

@ -1,6 +1,6 @@
;;; zemacs.el --- Spacemacs 2016 April Fools File ;;; zemacs.el --- Spacemacs 2016 April Fools File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/core/core-command-line.el View File

@ -1,6 +1,6 @@
;;; core-command-line.el --- Spacemacs Core File ;;; core-command-line.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 355
- 128
emacs.d/core/core-configuration-layer.el View File

@ -1,6 +1,6 @@
;;; core-configuration-layer.el --- Spacemacs Core File ;;; core-configuration-layer.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -61,6 +61,14 @@ ROOT is returned."
(eval dotspacemacs-elpa-subdirectory)))) (eval dotspacemacs-elpa-subdirectory))))
(file-name-as-directory (expand-file-name subdir root))))) (file-name-as-directory (expand-file-name subdir root)))))
(defun configuration-layer/get-elpa-package-install-directory (pkg)
"Return the install directory of elpa PKG. Return nil if it is not found."
(let ((elpa-dir package-user-dir))
(when (file-exists-p elpa-dir)
(let* ((pkg-match (concat "\\`" (symbol-name pkg) "-[0-9]+"))
(dir (car (directory-files elpa-dir 'full pkg-match))))
(when dir (file-name-as-directory dir))))))
(defvar configuration-layer-rollback-directory (defvar configuration-layer-rollback-directory
(concat spacemacs-cache-directory ".rollback/") (concat spacemacs-cache-directory ".rollback/")
"Spacemacs rollback directory.") "Spacemacs rollback directory.")
@ -105,29 +113,31 @@ ROOT is returned."
"(Takes precedence over `:disabled-for'.)"))) "(Takes precedence over `:disabled-for'.)")))
"A configuration layer.") "A configuration layer.")
(defmethod cfgl-layer-owned-packages ((layer cfgl-layer))
(defmethod cfgl-layer-owned-packages ((layer cfgl-layer) &optional props)
"Return the list of owned packages by LAYER. "Return the list of owned packages by LAYER.
If PROPS is non-nil then return packages as lists with their properties.
LAYER has to be installed for this method to work properly." LAYER has to be installed for this method to work properly."
(delq nil (mapcar (delq nil (mapcar
(lambda (x) (lambda (x)
(let ((pkg (configuration-layer/get-package x)))
(when (and pkg (eq (oref layer :name)
(car (oref pkg :owners))))
pkg)))
(oref layer :packages))))
(let* ((pkg-name (if (listp x) (car x) x))
(pkg (configuration-layer/get-package pkg-name)))
(when (eq (oref layer :name) (car (oref pkg :owners))) x)))
(cfgl-layer-get-packages layer props))))
(defmethod cfgl-layer-owned-packages ((layer nil))
(defmethod cfgl-layer-owned-packages ((layer nil) &optional props)
"Accept nil as argument and return nil." "Accept nil as argument and return nil."
nil) nil)
(defmethod cfgl-layer-get-packages ((layer cfgl-layer))
"Return the list of packages for LAYER."
(if (eq 'all (oref layer :selected-packages))
(oref layer :packages)
(defmethod cfgl-layer-get-packages ((layer cfgl-layer) &optional props)
"Return the list of packages for LAYER.
If PROPS is non-nil then return packages as lists with their properties"
(let ((all (eq 'all (oref layer :selected-packages))))
(delq nil (mapcar (delq nil (mapcar
(lambda (x) (lambda (x)
(let ((pkg-name (if (listp x) (car x) x))) (let ((pkg-name (if (listp x) (car x) x)))
(when (memq pkg-name (oref layer :selected-packages)) x)))
(when (or all (memq pkg-name
(oref layer :selected-packages)))
(if props x pkg-name))))
(oref layer :packages))))) (oref layer :packages)))))
(defclass cfgl-package () (defclass cfgl-package ()
@ -183,7 +193,9 @@ LAYER has to be installed for this method to work properly."
"If non-nil this package is excluded from all layers."))) "If non-nil this package is excluded from all layers.")))
(defmethod cfgl-package-enabledp ((pkg cfgl-package) &optional inhibit-messages) (defmethod cfgl-package-enabledp ((pkg cfgl-package) &optional inhibit-messages)
"Evaluate the `toggle' slot of passed PKG."
"Evaluate the `toggle' slot of passed PKG.
If INHIBIT-MESSAGES is non nil then any message emitted by the toggle evaluation
is ignored."
(let ((message-log-max (unless inhibit-messages message-log-max)) (let ((message-log-max (unless inhibit-messages message-log-max))
(toggle (oref pkg :toggle))) (toggle (oref pkg :toggle)))
(eval toggle))) (eval toggle)))
@ -211,6 +223,7 @@ is not set for the given SLOT."
'(("melpa" . "melpa.org/packages/") '(("melpa" . "melpa.org/packages/")
("org" . "orgmode.org/elpa/") ("org" . "orgmode.org/elpa/")
("gnu" . "elpa.gnu.org/packages/")) ("gnu" . "elpa.gnu.org/packages/"))
;; '(("spacelpa" . "~/.emacs.d/.cache/spacelpa/"))
"List of ELPA archives required by Spacemacs.") "List of ELPA archives required by Spacemacs.")
(defvar configuration-layer-exclude-all-layers nil (defvar configuration-layer-exclude-all-layers nil
@ -285,15 +298,28 @@ cache folder.")
(setq package-enable-at-startup nil) (setq package-enable-at-startup nil)
(package-initialize 'noactivate))) (package-initialize 'noactivate)))
(defun configuration-layer//install-quelpa ()
"Install `quelpa'."
(defun configuration-layer//configure-quelpa ()
"Configure `quelpa' package."
(setq quelpa-verbose init-file-debug (setq quelpa-verbose init-file-debug
quelpa-dir (concat spacemacs-cache-directory "quelpa/") quelpa-dir (concat spacemacs-cache-directory "quelpa/")
quelpa-build-dir (expand-file-name "build" quelpa-dir) quelpa-build-dir (expand-file-name "build" quelpa-dir)
quelpa-persistent-cache-file (expand-file-name "cache" quelpa-dir) quelpa-persistent-cache-file (expand-file-name "cache" quelpa-dir)
quelpa-update-melpa-p nil) quelpa-update-melpa-p nil)
(configuration-layer/load-or-install-protected-package 'package-build)
(configuration-layer/load-or-install-protected-package 'quelpa))
(require 'quelpa))
(defun configuration-layer//package-archive-absolute-pathp (archive)
"Return t if ARCHIVE has an absolute path defined."
(let ((path (cdr archive)))
(or (string-match-p "http" path)
(string-prefix-p "~" path)
(string-prefix-p "/" path))))
(defun configuration-layer//package-archive-local-pathp (archive)
"Return t if ARCHIVE has a local path."
(let ((path (cdr archive)))
(or (string-prefix-p "~" path)
(string-prefix-p "/" path)
(string-prefix-p "\." path))))
(defun configuration-layer//resolve-package-archives (archives) (defun configuration-layer//resolve-package-archives (archives)
"Resolve HTTP handlers for each archive in ARCHIVES and return a list "Resolve HTTP handlers for each archive in ARCHIVES and return a list
@ -303,22 +329,23 @@ left untouched.
The returned list has a `package-archives' compliant format." The returned list has a `package-archives' compliant format."
(mapcar (mapcar
(lambda (x) (lambda (x)
(cons (car x)
(if (or (string-match-p "http" (cdr x))
(string-prefix-p "/" (cdr x)))
(cdr x)
(concat
(if (and dotspacemacs-elpa-https
(not spacemacs-insecure)
;; for now org ELPA repository does
;; not support HTTPS
;; TODO when org ELPA repo support
;; HTTPS remove the check
;; `(not (equal "org" (car x)))'
(not (equal "org" (car x))))
"https://"
"http://")
(cdr x)))))
(let ((aname (car x))
(apath (cdr x)))
(cons aname
(if (configuration-layer//package-archive-absolute-pathp x)
apath
(concat
(if (and dotspacemacs-elpa-https
(not spacemacs-insecure)
;; for now org ELPA repository does
;; not support HTTPS
;; TODO when org ELPA repo support
;; HTTPS remove the check
;; `(not (equal "org" aname))'
(not (equal "org" aname)))
"https://"
"http://")
apath)))))
archives)) archives))
(defun configuration-layer/retrieve-package-archives (&optional quiet force) (defun configuration-layer/retrieve-package-archives (&optional quiet force)
@ -342,32 +369,38 @@ refreshed during the current session."
(let ((count (length package-archives)) (let ((count (length package-archives))
(i 1)) (i 1))
(dolist (archive package-archives) (dolist (archive package-archives)
(unless quiet
(spacemacs-buffer/replace-last-line
(format "--> refreshing package archive: %s... [%s/%s]"
(car archive) i count) t))
(spacemacs//redisplay)
(setq i (1+ i))
(unless (eq 'error
(with-timeout
(dotspacemacs-elpa-timeout
(progn
(display-warning
'spacemacs
(format
"\nError connection time out for %s repository!"
(car archive)) :warning)
'error))
(condition-case err
(url-retrieve-synchronously (cdr archive))
('error
(display-warning 'spacemacs
(format
"\nError while contacting %s repository!"
(car archive)) :warning)
'error))))
(let ((package-archives (list archive)))
(package-refresh-contents))))
(let ((aname (car archive))
(apath (cdr archive)))
(unless quiet
(spacemacs-buffer/replace-last-line
(format "--> refreshing package archive: %s... [%s/%s]"
aname i count) t))
(spacemacs//redisplay)
(setq i (1+ i))
(unless
(and (not (configuration-layer//package-archive-local-pathp
archive))
(eq 'error
(with-timeout
(dotspacemacs-elpa-timeout
(progn
(display-warning
'spacemacs
(format
"\nError connection time out for %s repository!"
aname) :warning)
'error))
(condition-case err
(url-retrieve-synchronously apath)
('error
(display-warning
'spacemacs
(format
"\nError while contacting %s repository!"
aname) :warning)
'error)))))
(let ((package-archives (list archive)))
(package-refresh-contents)))))
(package-read-all-archive-contents) (package-read-all-archive-contents)
(unless quiet (spacemacs-buffer/append "\n"))))) (unless quiet (spacemacs-buffer/append "\n")))))
@ -620,9 +653,10 @@ If TOGGLEP is nil then `:toggle' parameter is ignored."
pkg-name (car (oref obj :owners)) layer-name))) pkg-name (car (oref obj :owners)) layer-name)))
;; last owner wins over the previous one ;; last owner wins over the previous one
(object-add-to-list obj :owners layer-name)) (object-add-to-list obj :owners layer-name))
;; check consistency betwween package and defined init functions
;; check consistency between package and defined init functions
(unless (or ownerp (unless (or ownerp
(eq 'dotfile layer-name) (eq 'dotfile layer-name)
(eq 'system layer-name)
(fboundp pre-init-func) (fboundp pre-init-func)
(fboundp post-init-func) (fboundp post-init-func)
(oref obj :excluded)) (oref obj :excluded))
@ -887,11 +921,17 @@ Return nil if package object is not found."
"Return a sorted list of PACKAGES objects." "Return a sorted list of PACKAGES objects."
(sort packages (lambda (x y) (string< (symbol-name x) (symbol-name y))))) (sort packages (lambda (x y) (string< (symbol-name x) (symbol-name y)))))
(defun configuration-layer/make-all-packages (&optional usedp)
"Create objects for _all_ packages.
USEDP if non-nil indicates that made packages are used packages."
(configuration-layer/make-packages-from-layers
(configuration-layer/get-layers-list) usedp))
(defun configuration-layer/make-all-packages (&optional skip-layer-discovery)
"Create objects for _all_ packages supported by Spacemacs.
If SKIP-LAYER-DISCOVERY is non-nil then do not check for new layers."
(let ((all-layers (configuration-layer/get-layers-list))
(configuration-layer--load-packages-files t)
(configuration-layer--package-properties-read-onlyp t)
(configuration-layer--inhibit-warnings t))
(unless skip-layer-discovery
(configuration-layer/discover-layers))
(configuration-layer/declare-layers all-layers)
(configuration-layer/make-packages-from-layers all-layers)))
(defun configuration-layer/make-packages-from-layers (defun configuration-layer/make-packages-from-layers
(layer-names &optional usedp) (layer-names &optional usedp)
@ -901,7 +941,7 @@ DOTFILE if non-nil will process the dotfile `dotspacemacs-additional-packages'
variable as well." variable as well."
(dolist (layer-name layer-names) (dolist (layer-name layer-names)
(let ((layer (configuration-layer/get-layer layer-name))) (let ((layer (configuration-layer/get-layer layer-name)))
(dolist (pkg (cfgl-layer-get-packages layer))
(dolist (pkg (cfgl-layer-get-packages layer 'with-props))
(let* ((pkg-name (if (listp pkg) (car pkg) pkg)) (let* ((pkg-name (if (listp pkg) (car pkg) pkg))
(obj (configuration-layer/get-package pkg-name))) (obj (configuration-layer/get-package pkg-name)))
(setq obj (configuration-layer/make-package pkg layer-name obj)) (setq obj (configuration-layer/make-package pkg layer-name obj))
@ -929,27 +969,30 @@ USEDP if non-nil indicates that made packages are used packages."
"Configure auto-installation of layer with name LAYER-NAME." "Configure auto-installation of layer with name LAYER-NAME."
(declare (indent 1)) (declare (indent 1))
(when (configuration-layer//lazy-install-p layer-name) (when (configuration-layer//lazy-install-p layer-name)
(let ((extensions (spacemacs/mplist-get props :extensions)))
(let ((extensions (spacemacs/mplist-get props :extensions))
(interpreter (plist-get props :interpreter)))
(when (configuration-layer/layer-usedp layer-name) (when (configuration-layer/layer-usedp layer-name)
(let* ((layer (configuration-layer/get-layer layer-name)) (let* ((layer (configuration-layer/get-layer layer-name))
(packages (when layer (cfgl-layer-owned-packages layer)))
(package-names (mapcar (lambda (x) (oref x :name)) packages)))
(package-names (when layer (cfgl-layer-owned-packages layer))))
;; set lazy install flag for a layer if and only if its owned ;; set lazy install flag for a layer if and only if its owned
;; distant packages are all not already installed ;; distant packages are all not already installed
(let ((lazy (cl-reduce
(lambda (x y) (and x y))
(mapcar
(lambda (p)
(let ((pkg (configuration-layer/get-package p)))
(or (not (eq layer-name (car (oref pkg :owners))))
(null (package-installed-p
(oref pkg :name))))))
(configuration-layer//get-distant-packages
package-names t))
:initial-value t)))
(let ((lazy
(or (eq 'all dotspacemacs-enable-lazy-installation)
(cl-reduce
(lambda (x y) (and x y))
(mapcar
(lambda (p)
(let ((pkg (configuration-layer/get-package p)))
(or (not (eq layer-name (car (oref pkg :owners))))
(null (package-installed-p
(oref pkg :name))))))
package-names)
:initial-value t))))
(oset layer :lazy-install lazy) (oset layer :lazy-install lazy)
(dolist (pkg packages)
(cfgl-package-set-property pkg :lazy-install lazy)))))
(dolist (pkg-name package-names)
(let ((pkg (configuration-layer/get-package pkg-name)))
(cfgl-package-set-property pkg :lazy-install lazy))))))
;; configure `auto-mode-alist'
(dolist (x extensions) (dolist (x extensions)
(let ((ext (car x)) (let ((ext (car x))
(mode (cadr x))) (mode (cadr x)))
@ -958,7 +1001,16 @@ USEDP if non-nil indicates that made packages are used packages."
'auto-mode-alist 'auto-mode-alist
`(,ext . (lambda () `(,ext . (lambda ()
(configuration-layer//auto-mode (configuration-layer//auto-mode
',layer-name ',mode)))))))))
',layer-name ',mode))))
))
;; configure `interpreter-mode-alist'
(when interpreter
(let ((regex (car interpreter))
(mode (cadr interpreter)))
(add-to-list
'interpreter-mode-alist
`(,regex . (lambda () (configuration-layer//auto-mode
',layer-name ',mode)))))))))
(defun configuration-layer//auto-mode (layer-name mode) (defun configuration-layer//auto-mode (layer-name mode)
"Auto mode support of lazily installed layers." "Auto mode support of lazily installed layers."
@ -987,7 +1039,7 @@ return both used and unused packages."
(or (null usedp) (or (null usedp)
(and (not (null (oref pkg :owners))) (and (not (null (oref pkg :owners)))
(not (oref pkg :excluded)) (not (oref pkg :excluded))
(cfgl-package-enabledp pkg))))))))
(cfgl-package-enabledp pkg t))))))))
(defun configuration-layer//get-private-layer-dir (name) (defun configuration-layer//get-private-layer-dir (name)
"Return an absolute path to the private configuration layer string NAME." "Return an absolute path to the private configuration layer string NAME."
@ -1059,12 +1111,30 @@ Returns nil if the directory is not a category."
;; must have the final word on configuration choices. Let ;; must have the final word on configuration choices. Let
;; `dotspacemacs-directory' override the private directory if it exists. ;; `dotspacemacs-directory' override the private directory if it exists.
(setq configuration-layer--indexed-layers (make-hash-table :size 1024)) (setq configuration-layer--indexed-layers (make-hash-table :size 1024))
(let ((search-paths (append (list configuration-layer-directory)
dotspacemacs-configuration-layer-path
(list configuration-layer-private-layer-directory)
(when dotspacemacs-directory
(list dotspacemacs-directory))))
(spacemacs-buffer/set-mode-line "Indexing layers...")
(spacemacs//redisplay)
(let ((search-paths (append
;; layers shipped with spacemacs
(list configuration-layer-directory)
;; layers in private folder ~/.emacs.d/private
(list configuration-layer-private-directory)
;; layers in dotdirectory
(when dotspacemacs-directory
(list (expand-file-name (concat dotspacemacs-directory
"layers/"))))
;; additional layer directories provided by the user
dotspacemacs-configuration-layer-path))
(discovered '())) (discovered '()))
;; filter out directories that don't exist
(setq search-paths (configuration-layer/filter-objects
search-paths
(lambda (x)
(let ((exists (file-exists-p x)))
(unless exists
(configuration-layer//warning
"Layer directory \"%s\" not found. Ignoring it."
x))
exists))))
;; depth-first search of subdirectories ;; depth-first search of subdirectories
(while search-paths (while search-paths
(let ((current-path (car search-paths))) (let ((current-path (car search-paths)))
@ -1091,7 +1161,9 @@ Returns nil if the directory is not a category."
(if indexed-layer (if indexed-layer
;; the same layer may have been discovered twice, ;; the same layer may have been discovered twice,
;; in which case we don't need a warning ;; in which case we don't need a warning
(unless (string-equal (oref indexed-layer :dir) sub)
(unless (string-equal
(directory-file-name (oref indexed-layer :dir))
(directory-file-name sub))
(configuration-layer//warning (configuration-layer//warning
(concat (concat
"Duplicated layer %s detected in directory \"%s\", " "Duplicated layer %s detected in directory \"%s\", "
@ -1100,8 +1172,10 @@ Returns nil if the directory is not a category."
(oset indexed-layer :dir sub)) (oset indexed-layer :dir sub))
(spacemacs-buffer/message (spacemacs-buffer/message
"-> Discovered configuration layer: %s" layer-name-str) "-> Discovered configuration layer: %s" layer-name-str)
(configuration-layer//add-layer
(configuration-layer/make-layer layer-name nil nil sub)))))
(let ((configuration-layer--load-packages-files nil))
(configuration-layer//add-layer
(configuration-layer/make-layer layer-name
nil nil sub))))))
(t (t
;; layer not found, add it to search path ;; layer not found, add it to search path
(setq search-paths (cons sub search-paths))))))))))) (setq search-paths (cons sub search-paths)))))))))))
@ -1325,23 +1399,30 @@ wether the declared layer is an used one or not."
(side . bottom) (side . bottom)
(window-height . 0.2))))) (window-height . 0.2)))))
;; ensure we have quelpa available first ;; ensure we have quelpa available first
(configuration-layer//install-quelpa)
(configuration-layer//configure-quelpa)
(let* ((upkg-names (configuration-layer//get-uninstalled-packages packages)) (let* ((upkg-names (configuration-layer//get-uninstalled-packages packages))
(not-inst-count (length upkg-names)) (not-inst-count (length upkg-names))
installed-count) installed-count)
;; installation ;; installation
(when upkg-names (when upkg-names
(spacemacs-buffer/append
(format "Found %s new package(s) to install...\n"
not-inst-count))
(configuration-layer/retrieve-package-archives)
(setq installed-count 0)
(spacemacs-buffer/set-mode-line "Installing packages...")
(spacemacs//redisplay) (spacemacs//redisplay)
(dolist (pkg-name upkg-names)
(setq installed-count (1+ installed-count))
(configuration-layer//install-package
(configuration-layer/get-package pkg-name)))
(spacemacs-buffer/append "\n")))))
(let ((delayed-warnings-backup delayed-warnings-list))
(spacemacs-buffer/append
(format "Found %s new package(s) to install...\n"
not-inst-count))
(configuration-layer/retrieve-package-archives)
(setq installed-count 0)
(spacemacs//redisplay)
(dolist (pkg-name upkg-names)
(setq installed-count (1+ installed-count))
(configuration-layer//install-package
(configuration-layer/get-package pkg-name)))
(spacemacs-buffer/append "\n")
(unless init-file-debug
;; get rid of all delayed warnings when byte-compiling packages
;; unless --debug-init was passed on the command line
(setq delayed-warnings-list delayed-warnings-backup)))))))
(defun configuration-layer//install-from-elpa (pkg-name) (defun configuration-layer//install-from-elpa (pkg-name)
"Install PKG from ELPA." "Install PKG from ELPA."
@ -1482,7 +1563,7 @@ wether the declared layer is an used one or not."
((null (oref pkg :owners)) ((null (oref pkg :owners))
(spacemacs-buffer/message (spacemacs-buffer/message
(format "%S ignored since it has no owner layer." pkg-name))) (format "%S ignored since it has no owner layer." pkg-name)))
((not (cfgl-package-enabledp pkg t))
((not (cfgl-package-enabledp pkg))
(spacemacs-buffer/message (format "%S is toggled off." pkg-name))) (spacemacs-buffer/message (format "%S is toggled off." pkg-name)))
(t (t
;; load-path ;; load-path
@ -1755,9 +1836,11 @@ to select one."
(unless (memq pkg package-activated-list) (unless (memq pkg package-activated-list)
(package-activate pkg))) (package-activate pkg)))
(defun configuration-layer//get-packages-dependencies ()
"Returns dependencies hash map for all packages in `package-alist'."
(let ((result (make-hash-table :size 512)))
(defun configuration-layer//get-packages-upstream-dependencies-from-alist ()
"Returns upsteam dependencies hash map for all packages in `package-alist'.
The keys are package names and the values are lists of package names that
depends on it."
(let ((result (make-hash-table :size 1024)))
(dolist (pkg package-alist) (dolist (pkg package-alist)
(let* ((pkg-sym (car pkg)) (let* ((pkg-sym (car pkg))
(deps (configuration-layer//get-package-deps-from-alist pkg-sym))) (deps (configuration-layer//get-package-deps-from-alist pkg-sym)))
@ -1769,7 +1852,7 @@ to select one."
result))))) result)))))
result)) result))
(defun configuration-layer//get-implicit-packages (packages)
(defun configuration-layer//get-implicit-packages-from-alist (packages)
"Returns packages in `packages-alist' which are not found in PACKAGES." "Returns packages in `packages-alist' which are not found in PACKAGES."
(let (imp-pkgs) (let (imp-pkgs)
(dolist (pkg package-alist) (dolist (pkg package-alist)
@ -1862,9 +1945,11 @@ to select one."
(defun configuration-layer/delete-orphan-packages (packages) (defun configuration-layer/delete-orphan-packages (packages)
"Delete PACKAGES if they are orphan." "Delete PACKAGES if they are orphan."
(interactive) (interactive)
(let* ((dependencies (configuration-layer//get-packages-dependencies))
(implicit-packages (configuration-layer//get-implicit-packages
packages))
(let* ((dependencies
(configuration-layer//get-packages-upstream-dependencies-from-alist))
(implicit-packages
(configuration-layer//get-implicit-packages-from-alist
packages))
(orphans (configuration-layer//get-orphan-packages (orphans (configuration-layer//get-orphan-packages
packages packages
implicit-packages implicit-packages
@ -1876,6 +1961,8 @@ to select one."
;; (message "orphans: %s" orphans) ;; (message "orphans: %s" orphans)
(if orphans (if orphans
(progn (progn
(spacemacs-buffer/set-mode-line "Uninstalling not used packages...")
(spacemacs//redisplay)
(spacemacs-buffer/append (spacemacs-buffer/append
(format "Found %s orphan package(s) to delete...\n" (format "Found %s orphan package(s) to delete...\n"
orphans-count)) orphans-count))
@ -1910,13 +1997,12 @@ to select one."
(defun configuration-layer//lazy-install-extensions-for-layer (layer-name) (defun configuration-layer//lazy-install-extensions-for-layer (layer-name)
"Return an alist of owned modes and extensions for the passed layer." "Return an alist of owned modes and extensions for the passed layer."
(let* ((layer (configuration-layer/get-layer layer-name)) (let* ((layer (configuration-layer/get-layer layer-name))
(packages (cfgl-layer-owned-packages layer))
(package-names (cfgl-layer-owned-packages layer))
result) result)
(dolist (pkg packages)
(let ((pkg-sym (oref pkg :name)))
(dolist (mode (list pkg-sym (intern (format "%S-mode" pkg-sym))))
(let ((ext (configuration-layer//gather-auto-mode-extensions mode)))
(when ext (push (cons mode ext) result))))))
(dolist (pkg-name package-names)
(dolist (mode (list pkg-name (intern (format "%S-mode" pkg-name))))
(let ((ext (configuration-layer//gather-auto-mode-extensions mode)))
(when ext (push (cons mode ext) result)))))
result)) result))
(defun configuration-layer//insert-lazy-install-form (layer-name mode ext) (defun configuration-layer//insert-lazy-install-form (layer-name mode ext)
@ -1971,17 +2057,18 @@ to select one."
(insert "\n"))))) (insert "\n")))))
(defun configuration-layer/load-or-install-protected-package (defun configuration-layer/load-or-install-protected-package
(pkg &optional log file-to-load)
(pkg &optional install log file-to-load)
"Load PKG package, and protect it against being deleted as an orphan. "Load PKG package, and protect it against being deleted as an orphan.
See `configuration-layer/load-or-install-package' for more information." See `configuration-layer/load-or-install-package' for more information."
(push pkg configuration-layer--protected-packages) (push pkg configuration-layer--protected-packages)
(configuration-layer/load-or-install-package pkg log file-to-load)) (configuration-layer/load-or-install-package pkg log file-to-load))
(defun configuration-layer/load-or-install-package (defun configuration-layer/load-or-install-package
(pkg &optional log file-to-load)
(pkg &optional install log file-to-load)
"Load PKG package. PKG will be installed if it is not already installed. "Load PKG package. PKG will be installed if it is not already installed.
Whenever the initial require fails the absolute path to the package Whenever the initial require fails the absolute path to the package
directory is returned. directory is returned.
If INSTALL is non-nil then try to install the package if needed.
If LOG is non-nil a message is displayed in spacemacs-buffer-mode buffer. If LOG is non-nil a message is displayed in spacemacs-buffer-mode buffer.
FILE-TO-LOAD is an explicit file to load after the installation." FILE-TO-LOAD is an explicit file to load after the installation."
(let ((warning-minimum-level :error)) (let ((warning-minimum-level :error))
@ -1989,22 +2076,162 @@ FILE-TO-LOAD is an explicit file to load after the installation."
;; not installed, we try to initialize package.el only if required to ;; not installed, we try to initialize package.el only if required to
;; precious seconds during boot time ;; precious seconds during boot time
(require 'cl) (require 'cl)
(let ((pkg-elpa-dir (spacemacs//get-package-directory pkg)))
(let ((pkg-elpa-dir
(configuration-layer/get-elpa-package-install-directory pkg)))
(if pkg-elpa-dir (if pkg-elpa-dir
(add-to-list 'load-path pkg-elpa-dir) (add-to-list 'load-path pkg-elpa-dir)
;; install the package ;; install the package
(when log
(spacemacs-buffer/append
(format "(Bootstrap) Installing %s...\n" pkg))
(spacemacs//redisplay))
(configuration-layer/retrieve-package-archives 'quiet)
(package-install pkg)
(setq pkg-elpa-dir (spacemacs//get-package-directory pkg)))
(when install
(when log
(spacemacs-buffer/append
(format "Installing package: %s...\n" pkg))
(spacemacs//redisplay))
(configuration-layer/retrieve-package-archives 'quiet)
(let ((delayed-warnings-backup delayed-warnings-list))
(package-install pkg)
(unless init-file-debug
(setq delayed-warnings-list delayed-warnings-backup)))
(setq pkg-elpa-dir
(configuration-layer/get-elpa-package-install-directory pkg))))
(unless (configuration-layer/get-package pkg)
(let ((obj (configuration-layer/make-package pkg 'system)))
(configuration-layer//add-package obj)))
(require pkg nil 'noerror) (require pkg nil 'noerror)
(when file-to-load (when file-to-load
(load-file (concat pkg-elpa-dir file-to-load))) (load-file (concat pkg-elpa-dir file-to-load)))
pkg-elpa-dir)))) pkg-elpa-dir))))
(defun configuration-layer//get-indexed-elpa-package-names ()
"Return a list of all ELPA packages in indexed packages and dependencies."
(let (result)
(dolist (pkg-sym (configuration-layer//get-distant-packages
(ht-keys configuration-layer--indexed-packages) nil))
(when (assq pkg-sym package-archive-contents)
(let* ((deps (mapcar 'car
(configuration-layer//get-package-deps-from-archive
pkg-sym)))
(elpa-deps (configuration-layer/filter-objects
deps (lambda (x)
(assq x package-archive-contents)))))
(dolist (pkg (cons pkg-sym elpa-deps))
;; avoid duplicates
(add-to-list 'result pkg)))))
result))
(defun configuration-layer//create-archive-contents-item (pkg-name)
"Return an item with an ELPA archive-contents compliant format."
(let ((obj (cadr (assq pkg-name package-archive-contents))))
(cons pkg-name `[,(package-desc-version obj)
,(package-desc-reqs obj)
,(package-desc-summary obj)
,(package-desc-kind obj)
,(package-desc-extras obj)])))
(defun configuration-layer//download-elpa-file
(pkg-name filename archive-url output-dir
&optional signaturep readmep)
"Download FILENAME from distant ELPA repository to OUTPUT-DIR.
Original code from dochang at https://github.com/dochang/elpa-clone"
(let ((source (concat archive-url filename))
(target (expand-file-name filename output-dir)))
(unless (file-exists-p target)
(let* ((readme-filename (format "%S-readme.txt" pkg-name))
(source-readme (concat archive-url readme-filename)))
(when (and readmep (url-http-file-exists-p source-readme))
(url-copy-file source-readme
(expand-file-name readme-filename output-dir)
'ok-if-already-exists)))
(when signaturep
(let* ((sig-filename (concat filename ".sig"))
(source-sig (concat archive-url sig-filename))
(target-sig (expand-file-name sig-filename output-dir)))
(url-copy-file source-sig target-sig 'ok-if-already-exists)))
(url-copy-file source target))))
(defun configuration-layer//sync-elpa-packages-files (packages output-dir)
"Synchronize PACKAGES files from remote ELPA directory to OUTPUT-DIR"
(message "Synchronizing files in ELPA repository at %s..." output-dir)
(let (filenames
(output-filenames (directory-files
output-dir nil "\\.\\(el\\|tar\\)$"))
(pkg-count (length packages))
(i 1))
(dolist (pkg-name packages)
(let* ((obj (cadr (assq pkg-name package-archive-contents)))
(filename (concat (package-desc-full-name obj)
(package-desc-suffix obj)))
(archive-url (cdr (assq (package-desc-archive obj)
package-archives))))
(push filename filenames)
(if (member filename output-filenames)
(message "[%s/%s] Skip %s..." i pkg-count filename)
(message "[%s/%s] Download %s..." i pkg-count filename)
(configuration-layer//download-elpa-file
pkg-name filename archive-url output-dir))
(setq i (1+ i))))
(dolist (ofilename output-filenames)
(unless (member ofilename filenames)
(message "Remove outdated %s..." ofilename)
(delete-file (concat output-dir ofilename))))))
(defun configuration-layer/create-elpa-repository (name output-dir)
"Create an ELPA repository containing all packages supported by Spacemacs."
(configuration-layer/make-all-packages 'no-discover)
(let (package-archive-contents
(package-archives '(("melpa" . "https://melpa.org/packages/")
("org" . "http://orgmode.org/elpa/")
("gnu" . "https://elpa.gnu.org/packages/"))))
(package-refresh-contents)
(package-read-all-archive-contents)
(let* ((packages (configuration-layer//get-indexed-elpa-package-names))
(archive-contents
(mapcar 'configuration-layer//create-archive-contents-item
packages))
(path (file-name-as-directory (concat output-dir name))))
(unless (file-exists-p path) (make-directory path 'create-parents))
(configuration-layer//sync-elpa-packages-files packages path)
(push 1 archive-contents)
(with-current-buffer (find-file-noselect
(concat path "archive-contents"))
(erase-buffer)
(prin1 archive-contents (current-buffer))
(save-buffer)))))
(defun configuration-layer//package-install-org (func &rest args)
"Advice around `package-install' to patch package name and dependencies at
install time in order to replace all `org' package installation by
`org-plus-contrib'. We avoid installing unecessarily both `org' and
`org-plus-contrib' at the same time (i.e. we always install `org-plus-contrib')"
(let* ((pkg (car args))
(patched
(cond
;; patch symbol name
((and (symbolp pkg) (eq 'org pkg))
(setcar args 'org-plus-contrib)
t)
;; patch name in package-desc object
((and (package-desc-p pkg)
(eq 'org (package-desc-name pkg)))
(setf (package-desc-name pkg) 'org-plus-contrib)
t)
;; patch dependencies in package-desc object
((and (package-desc-p pkg)
(assq 'org (package-desc-reqs pkg)))
(setf (car (assq 'org (package-desc-reqs pkg))) 'org-plus-contrib)
t))))
(let ((name (if (package-desc-p pkg)
(package-desc-name pkg)
pkg)))
;; check manually if `org-plus-contrib' is already installed since
;; package.el may install `org-plus-contrib' more than once.
;; Maybe we could hook somewhere else (at transaction computation time?)
(if (or patched (eq 'org-plus-contrib name))
(unless (package-installed-p name)
(apply func args))
(apply func args)))))
(advice-add 'package-install :around #'configuration-layer//package-install-org)
(defun configuration-layer//increment-error-count () (defun configuration-layer//increment-error-count ()
"Increment the error counter." "Increment the error counter."
(if configuration-layer-error-count (if configuration-layer-error-count


+ 156
- 1
emacs.d/core/core-debug.el View File

@ -1,6 +1,6 @@
;;; core-debug.el --- Spacemacs Core File -*- lexical-binding: t; -*- ;;; core-debug.el --- Spacemacs Core File -*- lexical-binding: t; -*-
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -9,6 +9,15 @@
;; ;;
;;; License: GPLv3 ;;; License: GPLv3
(defun spacemacs/display-and-copy-version ()
"Echo the current spacemacs version and copy it."
(interactive)
(let ((msg (format "Spacemacs v.%s" spacemacs-version)))
(message msg) (kill-new msg)))
;; startup debug
(require 'profiler) (require 'profiler)
(defvar spacemacs-debug-timer-threshold 0.15 (defvar spacemacs-debug-timer-threshold 0.15
@ -140,4 +149,150 @@ seconds to load")
;; Keep debug-on-error on for stuff that is lazily loaded ;; Keep debug-on-error on for stuff that is lazily loaded
(add-hook 'after-init-hook (lambda () (setq debug-on-error t)))) (add-hook 'after-init-hook (lambda () (setq debug-on-error t))))
;; Report issue
(defun spacemacs//describe-system-info-string ()
"Gathers info about your Spacemacs setup and returns it as a string."
(format
(concat "#### System Info :computer:\n"
"- OS: %s\n"
"- Emacs: %s\n"
"- Spacemacs: %s\n"
"- Spacemacs branch: %s (rev. %s)\n"
"- Graphic display: %s\n"
"- Distribution: %s\n"
"- Editing style: %s\n"
"- Completion: %s\n"
"- Layers:\n```elisp\n%s```\n"
(when (version<= "25.1" emacs-version)
"- System configuration features: %s\n"))
system-type
emacs-version
spacemacs-version
(spacemacs//git-get-current-branch)
(spacemacs/git-get-current-branch-rev)
(display-graphic-p)
dotspacemacs-distribution
dotspacemacs-editing-style
(cond ((configuration-layer/layer-usedp 'helm)
'helm)
((configuration-layer/layer-usedp 'ivy)
'ivy)
(t 'helm))
(pp-to-string dotspacemacs--configuration-layers-saved)
(bound-and-true-p system-configuration-features)))
(defun spacemacs/describe-system-info ()
"Gathers info about your Spacemacs setup and copies to clipboard."
(interactive)
(let ((sysinfo (spacemacs//describe-system-info-string)))
(kill-new sysinfo)
(message sysinfo)
(message (concat "Information has been copied to clipboard.\n"
"You can paste it in the gitter chat.\n"
"Check the *Messages* buffer if you need to review it"))))
(defun spacemacs//describe-last-keys-string ()
"Gathers info about your Emacs last keys and returns it as a string."
(loop
for key
across (recent-keys)
collect (if (or (integerp key) (symbolp key) (listp key))
(single-key-description key)
(prin1-to-string key))
into keys
finally (return
(with-temp-buffer
(set-fill-column 60)
(insert (mapconcat 'identity keys " "))
(fill-region (point-min) (point-max))
(format "#### Emacs last keys :musical_keyboard: \n```text\n%s\n```\n" (buffer-string))))))
(defun spacemacs/describe-last-keys ()
"Gathers info about your Emacs last keys and copies to clipboard."
(interactive)
(let ((lossage (spacemacs//describe-last-keys-string)))
(kill-new lossage)
(message lossage)
(message (concat "Information has been copied to clipboard.\n"
(propertize
"PLEASE REVIEW THE DATA BEFORE GOING FURTHER AS IT CAN CONTAIN SENSITIVE DATA (PASSWORD, ...)\n"
'face 'font-lock-warning-face)
"You can paste it in the gitter chat.\n"
"Check the *Messages* buffer if you need to review it"))))
(defun spacemacs/report-issue (arg)
"Open a spacemacs/report-issue-mode buffer prepopulated with
issue report template and system information.
With prefix arg,include the last keys pressed."
(interactive "P")
(let ((buf
(generate-new-buffer "REPORT_SPACEMACS_ISSUE"))
(system-info
(spacemacs//describe-system-info-string))
(backtrace
(if (get-buffer "*Backtrace*")
(with-current-buffer "*Backtrace*"
(buffer-substring-no-properties
(point-min)
(min (point-max) 1000)))
"<<BACKTRACE IF RELEVANT>>"))
(last-keys
(if (and arg (y-or-n-p (concat "Do you really want to "
"include your last pressed keys? It "
"may include some sensitive data.")))
(concat (spacemacs//describe-last-keys-string) "\n")
"")))
(switch-to-buffer buf)
(insert-file-contents-literally
(concat configuration-layer-template-directory "REPORTING.template"))
(loop
for (placeholder replacement)
in `(("%SYSTEM_INFO%" ,system-info)
("%BACKTRACE%" ,backtrace)
("(%LAST_KEYS%)\n" ,last-keys))
do (save-excursion
(goto-char (point-min))
(search-forward placeholder)
(replace-match replacement [keep-case] [literal])))
(spacemacs/report-issue-mode)))
(define-derived-mode spacemacs/report-issue-mode markdown-mode "Report-Issue"
"Major mode for reporting issues with Spacemacs.
When done editing, you can type \\[spacemacs//report-issue-done] to create the
issue on Github. You must be logged in already for this to work. After you see
that the issue has been created successfully, you can close this buffer.
Markdown syntax is supported in this buffer.
\\{spacemacs/report-issue-mode-map}
"
(font-lock-add-keywords 'spacemacs/report-issue-mode
'(("\\(<<.*?>>\\)" . 'font-lock-comment-face))))
(define-key spacemacs/report-issue-mode-map
(kbd "C-c C-c") 'spacemacs//report-issue-done)
(define-key spacemacs/report-issue-mode-map
(kbd "C-c C-k") 'kill-buffer)
(with-eval-after-load 'bind-map
(spacemacs/set-leader-keys-for-major-mode 'spacemacs/report-issue-mode
"," 'spacemacs//report-issue-done
"c" 'spacemacs//report-issue-done
"a" 'kill-buffer
"k" 'kill-buffer))
(defun spacemacs//report-issue-done ()
(interactive)
(let ((url "http://github.com/syl20bnr/spacemacs/issues/new?body="))
(setq url (url-encode-url (concat url (buffer-string))))
;; HACK: encode some characters according to HTML URL Encoding Reference
;; http://www.w3schools.com/tags/ref_urlencode.asp
(setq url (replace-regexp-in-string "#" "%23" url))
(setq url (replace-regexp-in-string ";" "%3B" url))
(browse-url url)))
(provide 'core-debug) (provide 'core-debug)

+ 1
- 1
emacs.d/core/core-display-init.el View File

@ -1,6 +1,6 @@
;;; core-display-init.el --- Spacemacs Core File ;;; core-display-init.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/core/core-documentation.el View File

@ -1,6 +1,6 @@
;;; core-spacemacs.el --- Spacemacs Core File ;;; core-spacemacs.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 32
- 15
emacs.d/core/core-dotspacemacs.el View File

@ -1,6 +1,6 @@
;;; core-dotspacemacs.el --- Spacemacs Core File ;;; core-dotspacemacs.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -232,7 +232,7 @@ auto-save the file in-place, `cache' to auto-save the file to another
file stored in the cache directory and `nil' to disable auto-saving. file stored in the cache directory and `nil' to disable auto-saving.
Default value is `cache'.") Default value is `cache'.")
(defvar dotspacemacs-enable-paste-transient-state t
(defvar dotspacemacs-enable-paste-transient-state nil
"If non nil the paste transient-state is enabled. While enabled pressing `p` "If non nil the paste transient-state is enabled. While enabled pressing `p`
several times cycle between the kill ring content.'") several times cycle between the kill ring content.'")
(defvaralias (defvaralias
@ -293,8 +293,20 @@ recenters point when it reaches the top or bottom of the
screen.") screen.")
(defvar dotspacemacs-line-numbers nil (defvar dotspacemacs-line-numbers nil
"If non nil line numbers are turned on in all `prog-mode' and `text-mode'
derivatives. If set to `relative', also turns on relative line numbers.")
"Control line numbers activation.
If set to `t' or `relative' line numbers are turned on in all `prog-mode' and
`text-mode' derivatives. If set to `relative', line numbers are relative.
This variable can also be set to a property list for finer control:
'(:relative nil
:disabled-for-modes dired-mode
doc-view-mode
markdown-mode
org-mode
pdf-view-mode
text-mode
:size-limit-kb 1000)
The property `:enabled-for-modes' takes priority over `:disabled-for-modes' and
restricts line-number to the specified list of major-mode.")
(defvar dotspacemacs-persistent-server nil (defvar dotspacemacs-persistent-server nil
"If non nil advises quit functions to keep server open when quitting.") "If non nil advises quit functions to keep server open when quitting.")
@ -456,8 +468,9 @@ Called with `C-u C-u' skips `dotspacemacs/user-config' _and_ preleminary tests."
(lambda (x) (lambda (x)
(and (boundp x) (and (boundp x)
(not (keywordp x)) (not (keywordp x))
(string-prefix-p "dotspacemacs"
(symbol-name x))))))
;; avoid private variables to show up
(not (string-match-p "--" (symbol-name x)))
(string-prefix-p "dotspacemacs" (symbol-name x))))))
(defun dotspacemacs/get-variable-list () (defun dotspacemacs/get-variable-list ()
"Return a list of all dotspacemacs variable symbols." "Return a list of all dotspacemacs variable symbols."
@ -493,6 +506,14 @@ a display strng and the value is the actual value to return."
(cadr (assoc (ido-completing-read prompt (mapcar 'car candidates)) (cadr (assoc (ido-completing-read prompt (mapcar 'car candidates))
candidates)))) candidates))))
(defun dotspacemacs/maybe-install-dotfile ()
"Install the dotfile if it does not exist."
(unless (file-exists-p dotspacemacs-filepath)
(spacemacs-buffer/set-mode-line "Dotfile wizard installer")
(spacemacs//redisplay)
(when (dotspacemacs/install 'with-wizard)
(configuration-layer/sync))))
(defun dotspacemacs/install (arg) (defun dotspacemacs/install (arg)
"Install the dotfile, return non nil if the doftile has been installed. "Install the dotfile, return non nil if the doftile has been installed.
@ -548,20 +569,16 @@ If ARG is non nil then Ask questions to the user before installing the dotfile."
(write-file dotspacemacs-filepath) (write-file dotspacemacs-filepath)
(message "%s has been installed." dotspacemacs-filepath) (message "%s has been installed." dotspacemacs-filepath)
t)))) t))))
(load-file dotspacemacs-filepath))
(defun dotspacemacs//install-and-replace (&optional values)
"Install the dotfile and replace its content according to VALUES.
VALUES is an alist where the key is the text to replace and value is the new
value."
)
(dotspacemacs/load-file)
;; force new wizard values to be applied
(dotspacemacs/init))
(defun dotspacemacs/load-file () (defun dotspacemacs/load-file ()
"Load ~/.spacemacs if it exists." "Load ~/.spacemacs if it exists."
(let ((dotspacemacs (dotspacemacs/location))) (let ((dotspacemacs (dotspacemacs/location)))
(if (file-exists-p dotspacemacs) (if (file-exists-p dotspacemacs)
(unless (with-demoted-errors "Error loading .spacemacs: %S" (load dotspacemacs))
(unless (with-demoted-errors "Error loading .spacemacs: %S"
(load dotspacemacs))
(dotspacemacs/safe-load))))) (dotspacemacs/safe-load)))))
(defun dotspacemacs/safe-load () (defun dotspacemacs/safe-load ()


+ 1
- 1
emacs.d/core/core-emacs-backports.el View File

@ -1,6 +1,6 @@
;;; core-emacs-backports.el --- Spacemacs Core File ;;; core-emacs-backports.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/core/core-fonts-support.el View File

@ -1,6 +1,6 @@
;;; core-fonts-support.el --- Spacemacs Core File ;;; core-fonts-support.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 20
- 9
emacs.d/core/core-funcs.el View File

@ -1,6 +1,6 @@
;;; core-funcs.el --- Spacemacs Core File ;;; core-funcs.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -35,14 +35,6 @@
`text-mode' but should." `text-mode' but should."
(run-hooks 'text-mode-hook)) (run-hooks 'text-mode-hook))
(defun spacemacs//get-package-directory (pkg)
"Return the directory of PKG. Return nil if not found."
(let ((elpa-dir (file-name-as-directory package-user-dir)))
(when (file-exists-p elpa-dir)
(let* ((pkg-match (concat "\\`" (symbol-name pkg) "-[0-9]+"))
(dir (car (directory-files elpa-dir 'full pkg-match))))
(when dir (file-name-as-directory dir))))))
(defun spacemacs/mplist-get (plist prop) (defun spacemacs/mplist-get (plist prop)
"Get the values associated to PROP in PLIST, a modified plist. "Get the values associated to PROP in PLIST, a modified plist.
@ -301,6 +293,15 @@ buffer."
(let ((message-log-max nil)) (let ((message-log-max nil))
(apply 'message msg args))) (apply 'message msg args)))
(defun spacemacs/derived-mode-p (mode &rest modes)
"Non-nil if MODE is derived from one of MODES."
;; We could have copied the built-in `derived-mode-p' and modified it a bit so
;; it works on arbitrary modes instead of only the current major-mode. We
;; don't do that because then we will need to modify the function if
;; `derived-mode-p' changes.
(let ((major-mode mode))
(apply #'derived-mode-p modes)))
(defun spacemacs/alternate-buffer (&optional window) (defun spacemacs/alternate-buffer (&optional window)
"Switch back and forth between current and last buffer in the "Switch back and forth between current and last buffer in the
current window." current window."
@ -319,6 +320,16 @@ current window."
;; `other-buffer' honors `buffer-predicate' so no need to filter ;; `other-buffer' honors `buffer-predicate' so no need to filter
(other-buffer current-buffer t))))) (other-buffer current-buffer t)))))
(defun spacemacs/alternate-window ()
"Switch back and forth between current and last window in the
current frame."
(interactive)
(let (;; switch to first window previously shown in this frame
(prev-window (get-mru-window nil t t)))
;; Check window was not found successfully
(unless prev-window (user-error "Last window not found."))
(select-window prev-window)))
(defun spacemacs/comint-clear-buffer () (defun spacemacs/comint-clear-buffer ()
(interactive) (interactive)
(let ((comint-buffer-maximum-size 0)) (let ((comint-buffer-maximum-size 0))


+ 16
- 3
emacs.d/core/core-jump.el View File

@ -1,6 +1,6 @@
;;; core-jump.el --- Spacemacs Core File ;;; core-jump.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -36,9 +36,11 @@ sets `spacemacs-jump-handlers' in buffers of that mode."
(add-hook ',mode-hook ',func) (add-hook ',mode-hook ',func)
(with-eval-after-load 'bind-map (with-eval-after-load 'bind-map
(spacemacs/set-leader-keys-for-major-mode ',mode (spacemacs/set-leader-keys-for-major-mode ',mode
"gg" 'spacemacs/jump-to-definition)))))
"gg" 'spacemacs/jump-to-definition
"gG" 'spacemacs/jump-to-definition-other-window)))))
(defun spacemacs/jump-to-definition () (defun spacemacs/jump-to-definition ()
"Jump to definition around point using the best tool for this action."
(interactive) (interactive)
(catch 'done (catch 'done
(let ((old-buffer (current-buffer)) (let ((old-buffer (current-buffer))
@ -49,12 +51,23 @@ sets `spacemacs-jump-handlers' in buffers of that mode."
(plist-get (cdr -handler) :async)))) (plist-get (cdr -handler) :async))))
(ignore-errors (ignore-errors
(call-interactively handler)) (call-interactively handler))
(when (or async
(when (or (eq async t)
(and (fboundp async) (funcall async))
(not (eq old-point (point))) (not (eq old-point (point)))
(not (equal old-buffer (current-buffer)))) (not (equal old-buffer (current-buffer))))
(throw 'done t))))) (throw 'done t)))))
(message "No jump handler was able to find this symbol."))) (message "No jump handler was able to find this symbol.")))
(defun spacemacs/jump-to-definition-other-window ()
"Jump to definition around point in other window."
(interactive)
(let ((pos (point)))
;; since `spacemacs/jump-to-definition' can be asynchronous we cannot use
;; `save-excursion' here, so we have to bear with the jumpy behavior.
(switch-to-buffer-other-window (current-buffer))
(goto-char pos)
(spacemacs/jump-to-definition)))
;; Set the `:jump' property manually instead of just using `evil-define-motion' ;; Set the `:jump' property manually instead of just using `evil-define-motion'
;; in an `eval-after-load' macro invocation because doing that prevents ;; in an `eval-after-load' macro invocation because doing that prevents
;; `describe-function' from correctly finding the source. ;; `describe-function' from correctly finding the source.


+ 5
- 5
emacs.d/core/core-keybindings.el View File

@ -1,6 +1,6 @@
;;; core-keybindings.el --- Spacemacs Core File ;;; core-keybindings.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -57,6 +57,7 @@ LONG-NAME if given is stored in `spacemacs/prefix-titles'."
(which-key-declare-prefixes (which-key-declare-prefixes
full-prefix-emacs (cons name long-name) full-prefix-emacs (cons name long-name)
full-prefix (cons name long-name)))) full-prefix (cons name long-name))))
(put 'spacemacs/declare-prefix 'lisp-indent-function 'defun)
(defun spacemacs/declare-prefix-for-mode (mode prefix name &optional long-name) (defun spacemacs/declare-prefix-for-mode (mode prefix name &optional long-name)
"Declare a prefix PREFIX. MODE is the mode in which this prefix command should "Declare a prefix PREFIX. MODE is the mode in which this prefix command should
@ -81,6 +82,7 @@ used as the prefix command."
(when (and is-major-mode-prefix dotspacemacs-major-mode-emacs-leader-key) (when (and is-major-mode-prefix dotspacemacs-major-mode-emacs-leader-key)
(which-key-declare-prefixes-for-mode (which-key-declare-prefixes-for-mode
mode major-mode-prefix-emacs prefix-name))))) mode major-mode-prefix-emacs prefix-name)))))
(put 'spacemacs/declare-prefix-for-mode 'lisp-indent-function 'defun)
(defun spacemacs/set-leader-keys (key def &rest bindings) (defun spacemacs/set-leader-keys (key def &rest bindings)
"Add KEY and DEF as key bindings under "Add KEY and DEF as key bindings under
@ -120,15 +122,13 @@ minor-mode, the third argument should be non nil."
dotspacemacs-major-mode-leader-key)) dotspacemacs-major-mode-leader-key))
(leader2 (when (spacemacs//acceptable-leader-p (leader2 (when (spacemacs//acceptable-leader-p
dotspacemacs-leader-key) dotspacemacs-leader-key)
(concat dotspacemacs-leader-key
(unless minor " m"))))
(concat dotspacemacs-leader-key " m")))
(emacs-leader1 (when (spacemacs//acceptable-leader-p (emacs-leader1 (when (spacemacs//acceptable-leader-p
dotspacemacs-major-mode-emacs-leader-key) dotspacemacs-major-mode-emacs-leader-key)
dotspacemacs-major-mode-emacs-leader-key)) dotspacemacs-major-mode-emacs-leader-key))
(emacs-leader2 (when (spacemacs//acceptable-leader-p (emacs-leader2 (when (spacemacs//acceptable-leader-p
dotspacemacs-emacs-leader-key) dotspacemacs-emacs-leader-key)
(concat dotspacemacs-emacs-leader-key
(unless minor " m"))))
(concat dotspacemacs-emacs-leader-key " m")))
(leaders (delq nil (list leader1 leader2))) (leaders (delq nil (list leader1 leader2)))
(emacs-leaders (delq nil (list emacs-leader1 emacs-leader2)))) (emacs-leaders (delq nil (list emacs-leader1 emacs-leader2))))
(or (boundp prefix) (or (boundp prefix)


+ 8
- 2
emacs.d/core/core-load-paths.el View File

@ -1,6 +1,6 @@
;;; core-load-paths.el --- Spacemacs Core File ;;; core-load-paths.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -73,5 +73,11 @@
`( `(
,spacemacs-core-directory ,spacemacs-core-directory
,(concat spacemacs-core-directory "libs/") ,(concat spacemacs-core-directory "libs/")
,(concat spacemacs-core-directory "aprilfool/")
,(concat spacemacs-core-directory "libs/spacemacs-theme/")
;; ,(concat spacemacs-core-directory "aprilfool/")
)) ))
;; themes
(add-to-list 'custom-theme-load-path (concat spacemacs-core-directory
"libs/spacemacs-theme/"))

+ 1
- 1
emacs.d/core/core-micro-state.el View File

@ -1,7 +1,7 @@
;;; -*- lexical-binding: t -*- ;;; -*- lexical-binding: t -*-
;;; core-micro-state.el --- Spacemacs Core File ;;; core-micro-state.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/core/core-release-management.el View File

@ -1,6 +1,6 @@
;;; core-spacemacs.el --- Spacemacs Core File ;;; core-spacemacs.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 494
- 433
emacs.d/core/core-spacemacs-buffer.el
File diff suppressed because it is too large
View File


+ 42
- 161
emacs.d/core/core-spacemacs.el View File

@ -1,6 +1,6 @@
;;; core-spacemacs.el --- Spacemacs Core File ;;; core-spacemacs.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -67,6 +67,7 @@ the final step of executing code in `emacs-startup-hook'.")
;; this is for a smoother UX at startup (i.e. less graphical glitches) ;; this is for a smoother UX at startup (i.e. less graphical glitches)
(hidden-mode-line-mode) (hidden-mode-line-mode)
(spacemacs//removes-gui-elements) (spacemacs//removes-gui-elements)
(spacemacs//setup-ido-vertical-mode)
;; explicitly set the prefered coding systems to avoid annoying prompt ;; explicitly set the prefered coding systems to avoid annoying prompt
;; from emacs (especially on Microsoft Windows) ;; from emacs (especially on Microsoft Windows)
(prefer-coding-system 'utf-8) (prefer-coding-system 'utf-8)
@ -80,13 +81,26 @@ the final step of executing code in `emacs-startup-hook'.")
(dotspacemacs/load-file) (dotspacemacs/load-file)
(require 'core-configuration-layer) (require 'core-configuration-layer)
(dotspacemacs|call-func dotspacemacs/init "Calling dotfile init...") (dotspacemacs|call-func dotspacemacs/init "Calling dotfile init...")
(when dotspacemacs-maximized-at-startup
(unless (frame-parameter nil 'fullscreen)
(toggle-frame-maximized))
(add-to-list 'default-frame-alist '(fullscreen . maximized)))
(dotspacemacs|call-func dotspacemacs/user-init "Calling dotfile user init...") (dotspacemacs|call-func dotspacemacs/user-init "Calling dotfile user init...")
(setq dotspacemacs-editing-style (dotspacemacs//read-editing-style-config (setq dotspacemacs-editing-style (dotspacemacs//read-editing-style-config
dotspacemacs-editing-style)) dotspacemacs-editing-style))
(configuration-layer/initialize) (configuration-layer/initialize)
;; default theme
;; Apply theme
(let ((default-theme (car dotspacemacs-themes))) (let ((default-theme (car dotspacemacs-themes)))
(spacemacs/load-theme default-theme)
(condition-case err
(spacemacs/load-theme default-theme nil)
('error
;; fallback on Spacemacs default theme
(setq spacemacs--default-user-theme default-theme)
(setq dotspacemacs-themes (delq spacemacs--fallback-theme
dotspacemacs-themes))
(add-to-list 'dotspacemacs-themes spacemacs--fallback-theme)
(setq default-theme spacemacs--fallback-theme)
(load-theme spacemacs--fallback-theme t)))
;; protect used themes from deletion as orphans ;; protect used themes from deletion as orphans
(setq configuration-layer--protected-packages (setq configuration-layer--protected-packages
(append (append
@ -133,35 +147,42 @@ the final step of executing code in `emacs-startup-hook'.")
"with this build."))) "with this build.")))
;; check for new version ;; check for new version
(if dotspacemacs-mode-line-unicode-symbols (if dotspacemacs-mode-line-unicode-symbols
(setq-default spacemacs-version-check-lighter "[⇪]")))
(setq-default spacemacs-version-check-lighter "[⇪]"))
;; install the dotfile if required
(dotspacemacs/maybe-install-dotfile)
;; install user default theme if required
(when spacemacs--default-user-theme
(spacemacs/load-theme spacemacs--default-user-theme 'install)))
(defun spacemacs//removes-gui-elements () (defun spacemacs//removes-gui-elements ()
"Remove the menu bar, tool bar and scroll bars." "Remove the menu bar, tool bar and scroll bars."
;; removes the GUI elements ;; removes the GUI elements
(when (and (fboundp 'tool-bar-mode) (not (eq tool-bar-mode -1)))
(tool-bar-mode -1))
(unless (spacemacs/window-system-is-mac) (unless (spacemacs/window-system-is-mac)
(when (and (fboundp 'menu-bar-mode) (not (eq menu-bar-mode -1))) (when (and (fboundp 'menu-bar-mode) (not (eq menu-bar-mode -1)))
(menu-bar-mode -1))) (menu-bar-mode -1)))
(when (and (fboundp 'scroll-bar-mode) (not (eq scroll-bar-mode -1))) (when (and (fboundp 'scroll-bar-mode) (not (eq scroll-bar-mode -1)))
(scroll-bar-mode -1)) (scroll-bar-mode -1))
(when (and (fboundp 'tool-bar-mode) (not (eq tool-bar-mode -1)))
(tool-bar-mode -1))
;; tooltips in echo-aera ;; tooltips in echo-aera
(when (and (fboundp 'tooltip-mode) (not (eq tooltip-mode -1))) (when (and (fboundp 'tooltip-mode) (not (eq tooltip-mode -1)))
(tooltip-mode -1))) (tooltip-mode -1)))
(defun spacemacs/maybe-install-dotfile ()
"Install the dotfile if it does not exist."
(unless (file-exists-p dotspacemacs-filepath)
(spacemacs-buffer/set-mode-line "Dotfile wizard installer")
(spacemacs//redisplay)
(when (dotspacemacs/install 'with-wizard)
(configuration-layer/sync))))
(defun spacemacs/display-and-copy-version ()
"Echo the current spacemacs version and copy it."
(interactive)
(let ((msg (format "Spacemacs v.%s" spacemacs-version)))
(message msg) (kill-new msg)))
(defun spacemacs//setup-ido-vertical-mode ()
"Setup `ido-vertical-mode'."
(require 'ido-vertical-mode)
(ido-vertical-mode t)
(add-hook
'ido-setup-hook
;; think about hacking directly `ido-vertical-mode' source in libs instead.
(defun spacemacs//ido-vertical-natural-navigation ()
;; more natural navigation keys: up, down to change current item
;; left to go up dir
;; right to open the selected item
(define-key ido-completion-map (kbd "<up>") 'ido-prev-match)
(define-key ido-completion-map (kbd "<down>") 'ido-next-match)
(define-key ido-completion-map (kbd "<left>") 'ido-delete-backward-updir)
(define-key ido-completion-map (kbd "<right>") 'ido-exit-minibuffer))))
(defun display-startup-echo-area-message () (defun display-startup-echo-area-message ()
"Change the default welcome message of minibuffer to another one." "Change the default welcome message of minibuffer to another one."
@ -178,7 +199,7 @@ defer call using `spacemacs-post-user-config-hook'."
"Add post init processing." "Add post init processing."
(add-hook (add-hook
'emacs-startup-hook 'emacs-startup-hook
(lambda ()
(defun spacemacs/startup-hook ()
;; This is set here so that emacsclient will show the startup buffer (and ;; This is set here so that emacsclient will show the startup buffer (and
;; so that it can be changed in user-config if necessary). It was set to ;; so that it can be changed in user-config if necessary). It was set to
;; nil earlier in the startup process to properly handle command line ;; nil earlier in the startup process to properly handle command line
@ -194,148 +215,8 @@ defer call using `spacemacs-post-user-config-hook'."
(with-current-buffer "*scratch*" (with-current-buffer "*scratch*"
(funcall dotspacemacs-scratch-mode))) (funcall dotspacemacs-scratch-mode)))
(configuration-layer/display-summary emacs-start-time) (configuration-layer/display-summary emacs-start-time)
(spacemacs-buffer//startup-hook)
(spacemacs/check-for-new-version nil spacemacs-version-check-interval) (spacemacs/check-for-new-version nil spacemacs-version-check-interval)
(setq spacemacs-initialized t)))) (setq spacemacs-initialized t))))
(defun spacemacs//describe-system-info-string ()
"Gathers info about your Spacemacs setup and returns it as a string."
(format
(concat "#### System Info :computer:\n"
"- OS: %s\n"
"- Emacs: %s\n"
"- Spacemacs: %s\n"
"- Spacemacs branch: %s (rev. %s)\n"
"- Graphic display: %s\n"
"- Distribution: %s\n"
"- Editing style: %s\n"
"- Completion: %s\n"
"- Layers:\n```elisp\n%s```\n"
(when (version<= "25.1" emacs-version)
"- System configuration features: %s\n"))
system-type
emacs-version
spacemacs-version
(spacemacs//git-get-current-branch)
(spacemacs/git-get-current-branch-rev)
(display-graphic-p)
dotspacemacs-distribution
dotspacemacs-editing-style
(cond ((configuration-layer/layer-usedp 'helm)
'helm)
((configuration-layer/layer-usedp 'ivy)
'ivy)
(t 'helm))
(pp-to-string dotspacemacs--configuration-layers-saved)
(bound-and-true-p system-configuration-features)))
(defun spacemacs/describe-system-info ()
"Gathers info about your Spacemacs setup and copies to clipboard."
(interactive)
(let ((sysinfo (spacemacs//describe-system-info-string)))
(kill-new sysinfo)
(message sysinfo)
(message (concat "Information has been copied to clipboard.\n"
"You can paste it in the gitter chat.\n"
"Check the *Messages* buffer if you need to review it"))))
(defun spacemacs//describe-last-keys-string ()
"Gathers info about your Emacs last keys and returns it as a string."
(loop
for key
across (recent-keys)
collect (if (or (integerp key) (symbolp key) (listp key))
(single-key-description key)
(prin1-to-string key))
into keys
finally (return
(with-temp-buffer
(set-fill-column 60)
(insert (mapconcat 'identity keys " "))
(fill-region (point-min) (point-max))
(format "#### Emacs last keys :musical_keyboard: \n```text\n%s\n```\n" (buffer-string))))))
(defun spacemacs/describe-last-keys ()
"Gathers info about your Emacs last keys and copies to clipboard."
(interactive)
(let ((lossage (spacemacs//describe-last-keys-string)))
(kill-new lossage)
(message lossage)
(message (concat "Information has been copied to clipboard.\n"
(propertize
"PLEASE REVIEW THE DATA BEFORE GOING FURTHER AS IT CAN CONTAIN SENSITIVE DATA (PASSWORD, ...)\n"
'face 'font-lock-warning-face)
"You can paste it in the gitter chat.\n"
"Check the *Messages* buffer if you need to review it"))))
(defun spacemacs/report-issue (arg)
"Open a spacemacs/report-issue-mode buffer prepopulated with
issue report template and system information.
With prefix arg,include the last keys pressed."
(interactive "P")
(let ((buf
(generate-new-buffer "REPORT_SPACEMACS_ISSUE"))
(system-info
(spacemacs//describe-system-info-string))
(backtrace
(if (get-buffer "*Backtrace*")
(with-current-buffer "*Backtrace*"
(buffer-substring-no-properties
(point-min)
(min (point-max) 1000)))
"<<BACKTRACE IF RELEVANT>>"))
(last-keys
(if (and arg (y-or-n-p (concat "Do you really want to "
"include your last pressed keys? It "
"may include some sensitive data.")))
(concat (spacemacs//describe-last-keys-string) "\n")
"")))
(switch-to-buffer buf)
(insert-file-contents-literally
(concat configuration-layer-template-directory "REPORTING.template"))
(loop
for (placeholder replacement)
in '(("%SYSTEM_INFO%" system-info)
("%BACKTRACE%" backtrace)
("(%LAST_KEYS%)\n" last-keys))
do (save-excursion
(goto-char (point-min))
(search-forward placeholder)
(replace-match (symbol-value replacement) [keep-case] [literal])))
(spacemacs/report-issue-mode)))
(define-derived-mode spacemacs/report-issue-mode markdown-mode "Report-Issue"
"Major mode for reporting issues with Spacemacs.
When done editing, you can type \\[spacemacs//report-issue-done] to create the
issue on Github. You must be logged in already for this to work. After you see
that the issue has been created successfully, you can close this buffer.
Markdown syntax is supported in this buffer.
\\{spacemacs/report-issue-mode-map}
"
(font-lock-add-keywords 'spacemacs/report-issue-mode
'(("\\(<<.*?>>\\)" . 'font-lock-comment-face))))
(define-key spacemacs/report-issue-mode-map
(kbd "C-c C-c") 'spacemacs//report-issue-done)
(define-key spacemacs/report-issue-mode-map
(kbd "C-c C-k") 'kill-buffer)
(with-eval-after-load 'bind-map
(spacemacs/set-leader-keys-for-major-mode 'spacemacs/report-issue-mode
"," 'spacemacs//report-issue-done
"c" 'spacemacs//report-issue-done
"a" 'kill-buffer
"k" 'kill-buffer))
(defun spacemacs//report-issue-done ()
(interactive)
(let ((url "http://github.com/syl20bnr/spacemacs/issues/new?body="))
(setq url (url-encode-url (concat url (buffer-string))))
;; HACK: Needed because the first `#' is not encoded
(setq url (replace-regexp-in-string "#" "%23" url))
(browse-url url)))
(provide 'core-spacemacs) (provide 'core-spacemacs)

+ 195
- 143
emacs.d/core/core-themes-support.el View File

@ -1,6 +1,6 @@
;;; core-themes-support.el --- Spacemacs Core File ;;; core-themes-support.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -12,6 +12,12 @@
(defconst emacs-built-in-themes (cons 'default (custom-available-themes)) (defconst emacs-built-in-themes (cons 'default (custom-available-themes))
"List of emacs built-in themes") "List of emacs built-in themes")
(defvar spacemacs--fallback-theme 'spacemacs-dark
"Fallback theme if user theme cannot be applied.")
(defvar spacemacs--default-user-theme nil
"Internal variable storing user theme to be installed.")
(defface org-kbd (defface org-kbd
'((t (:background "LemonChiffon1" :foreground "black" :box '((t (:background "LemonChiffon1" :foreground "black" :box
(:line-width 2 :color nil :style released-button)))) (:line-width 2 :color nil :style released-button))))
@ -20,120 +26,140 @@
(defconst spacemacs-theme-name-to-package (defconst spacemacs-theme-name-to-package
'( '(
(alect-black-alt . alect-themes)
(alect-black . alect-themes)
(alect-dark-alt . alect-themes)
(alect-dark . alect-themes)
(alect-light-alt . alect-themes)
(alect-light . alect-themes)
(ample-light . ample-theme)
(ample-flat . ample-theme)
(apropospriate-light . apropospriate-theme)
(apropospriate-dark . apropospriate-theme)
(base16-3024 . base16-theme)
(base16-apathy . base16-theme)
(base16-ashes . base16-theme)
(base16-atelier-cave . base16-theme)
(base16-atelier-dune . base16-theme)
(base16-atelier-estuary . base16-theme)
(base16-atelier-forest . base16-theme)
(base16-atelier-heath . base16-theme)
(base16-atelier-lakeside . base16-theme)
(base16-atelier-plateau . base16-theme)
(base16-atelier-savanna . base16-theme)
(base16-atelier-seaside . base16-theme)
(base16-atelier-sulphurpool . base16-theme)
(base16-bespin . base16-theme)
(base16-brewer . base16-theme)
(base16-bright . base16-theme)
(base16-chalk . base16-theme)
(base16-codeschool . base16-theme)
(base16-darktooth . base16-theme)
(base16-default-dark . base16-theme)
(base16-default-light . base16-theme)
(base16-eighties . base16-theme)
(base16-embers . base16-theme)
(base16-flat . base16-theme)
(base16-github . base16-theme)
(base16-google-dark . base16-theme)
(base16-google-light . base16-theme)
(base16-grayscale-dark . base16-theme)
(base16-grayscale-light . base16-theme)
(base16-green-screen . base16-theme)
(base16-harmonic16-dark . base16-theme)
(base16-harmonic16-light . base16-theme)
(base16-hopscotch . base16-theme)
(base16-ir-black . base16-theme)
(base16-isotope . base16-theme)
(base16-london-tube . base16-theme)
(base16-macintosh . base16-theme)
(base16-marrakesh . base16-theme)
(base16-mocha . base16-theme)
(base16-monokai . base16-theme)
(base16-ocean . base16-theme)
(base16-oceanicnext . base16-theme)
(base16-paraiso . base16-theme)
(base16-phd . base16-theme)
(base16-pico . base16-theme)
(base16-pop . base16-theme)
(base16-railscasts . base16-theme)
(base16-seti-ui . base16-theme)
(base16-shapeshifter . base16-theme)
(base16-solar-flare . base16-theme)
(base16-solarized-dark . base16-theme)
(base16-solarized-light . base16-theme)
(base16-summerfruit-dark . base16-theme)
(base16-summerfruit-light . base16-theme)
(base16-tomorrow-night . base16-theme)
(base16-tomorrow . base16-theme)
(base16-twilight . base16-theme)
(base16-unikitty-dark . base16-theme)
(base16-unikitty-light . base16-theme)
(sanityinc-solarized-dark . color-theme-sanityinc-solarized)
(sanityinc-solarized-light . color-theme-sanityinc-solarized)
(sanityinc-tomorrow-blue . color-theme-sanityinc-tomorrow)
(sanityinc-tomorrow-bright . color-theme-sanityinc-tomorrow)
(sanityinc-tomorrow-day . color-theme-sanityinc-tomorrow)
(sanityinc-tomorrow-eighties . color-theme-sanityinc-tomorrow)
(sanityinc-tomorrow-night . color-theme-sanityinc-tomorrow)
(doom-one . doom-themes)
(doom-molokai . doom-themes)
(solarized-light . solarized-theme)
(solarized-dark . solarized-theme)
(spacemacs-light . spacemacs-theme)
(spacemacs-dark . spacemacs-theme)
(colorsarenice-dark . colorsarenice-theme)
(colorsarenice-light . colorsarenice-theme)
(hemisu-dark . hemisu-theme)
(hemisu-light . hemisu-theme)
(majapahit-dark . majapahit-theme)
(majapahit-light . majapahit-theme)
(material-light . material-theme)
(minimal-light . minimal-theme)
(moe-dark . moe-theme)
(moe-light . moe-theme)
(stekene-dark . stekene-theme)
(stekene-light . stekene-theme)
(brin . sublime-themes)
(dorsey . sublime-themes)
(fogus . sublime-themes)
(graham . sublime-themes)
(granger . sublime-themes)
(hickey . sublime-themes)
(junio . sublime-themes)
(mccarthy . sublime-themes)
(odersky . sublime-themes)
(omtose-darker . omtose-phellack-theme)
(omtose-softer . omtose-phellack-theme)
(ritchie . sublime-themes)
(spolsky . sublime-themes)
(wilson . sublime-themes)
(zonokai-blue . zonokai-theme)
(zonokai-red . zonokai-theme)
(tao-yin . tao-theme)
(tao-yang . tao-theme)
(farmhouse-light . farmhouse-theme)
(farmhouse-dark . farmhouse-theme)
(alect-black-alt . alect-themes)
(alect-black . alect-themes)
(alect-dark-alt . alect-themes)
(alect-dark . alect-themes)
(alect-light-alt . alect-themes)
(alect-light . alect-themes)
(ample-light . ample-theme)
(ample-flat . ample-theme)
(apropospriate-light . apropospriate-theme)
(apropospriate-dark . apropospriate-theme)
(base16-3024 . base16-theme)
(base16-apathy . base16-theme)
(base16-ashes . base16-theme)
(base16-atelier-cave-light . base16-theme)
(base16-atelier-cave . base16-theme)
(base16-atelier-dune-light . base16-theme)
(base16-atelier-dune . base16-theme)
(base16-atelier-estuary-light . base16-theme)
(base16-atelier-estuary . base16-theme)
(base16-atelier-forest-light . base16-theme)
(base16-atelier-forest . base16-theme)
(base16-atelier-heath-light . base16-theme)
(base16-atelier-heath . base16-theme)
(base16-atelier-lakeside-light . base16-theme)
(base16-atelier-lakeside . base16-theme)
(base16-atelier-plateau-light . base16-theme)
(base16-atelier-plateau . base16-theme)
(base16-atelier-savanna-light . base16-theme)
(base16-atelier-savanna . base16-theme)
(base16-atelier-seaside-light . base16-theme)
(base16-atelier-seaside . base16-theme)
(base16-atelier-sulphurpool-light . base16-theme)
(base16-atelier-sulphurpool . base16-theme)
(base16-bespin . base16-theme)
(base16-brewer . base16-theme)
(base16-bright . base16-theme)
(base16-chalk . base16-theme)
(base16-codeschool . base16-theme)
(base16-cupcake . base16-theme)
(base16-darktooth . base16-theme)
(base16-default-dark . base16-theme)
(base16-default-light . base16-theme)
(base16-dracula . base16-theme)
(base16-eighties . base16-theme)
(base16-embers . base16-theme)
(base16-flat . base16-theme)
(base16-github . base16-theme)
(base16-google-dark . base16-theme)
(base16-google-light . base16-theme)
(base16-grayscale-dark . base16-theme)
(base16-grayscale-light . base16-theme)
(base16-green-screen . base16-theme)
(base16-harmonic16-dark . base16-theme)
(base16-harmonic16-light . base16-theme)
(base16-hopscotch . base16-theme)
(base16-ir-black . base16-theme)
(base16-isotope . base16-theme)
(base16-london-tube . base16-theme)
(base16-macintosh . base16-theme)
(base16-marrakesh . base16-theme)
(base16-materia . base16-theme)
(base16-mexico-light . base16-theme)
(base16-mocha . base16-theme)
(base16-monokai . base16-theme)
(base16-ocean . base16-theme)
(base16-oceanicnext . base16-theme)
(base16-onedark . base16-theme)
(base16-paraiso . base16-theme)
(base16-phd . base16-theme)
(base16-pico . base16-theme)
(base16-pop . base16-theme)
(base16-railscasts . base16-theme)
(base16-rebecca . base16-theme)
(base16-seti . base16-theme)
(base16-seti-ui . base16-theme)
(base16-shapeshifter . base16-theme)
(base16-solar-flare . base16-theme)
(base16-solarized-dark . base16-theme)
(base16-solarized-light . base16-theme)
(base16-spacemacs . base16-theme)
(base16-summerfruit-dark . base16-theme)
(base16-summerfruit-light . base16-theme)
(base16-tomorrow-night . base16-theme)
(base16-tomorrow . base16-theme)
(base16-tube . base16-theme)
(base16-twilight . base16-theme)
(base16-unikitty-dark . base16-theme)
(base16-unikitty-light . base16-theme)
(base16-woodland . base16-theme)
(sanityinc-solarized-dark . color-theme-sanityinc-solarized)
(sanityinc-solarized-light . color-theme-sanityinc-solarized)
(sanityinc-tomorrow-blue . color-theme-sanityinc-tomorrow)
(sanityinc-tomorrow-bright . color-theme-sanityinc-tomorrow)
(sanityinc-tomorrow-day . color-theme-sanityinc-tomorrow)
(sanityinc-tomorrow-eighties . color-theme-sanityinc-tomorrow)
(sanityinc-tomorrow-night . color-theme-sanityinc-tomorrow)
(doom-one . doom-themes)
(doom-molokai . doom-themes)
(solarized-light . solarized-theme)
(solarized-dark . solarized-theme)
(spacemacs-light . spacemacs-theme)
(spacemacs-dark . spacemacs-theme)
(colorsarenice-dark . colorsarenice-theme)
(colorsarenice-light . colorsarenice-theme)
(hemisu-dark . hemisu-theme)
(hemisu-light . hemisu-theme)
(majapahit-dark . majapahit-theme)
(majapahit-light . majapahit-theme)
(material-light . material-theme)
(minimal-light . minimal-theme)
(moe-dark . moe-theme)
(moe-light . moe-theme)
(stekene-dark . stekene-theme)
(stekene-light . stekene-theme)
(brin . sublime-themes)
(dorsey . sublime-themes)
(fogus . sublime-themes)
(graham . sublime-themes)
(granger . sublime-themes)
(hickey . sublime-themes)
(junio . sublime-themes)
(mccarthy . sublime-themes)
(odersky . sublime-themes)
(omtose-darker . omtose-phellack-theme)
(omtose-softer . omtose-phellack-theme)
(ritchie . sublime-themes)
(spolsky . sublime-themes)
(wilson . sublime-themes)
(zonokai-blue . zonokai-theme)
(zonokai-red . zonokai-theme)
(tao-yin . tao-theme)
(tao-yang . tao-theme)
(farmhouse-light . farmhouse-theme)
(farmhouse-dark . farmhouse-theme)
) )
"alist matching a theme name with its package name, required when "alist matching a theme name with its package name, required when
package name does not match theme name + `-theme' suffix.") package name does not match theme name + `-theme' suffix.")
@ -152,16 +178,25 @@ package name does not match theme name + `-theme' suffix.")
;; fallback to <name>-theme ;; fallback to <name>-theme
(t (intern (format "%S-theme" theme))))) (t (intern (format "%S-theme" theme)))))
(defun spacemacs/load-theme (theme)
"Load THEME."
(defun spacemacs/load-theme (theme &optional install)
"Load THEME.
If INSTALL is non-nil then attempt to install the theme."
;; Required dependencies for some themes ;; Required dependencies for some themes
(condition-case-unless-debug err
(condition-case err
(progn (progn
(when (or (eq 'zonokai-blue theme)
(eq 'zonokai-red theme)
(eq 'solarized-light theme)
(eq 'solarized-dark theme))
(configuration-layer/load-or-install-package 'dash))
(when install
(spacemacs-buffer/append
(format "--> Installing user theme: %s..."
spacemacs--default-user-theme))
(redisplay))
;; Load theme
(when (or (memq theme '(zonokai-blue
zonokai-red
solarized-light
solarized-dark
doom-one
doom-molokai)))
(configuration-layer/load-or-install-package 'dash install))
;; Unless Emacs stock themes ;; Unless Emacs stock themes
(unless (or (memq theme (custom-available-themes)) (unless (or (memq theme (custom-available-themes))
(eq 'default theme)) (eq 'default theme))
@ -169,35 +204,49 @@ package name does not match theme name + `-theme' suffix.")
;; themes with explicitly declared package names ;; themes with explicitly declared package names
((assq theme spacemacs-theme-name-to-package) ((assq theme spacemacs-theme-name-to-package)
(let* ((pkg (spacemacs//get-theme-package theme)) (let* ((pkg (spacemacs//get-theme-package theme))
(pkg-dir (configuration-layer/load-or-install-package pkg)))
(pkg-dir (configuration-layer/load-or-install-package
pkg install)))
(when (or (eq 'moe-light theme) (when (or (eq 'moe-light theme)
(eq 'moe-dark theme)) (eq 'moe-dark theme))
(load-file (concat pkg-dir "moe-light-theme.el")) (load-file (concat pkg-dir "moe-light-theme.el"))
(load-file (concat pkg-dir "moe-dark-theme.el"))) (load-file (concat pkg-dir "moe-dark-theme.el")))
(add-to-list 'custom-theme-load-path pkg-dir)))
(when pkg-dir
(add-to-list 'custom-theme-load-path pkg-dir))))
(t (t
;; other themes ;; other themes
;; we assume that the package name is suffixed with `-theme' ;; we assume that the package name is suffixed with `-theme'
;; if not we will handle the special themes as we get issues ;; if not we will handle the special themes as we get issues
;; in the tracker. ;; in the tracker.
(let ((pkg (spacemacs//get-theme-package theme))) (let ((pkg (spacemacs//get-theme-package theme)))
(configuration-layer/load-or-install-package pkg))))))
(configuration-layer/load-or-install-package pkg install)))))
;; Apply theme
(mapc 'disable-theme custom-enabled-themes)
;; explicitly reload the theme for the first GUI client
(eval `(spacemacs|do-after-display-system-init
(load-theme ',theme t)))
(unless (display-graphic-p)
(load-theme theme t))
(when install
(spacemacs-buffer/replace-last-line
(format (concat "--> User theme \"%s\" has been applied, you may "
"have to restart Emacs.\n")
spacemacs--default-user-theme))
(redisplay)))
('error ('error
(setq theme 'default)
(display-warning 'spacemacs
(format (concat "An error occurred while retrieving the "
"theme, using default theme. (error: %s)")
err)
:warning)))
(mapc 'disable-theme custom-enabled-themes)
(if (eq 'default theme)
(progn
(setq spacemacs--cur-theme 'default)
(spacemacs/post-theme-init 'default))
(load-theme theme t)
;; explicitly reload the theme for the first GUI client
(eval `(spacemacs|do-after-display-system-init
(load-theme ',theme t)))))
(if install
(progn
(spacemacs-buffer/warning
(concat "An error occurred while applying "
"the theme \"%s\", fallback on theme \"%s\". \n"
"Error was: %s") theme spacemacs--fallback-theme err)
(spacemacs-buffer/warning
(concat "Please check the value of \"dotspacemacs-themes\" in your "
"dotfile or open an issue \n"
"so we can add support for the theme \"%s\".") theme)
(unless (display-graphic-p)
(eval `(spacemacs|do-after-display-system-init
(load-theme ',spacemacs--fallback-theme t)))))
(throw 'error)))))
(defun spacemacs/cycle-spacemacs-theme () (defun spacemacs/cycle-spacemacs-theme ()
"Cycle through themes defined in `dotspacemacs-themes.'" "Cycle through themes defined in `dotspacemacs-themes.'"
@ -209,8 +258,11 @@ package name does not match theme name + `-theme' suffix.")
(or (cdr (memq spacemacs--cur-theme dotspacemacs-themes)) (or (cdr (memq spacemacs--cur-theme dotspacemacs-themes))
dotspacemacs-themes))) dotspacemacs-themes)))
(setq spacemacs--cur-theme (pop spacemacs--cycle-themes)) (setq spacemacs--cur-theme (pop spacemacs--cycle-themes))
(message "Loading theme %s..." spacemacs--cur-theme)
(spacemacs/load-theme spacemacs--cur-theme))
(let ((progress-reporter
(make-progress-reporter
(format "Loading theme %s..." spacemacs--cur-theme))))
(spacemacs/load-theme spacemacs--cur-theme)
(progress-reporter-done progress-reporter)))
(defadvice load-theme (after spacemacs/load-theme-adv activate) (defadvice load-theme (after spacemacs/load-theme-adv activate)
"Perform post load processing." "Perform post load processing."


+ 1
- 1
emacs.d/core/core-toggle.el View File

@ -1,6 +1,6 @@
;;; core-toggle.el --- Spacemacs Core File ;;; core-toggle.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/core/core-transient-state.el View File

@ -1,7 +1,7 @@
;;; -*- lexical-binding: t -*- ;;; -*- lexical-binding: t -*-
;;; core-transient-state.el --- Spacemacs Core File ;;; core-transient-state.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Justin Burkett <justin@burkett.cc> ;; Author: Justin Burkett <justin@burkett.cc>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 2
- 2
emacs.d/core/core-use-package-ext.el View File

@ -1,6 +1,6 @@
;;; core-use-package-ext.el --- Spacemacs Core File ;;; core-use-package-ext.el --- Spacemacs Core File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -44,7 +44,7 @@ override lazy-loaded settings."
(let ((hook (intern (format "use-package--%S--%s-hook" (let ((hook (intern (format "use-package--%S--%s-hook"
name-symbol name-symbol
(substring (format "%s" keyword) 1))))) (substring (format "%s" keyword) 1)))))
(push `(add-hook ',hook (lambda nil ,@body)) expanded-forms)))))
(push `(add-hook ',hook (lambda nil ,@body t)) expanded-forms)))))
`(progn ,@expanded-forms))) `(progn ,@expanded-forms)))
(provide 'core-use-package-ext) (provide 'core-use-package-ext)

+ 6
- 0
emacs.d/core/info/quickhelp.txt View File

@ -2,12 +2,18 @@ Press [TAB] or [J] to move to next button.
Press [Shift-TAB] or [K] to move to previous button. Press [Shift-TAB] or [K] to move to previous button.
Press [w] to jump to warning list.
Press [r] to jump to recent file list if it is enabled. Press [r] to jump to recent file list if it is enabled.
Press [p] to jump to project list if it is enabled. Press [p] to jump to project list if it is enabled.
Press [b] to jump to bookmark list if it is enabled. Press [b] to jump to bookmark list if it is enabled.
Press [c] to jump to org-agenda list if it is enabled.
Press [d] to jump to org-todo list if it is enabled.
Press [o] to jump to any link or button. Press [o] to jump to any link or button.
Press [m] to jump to the top menu. Press [m] to jump to the top menu.


+ 1
- 1
emacs.d/core/info/release-notes/0.102.txt View File

@ -9,7 +9,7 @@ available in the dotfile.
and `(defvar <layer>-excluded-packages ...)` by `(setq ...)`. This will and `(defvar <layer>-excluded-packages ...)` by `(setq ...)`. This will
allow to install newly added packages to a layer without restarting spacemacs allow to install newly added packages to a layer without restarting spacemacs
by pressing `SPC f e R`. Be sure to remove the docstring when replacing the by pressing `SPC f e R`. Be sure to remove the docstring when replacing the
`defvar` since `setq` does not take a third argument.
`defvar` since `setq` does not take a third argument.
`:variables` keyword now behaves like a regular `setq` so you'll have to `:variables` keyword now behaves like a regular `setq` so you'll have to
quote any value appropriately. quote any value appropriately.


+ 12
- 0
emacs.d/core/info/release-notes/0.200.9.txt View File

@ -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!

+ 20
- 0
emacs.d/core/info/release-notes/af-2.01.txt View File

@ -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!

+ 2
- 2
emacs.d/core/libs/ht.el View File

@ -75,7 +75,7 @@ Errors if LIST doesn't contain an even number of elements."
;; take the head of LIST and push onto SUBLIST ;; take the head of LIST and push onto SUBLIST
(setq sublist (cons (car list) sublist)) (setq sublist (cons (car list) sublist))
(setq list (cdr list)) (setq list (cdr list))
(setq len (1+ len)) (setq len (1+ len))
(when (= len 2) (when (= len 2)
@ -83,7 +83,7 @@ Errors if LIST doesn't contain an even number of elements."
(setq result (cons (nreverse sublist) result)) (setq result (cons (nreverse sublist) result))
(setq sublist nil) (setq sublist nil)
(setq len 0))) (setq len 0)))
(when sublist (error "Expected an even number of elements")) (when sublist (error "Expected an even number of elements"))
(nreverse result))) (nreverse result)))


+ 360
- 0
emacs.d/core/libs/ido-vertical-mode.el View File

@ -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

+ 1536
- 0
emacs.d/core/libs/package-build.el
File diff suppressed because it is too large
View File


+ 654
- 0
emacs.d/core/libs/quelpa.el View File

@ -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

+ 161
- 0
emacs.d/core/libs/spacemacs-theme/README.md View File

@ -0,0 +1,161 @@
# Spacemacs-theme
[![MELPA](http://melpa.org/packages/spacemacs-theme-badge.svg)](http://melpa.org/#/spacemacs-theme) ![Made with Spacemacs](https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg)
[![Join the chat at https://gitter.im/nashamri/spacemacs-theme](https://badges.gitter.im/Join%20Chat.svg)] (https://gitter.im/nashamri/spacemacs-theme?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
![spacemacs-theme](/../screenshots/spacemacs-theme.png)
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
![spacemacs-theme-preview](/../screenshots/preview.png)
## Highlights
The theme has good support for org mode.
![spacemacs-theme-org](/../screenshots/org.png)
## 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:
![spacemacs-theme-guide-generic](/../screenshots/guide-generic.png)
![spacemacs-theme-guide-org](/../screenshots/guide-org.png)
![spacemacs-theme-guide-extra](/../screenshots/guide-extra.png)
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).

+ 786
- 0
emacs.d/core/libs/spacemacs-theme/spacemacs-common.el View File

@ -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

+ 7
- 0
emacs.d/core/libs/spacemacs-theme/spacemacs-dark-theme.el View File

@ -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)

+ 7
- 0
emacs.d/core/libs/spacemacs-theme/spacemacs-light-theme.el View File

@ -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)

+ 12
- 2
emacs.d/core/templates/.spacemacs.template View File

@ -246,8 +246,18 @@ values."
;; scrolling overrides the default behavior of Emacs which recenters point ;; scrolling overrides the default behavior of Emacs which recenters point
;; when it reaches the top or bottom of the screen. (default t) ;; when it reaches the top or bottom of the screen. (default t)
dotspacemacs-smooth-scrolling t dotspacemacs-smooth-scrolling t
;; If non nil line numbers are turned on in all `prog-mode' and `text-mode'
;; derivatives. If set to `relative', also turns on relative line numbers.
;; Control line numbers activation.
;; If set to `t' or `relative' line numbers are turned on in all `prog-mode' and
;; `text-mode' derivatives. If set to `relative', line numbers are relative.
;; This variable can also be set to a property list for finer control:
;; '(:relative nil
;; :disabled-for-modes dired-mode
;; doc-view-mode
;; markdown-mode
;; org-mode
;; pdf-view-mode
;; text-mode
;; :size-limit-kb 1000)
;; (default nil) ;; (default nil)
dotspacemacs-line-numbers nil dotspacemacs-line-numbers nil
;; Code folding method. Possible values are `evil' and `origami'. ;; Code folding method. Possible values are `evil' and `origami'.


+ 1
- 1
emacs.d/core/templates/packages.el.template View File

@ -1,6 +1,6 @@
;;; packages.el --- %LAYER_NAME% layer packages file for Spacemacs. ;;; packages.el --- %LAYER_NAME% layer packages file for Spacemacs.
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: %USER_FULL_NAME% <%USER_MAIL_ADDRESS%> ;; Author: %USER_FULL_NAME% <%USER_MAIL_ADDRESS%>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 2
- 2
emacs.d/core/tools/spacefmt/spacefmt.el View File

@ -1,6 +1,6 @@
;;; fmt.el --- .org file formatter. ;;; fmt.el --- .org file formatter.
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -72,7 +72,7 @@
(while (re-search-backward org-heading-regexp nil t)) (while (re-search-backward org-heading-regexp nil t))
(open-line 3) (open-line 3)
(forward-line 1) (forward-line 1)
(insert-string toc-headline)))
(insert toc-headline)))
(defun remove-empty-lines-after-headlines() (defun remove-empty-lines-after-headlines()
"Remove empty liners after each headline." "Remove empty liners after each headline."


+ 1
- 1
emacs.d/core/tools/spacefmt/tests/config.el View File

@ -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.
;; ;;


+ 330
- 0
emacs.d/doc/BEGINNERS_TUTORIAL.org View File

@ -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.

+ 5
- 3
emacs.d/doc/CONVENTIONS.org View File

@ -209,6 +209,7 @@ The base prefix for major mode specific compilation is ~SPC m c~.
|-------------+-------------------| |-------------+-------------------|
| ~m c b~ | compile buffer | | ~m c b~ | compile buffer |
| ~m c c~ | compile | | ~m c c~ | compile |
| ~m c C~ | clean |
| ~m c r~ | clean and compile | | ~m c r~ | clean and compile |
Note: we don't distinguish between the file and the buffer. We can Note: we don't distinguish between the file and the buffer. We can
@ -224,11 +225,12 @@ The base prefix for debugging commands is ~SPC d~.
| ~m d B~ | clear all breakpoints | | ~m d B~ | clear all breakpoints |
| ~m d c~ | continue | | ~m d c~ | continue |
| ~m d d~ | start debug session | | ~m d d~ | start debug session |
| ~m d i~ | inspect value at point |
| ~m d i~ | step in |
| ~m d l~ | local variables | | ~m d l~ | local variables |
| ~m d n~ | next |
| ~m d o~ | step out |
| ~m d r~ | run | | ~m d r~ | run |
| ~m d s~ | step |
| ~m d s~ | next step |
| ~m d v~ | inspect value at point |
Notes: Notes:
- Ideally a transient-state for breakpoint navigation should be provided. - Ideally a transient-state for breakpoint navigation should be provided.


+ 146
- 41
emacs.d/doc/DOCUMENTATION.org View File

@ -94,6 +94,7 @@
- [[#c-z-and-tab-switch][C-z and Tab switch]] - [[#c-z-and-tab-switch][C-z and Tab switch]]
- [[#helm-focus][Helm focus]] - [[#helm-focus][Helm focus]]
- [[#helm-transient-state][Helm transient state]] - [[#helm-transient-state][Helm transient state]]
- [[#ivy][Ivy]]
- [[#discovering][Discovering]] - [[#discovering][Discovering]]
- [[#key-bindings][Key bindings]] - [[#key-bindings][Key bindings]]
- [[#which-key][Which-key]] - [[#which-key][Which-key]]
@ -259,7 +260,7 @@ project.
* Who can benefit from this? * Who can benefit from this?
- Spacemacs was initially intended to be used by *Vim users* who want to go to - Spacemacs was initially intended to be used by *Vim users* who want to go to
the next level by using Emacs (see [[./VIMUSERS.org][guide]] for Vimmers). But it is now
the next level by using Emacs (see [[file:VIMUSERS.org][guide]] for Vimmers). But it is now
perfectly *usable by non Vim users* by choosing the =emacs= editing style. perfectly *usable by non Vim users* by choosing the =emacs= editing style.
- It is also a good fit for people wanting to *lower the [[http://en.wikipedia.org/wiki/Repetitive_strain_injury][risk of RSI]]* induced by - It is also a good fit for people wanting to *lower the [[http://en.wikipedia.org/wiki/Repetitive_strain_injury][risk of RSI]]* induced by
@ -324,6 +325,9 @@ and choosing a rollback slot (sorted by date). This button uses the command
=configuration-layer/rollback=. =configuration-layer/rollback=.
* Configuration layers * Configuration layers
:PROPERTIES:
:CUSTOM_ID: configuration-layers
:END:
This section is an overview of layers. A more extensive introduction to writing This section is an overview of layers. A more extensive introduction to writing
configuration layers can be found [[file:LAYERS.org][here]] (recommended reading!). configuration layers can be found [[file:LAYERS.org][here]] (recommended reading!).
@ -457,7 +461,7 @@ guidelines first in [[file:../CONTRIBUTING.org][CONTRIBUTING]].
** Example: Themes Megapack example ** Example: Themes Megapack example
This is a simple configuration layer listing a bunch of themes which you can This is a simple configuration layer listing a bunch of themes which you can
find [[../layers/themes-megapack/README.org][here]].
find [[file:../layers/+themes/themes-megapack/README.org][here]].
To install it, just add =themes-megapack= to your =~/.spacemacs= like so: To install it, just add =themes-megapack= to your =~/.spacemacs= like so:
@ -500,6 +504,9 @@ Please refer to [[file:LAYERS.org][this]] introduction for some tips on writing
best make them fit with the Spacemacs philosophy and loading strategy. best make them fit with the Spacemacs philosophy and loading strategy.
* Dotfile Configuration * Dotfile Configuration
:PROPERTIES:
:CUSTOM_ID: dotfile-configuration
:END:
User configuration can be stored in your =~/.spacemacs= file. User configuration can be stored in your =~/.spacemacs= file.
** Dotfile Installation ** Dotfile Installation
@ -597,7 +604,7 @@ to add some layers in =~/.myconfig=, set the variable like this:
*** Setting configuration layers variables *** Setting configuration layers variables
Some configuration layers have configuration variables to enable specific Some configuration layers have configuration variables to enable specific
feature. For instance the [[../layers/%2Bsource-control/git][git layer]] has several configuration variables, they
feature. For instance the [[file:../layers/+source-control/git/README.org][git layer]] has several configuration variables, they
can be set directly in the =dotspacemacs-configuration-layers= like this: can be set directly in the =dotspacemacs-configuration-layers= like this:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -691,7 +698,7 @@ orphan so it is considered unused by Spacemacs).
*** Excluding packages *** Excluding packages
You can exclude packages you don't want to install with the variable You can exclude packages you don't want to install with the variable
=dotspacemacs-excluded-packages= (see [[Configuration layers][Configuration layers]] for more info
=dotspacemacs-excluded-packages= (see [[#configuration-layers][Configuration layers]] for more info
on packages). on packages).
For instance, to disable the =rainbow-delimiters= package: For instance, to disable the =rainbow-delimiters= package:
@ -708,7 +715,7 @@ of the configuration, this is a powerful feature which allows you to quickly
remove any feature from Spacemacs. remove any feature from Spacemacs.
*Note:* A few packages are essential for Spacemacs to correctly operate, those *Note:* A few packages are essential for Spacemacs to correctly operate, those
packages are protected and cannot be excluded or unsintalled even if they become
packages are protected and cannot be excluded or uninstalled even if they become
orphans or are excluded. =use-package= is an example of a protected package that orphans or are excluded. =use-package= is an example of a protected package that
cannot be removed from Spacemacs. cannot be removed from Spacemacs.
@ -761,7 +768,7 @@ To bind keys in Hybrid editing style (=hybrid state=):
#+END_SRC #+END_SRC
This style can be tweaked to be more like Emacs or more like Vim depending This style can be tweaked to be more like Emacs or more like Vim depending
on the user preferences. The following variable are available to change the
on the user preferences. The following variables are available to change the
style configuration: style configuration:
- =hybrid-mode-default-state= The default state when opening a new buffer, - =hybrid-mode-default-state= The default state when opening a new buffer,
@ -784,6 +791,9 @@ To toggle the hybrid style on and off use ~SPC t E h~ and ~M-m t E h~. When
off the =vim= style is enabled. off the =vim= style is enabled.
** States ** States
:PROPERTIES:
:CUSTOM_ID: states
:END:
Spacemacs has 10 states: Spacemacs has 10 states:
| State | Default Color | Description | | State | Default Color | Description |
@ -796,9 +806,9 @@ Spacemacs has 10 states:
| replace | chocolate | exclusive to =Evil=, overwrites the character under point instead of inserting a new one | | replace | chocolate | exclusive to =Evil=, overwrites the character under point instead of inserting a new one |
| hybrid | blue | exclusive to Spacemacs, this is like the insert state except that all the emacs key bindings are available | | hybrid | blue | exclusive to Spacemacs, this is like the insert state except that all the emacs key bindings are available |
| evilified | light brown | exclusive to Spacemacs, this is an =emacs state= modified to bring Vim navigation, selection and search. | | evilified | light brown | exclusive to Spacemacs, this is an =emacs state= modified to bring Vim navigation, selection and search. |
| lisp | pink | exclusive to Spacemacs, used to navigate Lisp code and modify it (more [[Editing Lisp code][info]]) |
| iedit | red | exclusive to Spacemacs, used to navigate between multiple regions of text using =iedit= (more [[Replacing text with iedit][info]]) |
| iedit-insert | red | exclusive to Spacemacs, used to replace multiple regions of text using =iedit= (more [[Replacing text with iedit][info]]) |
| lisp | pink | exclusive to Spacemacs, used to navigate Lisp code and modify it (more [[#editing-lisp-code][info]]) |
| iedit | red | exclusive to Spacemacs, used to navigate between multiple regions of text using =iedit= (more [[#replacing-text-with-iedit][info]]) |
| iedit-insert | red | exclusive to Spacemacs, used to replace multiple regions of text using =iedit= (more [[#replacing-text-with-iedit][info]]) |
Note: Technically speaking there is also the =operator= evil state. Note: Technically speaking there is also the =operator= evil state.
@ -844,7 +854,7 @@ are in =normal= mode by pressing the ~SPC~ leader key, here are a few examples:
The universal argument ~C-u~ is an important command in Emacs but it is also a The universal argument ~C-u~ is an important command in Emacs but it is also a
very handy Vim key binding to scroll up. very handy Vim key binding to scroll up.
Spacemacs binds ~C-u~ to =scroll-up= and change the universal argument binding
Spacemacs binds ~C-u~ to =scroll-up= and changes the universal argument binding
to ~SPC u~. to ~SPC u~.
*Note*: ~SPC u~ is not working before =helm-M-x= (~SPC SPC~). Instead, call *Note*: ~SPC u~ is not working before =helm-M-x= (~SPC SPC~). Instead, call
@ -852,6 +862,9 @@ to ~SPC u~.
pressing ~RETURN~. For instance: ~SPC SPC org-reload C-u RET~ pressing ~RETURN~. For instance: ~SPC SPC org-reload C-u RET~
** Transient-states ** Transient-states
:PROPERTIES:
:CUSTOM_ID: transient-states
:END:
Spacemacs defines a wide variety of =transient states= (temporary overlay maps) Spacemacs defines a wide variety of =transient states= (temporary overlay maps)
where it makes sense. This prevents one from doing repetitive and tedious where it makes sense. This prevents one from doing repetitive and tedious
presses on the ~SPC~ key. presses on the ~SPC~ key.
@ -861,7 +874,7 @@ minibuffer. Additional information may as well be displayed in the minibuffer.
Auto-highlight-symbol transient state: Auto-highlight-symbol transient state:
[[file:img/spacemacs-ahs-transient-state.png]] [[file:img/spacemacs-ahs-transient-state.png]]
[[Text][Text scale transient state]]:
[[#text][Text scale transient state]]:
[[file:img/spacemacs-scale-transient-state.png]] [[file:img/spacemacs-scale-transient-state.png]]
@ -976,7 +989,7 @@ Spacemacs has a minimalistic and distraction free graphical UI:
** Color themes ** Color themes
The official Spacemacs theme is [[https://github.com/nashamri/spacemacs-theme][spacemacs-dark]] and it is the default theme The official Spacemacs theme is [[https://github.com/nashamri/spacemacs-theme][spacemacs-dark]] and it is the default theme
installed when you first started Spacemacs. There are two variants of the installed when you first started Spacemacs. There are two variants of the
theme, a dark one and a light one. Some aspect of these themes can be customized
theme, a dark one and a light one. Some aspects of these themes can be customized
in the function =dotspacemacs/user-init= of your =~/.spacemacs=: in the function =dotspacemacs/user-init= of your =~/.spacemacs=:
- the comment background with the boolean =spacemacs-theme-comment-bg= - the comment background with the boolean =spacemacs-theme-comment-bg=
- the height of org section titles with =spacemacs-theme-org-height= - the height of org section titles with =spacemacs-theme-org-height=
@ -1086,6 +1099,7 @@ and ~T~):
| ~SPC t h h~ | toggle highlight of the current line | | ~SPC t h h~ | toggle highlight of the current line |
| ~SPC t h i~ | toggle highlight indentation levels | | ~SPC t h i~ | toggle highlight indentation levels |
| ~SPC t h c~ | toggle highlight indentation current column | | ~SPC t h c~ | toggle highlight indentation current column |
| ~SPC t h s~ | toggle syntax highlighting |
| ~SPC t i~ | toggle indentation guide at point | | ~SPC t i~ | toggle indentation guide at point |
| ~SPC t l~ | toggle truncate lines | | ~SPC t l~ | toggle truncate lines |
| ~SPC t L~ | toggle visual lines | | ~SPC t L~ | toggle visual lines |
@ -1107,8 +1121,7 @@ and ~T~):
**** Global line numbers **** Global line numbers
Line numbers can be toggled on in all =prog-mode= and =text-mode= buffers by Line numbers can be toggled on in all =prog-mode= and =text-mode= buffers by
setting the =dotspacemacs-line-numbers= variable in your =~/.spacemacs=
to something different than =nil=.
setting the =dotspacemacs-line-numbers= variable in your =~/.spacemacs= to =t=.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-line-numbers t) (setq-default dotspacemacs-line-numbers t)
@ -1120,6 +1133,59 @@ If it is set to =relative=, line numbers are show in a relative way:
(setq-default dotspacemacs-line-numbers 'relative) (setq-default dotspacemacs-line-numbers 'relative)
#+END_SRC #+END_SRC
=dotspacemacs-line-numbers= can also be set to a property list for finer control
over line numbers activation.
Available properties:
| Property | Description |
|-----------------------+----------------------------------------------------------------------------------------------|
| =:disabled-for-modes= | list of major modes where line numbering is inhibited |
| =:enabled-for-modes= | disable for all major modes except those listed. Takes precedence over =:disabled-for-modes= |
| =:relative= | if non-nil, line numbers are relative to the position of the cursor |
| =:size-limit-kb= | size limit in kilobytes after which line numbers are not activated |
Examples:
Disable line numbers in dired-mode, doc-view-mode, markdown-mode, org-mode,
pdf-view-mode, text-mode as well as buffers over 1Mb:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-lines-numbers '(:relative nil
:disabled-for-modes dired-mode
doc-view-mode
markdown-mode
org-mode
pdf-view-mode
text-mode
:size-limit-kb 1000))
#+END_SRC
Relative line numbers only in c-mode and c++ mode with a size limit of =dotspacemacs-large-file-size=:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-lines-numbers '(:relative t
:enabled-for-modes c-mode
c++-mode
:size-limit-kb (* dotspacemacs-large-file-size 1000))
#+END_SRC
Enable line numbers everywhere, except for buffers over 1Mb:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-lines-numbers '(:relative nil
:size-limit-kb 1000))
#+END_SRC
Enable line numbers only in programming modes, except for c-mode and c++ mode:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-lines-numbers '(:relative nil
:enabled-for-modes prog-mode
:disabled-for-modes c-mode c++-mode
:size-limit-kb (* dotspacemacs-large-file-size 1000))
#+END_SRC
** Mode-line ** Mode-line
The mode line is a heavily customized [[https://github.com/milkypostman/powerline][powerline]] with the following capabilities: The mode line is a heavily customized [[https://github.com/milkypostman/powerline][powerline]] with the following capabilities:
- show the window number - show the window number
@ -1152,7 +1218,8 @@ Some elements can be dynamically toggled:
| ~SPC t m M~ | toggle the major mode | | ~SPC t m M~ | toggle the major mode |
| ~SPC t m n~ | toggle the cat! (if =colors= layer is declared in your dotfile) | | ~SPC t m n~ | toggle the cat! (if =colors= layer is declared in your dotfile) |
| ~SPC t m p~ | toggle the point character position | | ~SPC t m p~ | toggle the point character position |
| ~SPC t m t~ | toggle the mode line itself |
| ~SPC t m t~ | toggle the time |
| ~SPC t m T~ | toggle the mode line itself |
| ~SPC t m v~ | toggle the version control info | | ~SPC t m v~ | toggle the version control info |
| ~SPC t m V~ | toggle the new version lighter | | ~SPC t m V~ | toggle the new version lighter |
@ -1265,7 +1332,7 @@ can be reached using the =control= key.
| ~SPC t p~ | =ⓟ= | p | [[https://github.com/Fuco1/smartparens][smartparens]] mode | | ~SPC t p~ | =ⓟ= | p | [[https://github.com/Fuco1/smartparens][smartparens]] mode |
| ~SPC t C-p~ | =ⓟ= | p | global smartparens | | ~SPC t C-p~ | =ⓟ= | p | global smartparens |
| ~SPC t s~ | =ⓢ= | s | syntax checking (flycheck) | | ~SPC t s~ | =ⓢ= | s | syntax checking (flycheck) |
| ~SPC t S~ | =Ⓢ= | S | enabled in [[../layers/spell-checking][spell checking layer]] (flyspell) |
| ~SPC t S~ | =Ⓢ= | S | enabled in [[file:../layers/+checkers/spell-checking/README.org][spell checking layer]] (flyspell) |
| ~SPC t w~ | =ⓦ= | w | whitespace mode | | ~SPC t w~ | =ⓦ= | w | whitespace mode |
| ~SPC t C-w~ | =ⓦ= | w | global whitespace | | ~SPC t C-w~ | =ⓦ= | w | global whitespace |
| ~SPC t W~ | =Ⓦ= | W | automatic whitespace cleanup (see =dotspacemacs-whitespace-cleanup=) | | ~SPC t W~ | =Ⓦ= | W | automatic whitespace cleanup (see =dotspacemacs-whitespace-cleanup=) |
@ -1375,8 +1442,8 @@ Press ~?~ to toggle the full help.
|-------------------+------------------------------------------------------------| |-------------------+------------------------------------------------------------|
| ~SPC l~ | activate the transient- state | | ~SPC l~ | activate the transient- state |
| ~?~ | toggle the documentation | | ~?~ | toggle the documentation |
| ~[1..9, 0]~ | switch to nth layout |
| ~[C-1..C-9, C-0]~ | switch to nth layout and keep the transient state active |
| ~[0..9]~ | switch to nth layout |
| ~[C-0..C-9]~ | switch to nth layout and keep the transient state active |
| ~<tab>~ | switch to the latest layout | | ~<tab>~ | switch to the latest layout |
| ~a~ | add a buffer to the current layout | | ~a~ | add a buffer to the current layout |
| ~A~ | add all the buffers from another layout in the current one | | ~A~ | add all the buffers from another layout in the current one |
@ -1430,8 +1497,8 @@ Press ~?~ to toggle the full help.
|-------------------+-------------------------------------------------------------| |-------------------+-------------------------------------------------------------|
| ~SPC l w~ | activate the transient state | | ~SPC l w~ | activate the transient state |
| ~?~ | toggle the documentation | | ~?~ | toggle the documentation |
| ~[1..9, 0]~ | switch to nth workspace |
| ~[C-1..C-9, C-0]~ | switch to nth workspace and keep the transient state active |
| ~[0..9]~ | switch to nth workspace |
| ~[C-0..C-9]~ | switch to nth workspace and keep the transient state active |
| ~TAB~ | switch to last active workspace | | ~TAB~ | switch to last active workspace |
| ~d~ | close current workspace | | ~d~ | close current workspace |
| ~n~ or ~l~ | switch to next workspace | | ~n~ or ~l~ | switch to next workspace |
@ -1444,7 +1511,7 @@ There are also some handy globally available key bindings related to workspaces:
| Key Binding | Description | | Key Binding | Description |
|-------------+--------------------------------------| |-------------+--------------------------------------|
| ~gt~ | go to next workspace | | ~gt~ | go to next workspace |
| ~gT~ | got to previous workspace |
| ~gT~ | go to previous workspace |
| ~SPC b W~ | go to workspace and window by buffer | | ~SPC b W~ | go to workspace and window by buffer |
* Commands * Commands
@ -1554,7 +1621,10 @@ If you find yourself unable to return focus to Helm (after a careless
mouse-click for example), use ~SPC w b~ to return focus to the minibuffer. mouse-click for example), use ~SPC w b~ to return focus to the minibuffer.
**** Helm transient state **** Helm transient state
Spacemacs defines a [[Transient-states][transient state]] for =Helm= to make it work like [[https://github.com/Shougo/unite.vim][Vim's Unite]]
:PROPERTIES:
:CUSTOM_ID: helm-transient-state
:END:
Spacemacs defines a [[#transient-states][transient state]] for =Helm= to make it work like [[https://github.com/Shougo/unite.vim][Vim's Unite]]
plugin. plugin.
Initiate the transient state with ~M-SPC~ or ~s-M-SPC~ while in a =Helm= buffer. Initiate the transient state with ~M-SPC~ or ~s-M-SPC~ while in a =Helm= buffer.
@ -1585,6 +1655,19 @@ Initiate the transient state with ~M-SPC~ or ~s-M-SPC~ while in a =Helm= buffer.
| ~T~ | mark all candidates | | ~T~ | mark all candidates |
| ~v~ | execute persistent action | | ~v~ | execute persistent action |
*** Ivy
If you choose =ivy= as completion system, make sure to read [[http://oremacs.com/swiper/][official manual]]. In
case you don't want to read everything, at least familiarise with [[http://oremacs.com/swiper/#minibuffer-key-bindings][minibuffer key
bindings]]. Some useful key bindings are presented in following table.
| Key Binding | Description |
|----------------+------------------------------------------------------------------------------------------------------|
| ~C-m~ or ~RET~ | call default action on current candidate |
| ~M-o~ | show the list of valid actions on current candidate (then press any of described keys to execute it) |
| ~C-M-m~ | the same as ~RET~ but doesn't close completion minibuffer |
| ~C-M-o~ | the same as ~M-o~ but doesn't close completion minibuffer |
| ~C-'~ | use avy to quickly select completion on current page (sometimes faster than using arrows) |
** Discovering ** Discovering
*** Key bindings *** Key bindings
**** Which-key **** Which-key
@ -1713,7 +1796,7 @@ Spacemacs.
*** Toggles *** Toggles
=helm-spacemacs-help= is also a central place to discover the available toggles. =helm-spacemacs-help= is also a central place to discover the available toggles.
To display only the toggles source press ~C-l~ (or in [[Helm transient state][Helm transient state]] you can
To display only the toggles source press ~C-l~ (or in [[#helm-transient-state][Helm transient state]] you can
press just ~l~). press just ~l~).
The following helm actions are available on packages: The following helm actions are available on packages:
@ -1860,8 +1943,9 @@ Windows manipulation commands (start with ~w~):
| Key Binding | Description | | Key Binding | Description |
|------------------------+-----------------------------------------------------------------------------| |------------------------+-----------------------------------------------------------------------------|
| ~SPC w TAB~ | switch to alternate window in the current frame (switch back and forth) |
| ~SPC w =~ | balance split windows | | ~SPC w =~ | balance split windows |
| ~SPC w b~ | force the focus back to the minibuffer (usefull with =helm= popups) |
| ~SPC w b~ | force the focus back to the minibuffer (useful with =helm= popups) |
| ~SPC w c~ | maximize/minimize a window and center it | | ~SPC w c~ | maximize/minimize a window and center it |
| ~SPC w C~ | maximize/minimize a window and center it using [[https://github.com/abo-abo/ace-window][ace-window]] | | ~SPC w C~ | maximize/minimize a window and center it using [[https://github.com/abo-abo/ace-window][ace-window]] |
| ~SPC w d~ | delete a window | | ~SPC w d~ | delete a window |
@ -1993,10 +2077,13 @@ the opened buffer and kill them.
| Any other key | leave the transient state | | Any other key | leave the transient state |
**** Special Buffers **** Special Buffers
:PROPERTIES:
:CUSTOM_ID: special-buffers
:END:
Unlike vim, emacs creates many buffers that most people do not need to see. Some Unlike vim, emacs creates many buffers that most people do not need to see. Some
examples are =*Messages*= and =*Compile-Log*=. Spacemacs tries to automatically examples are =*Messages*= and =*Compile-Log*=. Spacemacs tries to automatically
ignore buffers that are not useful. However, you may want to change the way ignore buffers that are not useful. However, you may want to change the way
Spacemacs marks buffers as useful. For instructions, see the [[file:FAQ.org::Change%20special%20buffer%20rules?][special buffer howto]].
Spacemacs marks buffers as useful. For instructions, see the [[file:FAQ.org::#change-special-buffer-rules][special buffer howto]].
**** Files manipulations key bindings **** Files manipulations key bindings
Files manipulation commands (start with ~f~): Files manipulation commands (start with ~f~):
@ -2080,7 +2167,7 @@ Basic =ido= operations can be done with ~Ctrl~ key:
| ~C-S-l~ | go to next directory | | ~C-S-l~ | go to next directory |
*** Ido transient state *** Ido transient state
Spacemacs defines a [[Transient-states][transient state]] for =ido=.
Spacemacs defines a [[#transient-states][transient state]] for =ido=.
Initiate the transient state with ~M-SPC~ or ~s-M-SPC~ while in an =ido= buffer. Initiate the transient state with ~M-SPC~ or ~s-M-SPC~ while in an =ido= buffer.
@ -2156,6 +2243,7 @@ open the file in a split window with ~|~ and ~-~:
|-------------+---------------------------------| |-------------+---------------------------------|
| ~TAB~ | toggle stretching of the buffer | | ~TAB~ | toggle stretching of the buffer |
| ~c~ | create a node | | ~c~ | create a node |
| ~C~ | copy a node |
| ~d~ | delete a node | | ~d~ | delete a node |
| ~gr~ | refresh | | ~gr~ | refresh |
| ~s~ | toggle showing of hidden files | | ~s~ | toggle showing of hidden files |
@ -2263,7 +2351,7 @@ OpenDocument, and Microsoft Office documents.
*** Frequency of auto-saving *** Frequency of auto-saving
By default auto-saving of files is performed every 300 characters and By default auto-saving of files is performed every 300 characters and
every 30 seconds of idle time which can be changed by setting to a every 30 seconds of idle time which can be changed by setting to a
new value the variables =auto-save-inteval= and =auto-save-timeout=
new value the variables =auto-save-interval= and =auto-save-timeout=
respectively. respectively.
*** Location of auto-saved files *** Location of auto-saved files
@ -2392,6 +2480,9 @@ bindings (~SPC e n~ and ~SPC e p~) as well as the error transient state (~SPC e~
| ~SPC s t F~ | =pt= with default text | | ~SPC s t F~ | =pt= with default text |
**** Searching in a project **** Searching in a project
:PROPERTIES:
:CUSTOM_ID: searching-in-a-project
:END:
| Key Binding | Description | | Key Binding | Description |
|-----------------------+-----------------------------------------------------| |-----------------------+-----------------------------------------------------|
@ -2480,7 +2571,7 @@ Where =<M> [x/y]*= is:
With [[https://github.com/bling/evil-visualstar][evil-visualstar]] you can search for the next occurrence of the current With [[https://github.com/bling/evil-visualstar][evil-visualstar]] you can search for the next occurrence of the current
selection. selection.
It is pretty useful combined with the [[Region selection][expand-region]] bindings.
It is pretty useful combined with the [[#expand-region][expand-region]] bindings.
*Note*: If the current state is not the =visual state= then pressing ~*~ uses *Note*: If the current state is not the =visual state= then pressing ~*~ uses
auto-highlight-symbol and its transient state. auto-highlight-symbol and its transient state.
@ -2546,7 +2637,7 @@ Text related commands (start with ~x~):
| ~SPC x a ;~ | align region at ; | | ~SPC x a ;~ | align region at ; |
| ~SPC x a =~ | align region at = | | ~SPC x a =~ | align region at = |
| ~SPC x a a~ | align region (or guessed section) using default rules | | ~SPC x a a~ | align region (or guessed section) using default rules |
| ~SPC x a c~ | align current intendation region using default rules |
| ~SPC x a c~ | align current indentation region using default rules |
| ~SPC x a r~ | align region using user-specified regexp | | ~SPC x a r~ | align region using user-specified regexp |
| ~SPC x a m~ | align region at arithmetic operators (+-*/) | | ~SPC x a m~ | align region at arithmetic operators (+-*/) |
| ~SPC x a ¦~ | align region at ¦ | | ~SPC x a ¦~ | align region at ¦ |
@ -2562,6 +2653,7 @@ Text related commands (start with ~x~):
| ~SPC x j r~ | set the justification to right | | ~SPC x j r~ | set the justification to right |
| ~SPC x J~ | move down a line of text (enter transient state) | | ~SPC x J~ | move down a line of text (enter transient state) |
| ~SPC x K~ | move up a line of text (enter transient state) | | ~SPC x K~ | move up a line of text (enter transient state) |
| ~SPC x l d~ | duplicate line or region |
| ~SPC x l s~ | sort lines | | ~SPC x l s~ | sort lines |
| ~SPC x l u~ | uniquify lines | | ~SPC x l u~ | uniquify lines |
| ~SPC x o~ | use avy to select a link in the frame and open it | | ~SPC x o~ | use avy to select a link in the frame and open it |
@ -2604,6 +2696,9 @@ It is possible to enable it easily for /all programming modes/ with the variable
*** Zooming *** Zooming
**** Text **** Text
:PROPERTIES:
:CUSTOM_ID: text
:END:
The font size of the current buffer can be adjusted with the commands: The font size of the current buffer can be adjusted with the commands:
| Key Binding | Description | | Key Binding | Description |
@ -2654,10 +2749,10 @@ In transient state:
| Any other key | leave the transient state | | Any other key | leave the transient state |
*Tips:* you can increase or decrease a value by more that once by using a prefix *Tips:* you can increase or decrease a value by more that once by using a prefix
argument (ie. ~10 SPC n +~ will add 10 to the number under point).
argument (i.e. ~10 SPC n +~ will add 10 to the number under point).
*** Spell checking *** Spell checking
Spell checking is enabled by including the [[../layers/spell-checking][spell
Spell checking is enabled by including the [[file:../layers/+checkers/spell-checking/README.org][spell
checking]] layer in your dotfile. checking]] layer in your dotfile.
Keybindings are listed in the layer documentation. Keybindings are listed in the layer documentation.
@ -2666,6 +2761,9 @@ Keybindings are listed in the layer documentation.
Vi =Visual= modes are all supported by =evil=. Vi =Visual= modes are all supported by =evil=.
**** Expand-region **** Expand-region
:PROPERTIES:
:CUSTOM_ID: expand-region
:END:
Spacemacs adds another =Visual= mode via the [[https://github.com/magnars/expand-region.el][expand-region]] mode. Spacemacs adds another =Visual= mode via the [[https://github.com/magnars/expand-region.el][expand-region]] mode.
| Key Binding | Description | | Key Binding | Description |
@ -2699,14 +2797,17 @@ There are also ~a~ variants that include whitespace. Example (=|= indicates poin
The displayed text of a buffer can be narrowed with the commands (start with The displayed text of a buffer can be narrowed with the commands (start with
~n~): ~n~):
| Key Binding | Description |
|-------------+-------------------------------------------|
| ~SPC n f~ | narrow the buffer to the current function |
| ~SPC n p~ | narrow the buffer to the visible page |
| ~SPC n r~ | narrow the buffer to the selected text |
| ~SPC n w~ | widen, i.e show the whole buffer again |
| Key Binding | Description |
|-------------+--------------------------------------------|
| ~SPC n f~ | narrow the buffer to the current function |
| ~SPC n p~ | narrow the buffer to the visible page |
| ~SPC n r~ | narrow the buffer to the selected text |
| ~SPC n w~ | widen, i.e. show the whole buffer again |
*** Replacing text with iedit *** Replacing text with iedit
:PROPERTIES:
:CUSTOM_ID: replacing-text-with-iedit
:END:
Spacemacs uses the powerful [[https://github.com/tsdh/iedit][iedit]] mode through [[https://github.com/syl20bnr/evil-iedit-state][evil-iedit-state]] to quickly Spacemacs uses the powerful [[https://github.com/tsdh/iedit][iedit]] mode through [[https://github.com/syl20bnr/evil-iedit-state][evil-iedit-state]] to quickly
edit multiple occurrences of a symbol or selection. edit multiple occurrences of a symbol or selection.
@ -2824,7 +2925,7 @@ Comments are handled by [[https://github.com/redguardtoo/evil-nerd-commenter][ev
| ~SPC c y~ | comment and yank | | ~SPC c y~ | comment and yank |
| ~SPC c Y~ | invert comment and yank | | ~SPC c Y~ | invert comment and yank |
*Tips:* To comment efficiently a block of line use the combo ~SPC ; SPC y~
*Tips:* To comment efficiently a block of line use the combo ~SPC ; SPC j l~
*** Regular expressions *** Regular expressions
Spacemacs uses the packages [[https://github.com/joddie/pcre2el][pcre2el]] to manipulate regular expressions. It is Spacemacs uses the packages [[https://github.com/joddie/pcre2el][pcre2el]] to manipulate regular expressions. It is
@ -2868,6 +2969,9 @@ To disable the trash you can set the variable =delete-by-moving-to-trash= to
=nil= in your =~/.spacemacs=. =nil= in your =~/.spacemacs=.
*** Editing Lisp code *** Editing Lisp code
:PROPERTIES:
:CUSTOM_ID: editing-lisp-code
:END:
Editing of lisp code is provided by [[https://github.com/syl20bnr/evil-lisp-state][evil-lisp-state]]. Editing of lisp code is provided by [[https://github.com/syl20bnr/evil-lisp-state][evil-lisp-state]].
Commands will set the current state to =lisp state= where different commands Commands will set the current state to =lisp state= where different commands
@ -2968,7 +3072,7 @@ are defined implicitly, for instance the root of a project is found when a
=Helm= is used whenever it is possible. =Helm= is used whenever it is possible.
To search in a project see [[Searching in a project][project searching]].
To search in a project see [[#searching-in-a-project][project searching]].
=projectile= commands start with p: =projectile= commands start with p:
@ -2986,7 +3090,7 @@ To search in a project see [[Searching in a project][project searching]].
| ~SPC p f~ | find file | | ~SPC p f~ | find file |
| ~SPC p F~ | find file based on path around point | | ~SPC p F~ | find file based on path around point |
| ~SPC p g~ | find tags | | ~SPC p g~ | find tags |
| ~SPC p C-g~ | regenerate the project's =etags= / =gtags= |
| ~SPC p G~ | regenerate the project's =etags= / =gtags= |
| ~SPC p h~ | find file using =helm= | | ~SPC p h~ | find file using =helm= |
| ~SPC p I~ | invalidate the projectile cache | | ~SPC p I~ | invalidate the projectile cache |
| ~SPC p k~ | kill all project buffers | | ~SPC p k~ | kill all project buffers |
@ -2998,7 +3102,7 @@ To search in a project see [[Searching in a project][project searching]].
| ~SPC p T~ | test project | | ~SPC p T~ | test project |
| ~SPC p v~ | open project root in =vc-dir= or =magit= | | ~SPC p v~ | open project root in =vc-dir= or =magit= |
| ~SPC /~ | search in project with the best search tool available | | ~SPC /~ | search in project with the best search tool available |
| ~SPC s p~ | see [[Searching in a project][search in project]] |
| ~SPC s p~ | see [[#searching-in-a-project][searching in a project]] |
| ~SPC s a p~ | run =ag= | | ~SPC s a p~ | run =ag= |
| ~SPC s g p~ | run =grep= | | ~SPC s g p~ | run =grep= |
| ~SPC s k p~ | run =ack= | | ~SPC s k p~ | run =ack= |
@ -3204,6 +3308,7 @@ with ~SPC SPC spacemacs/recompile-elpa~.
| 7000th star!!!!!!! | [[https://github.com/mukhali][mukhali]] | | 7000th star!!!!!!! | [[https://github.com/mukhali][mukhali]] |
| 8000th star!!!!!!!! | [[https://github.com/shsteven][shsteven]] | | 8000th star!!!!!!!! | [[https://github.com/shsteven][shsteven]] |
| 9000th star!!!!!!!!! | [[https://github.com/deb0ch][deb0ch]] | | 9000th star!!!!!!!!! | [[https://github.com/deb0ch][deb0ch]] |
| 10000th star :star: | [[https://github.com/colt365][colt365]] |
** Gitter chat ** Gitter chat


+ 7
- 1
emacs.d/doc/FAQ.org View File

@ -206,7 +206,7 @@ change your terminal color palette. More explanations can be found on
This is a feature of Spacemacs, enabling you to easily escape from a lot of This is a feature of Spacemacs, enabling you to easily escape from a lot of
situations, like escaping from =insert state= to =normal state=. situations, like escaping from =insert state= to =normal state=.
The sequence of characters used can be customized. See the [[http://spacemacs.org/doc/DOCUMENTATION.html#orgheadline78][documentation]] for
The sequence of characters used can be customized. See the [[http://spacemacs.org/doc/DOCUMENTATION.html#escaping][documentation]] for
more information. more information.
If you don't like this feature, you can deactivate it by adding =evil-escape= to If you don't like this feature, you can deactivate it by adding =evil-escape= to
@ -263,6 +263,9 @@ the list =dotspacemacs-excluded-packages= if you prefer setting =exec-path=
yourself. yourself.
* How do I: * How do I:
:PROPERTIES:
:CUSTOM_ID: how-do-i
:END:
** Install a package not provided by a layer? ** Install a package not provided by a layer?
Spacemacs provides a variable in the =dotspacemacs/layers= function in Spacemacs provides a variable in the =dotspacemacs/layers= function in
=.spacemacs= called =dotspacemacs-additional-packages=. Just add a package name =.spacemacs= called =dotspacemacs-additional-packages=. Just add a package name
@ -301,6 +304,9 @@ dotfile. The following snippet disables company for =python-mode=:
#+END_SRC #+END_SRC
** Change special buffer rules? ** Change special buffer rules?
:PROPERTIES:
:CUSTOM_ID: change-special-buffer-rules
:END:
To change the way spacemacs marks buffers as useless, you can customize To change the way spacemacs marks buffers as useless, you can customize
=spacemacs-useless-buffers-regexp= which marks buffers matching the regexp as =spacemacs-useless-buffers-regexp= which marks buffers matching the regexp as
useless. The variable =spacemacs-useful-buffers-regexp= marks buffers matching useless. The variable =spacemacs-useful-buffers-regexp= marks buffers matching


+ 12
- 5
emacs.d/doc/LAYERS.org View File

@ -275,6 +275,9 @@ Use-package supports heaps of useful keywords. Look at the [[https://github.com/
more. more.
* Anatomy of a layer * Anatomy of a layer
:PROPERTIES:
:CUSTOM_ID: anatomy-of-a-layer
:END:
A layer is simply a folder somewhere in Spacemacs' layer search path that A layer is simply a folder somewhere in Spacemacs' layer search path that
usually contains these files (listed in loading order). usually contains these files (listed in loading order).
@ -397,10 +400,11 @@ More on this in the next section.
* The Spacemacs loading process * The Spacemacs loading process
The Spacemacs loading process can be summarized as follows: The Spacemacs loading process can be summarized as follows:
1. Spacemacs goes through all the enabled layers and evaluates their files. The
changes introduced by =config.el= are thus applied, then =funcs.el= and
=packages.el= are loaded, but nothing happens from =packages.el=, since these
files only define functions and variables.
1. Spacemacs goes through all the enabled layers and evaluates their files.
First =layers.el= is loaded to declare layer dependencies. Then =packages.el=
and =funcs.el= are loaded, but nothing happens from them since these files
only define functions and variables, then the changes introduced by
=config.el= are applied.
2. Spacemacs checks which packages should be downloaded and installed. To be 2. Spacemacs checks which packages should be downloaded and installed. To be
installed, a package must be installed, a package must be
- included by a layer that the user has enabled, - included by a layer that the user has enabled,
@ -477,7 +481,7 @@ by using =post-init= functions.
For layers that require another layers to be enabled, use the functions For layers that require another layers to be enabled, use the functions
=configuration-layer/declare-layer= and =configuration-layer/declare-layers= to =configuration-layer/declare-layer= and =configuration-layer/declare-layers= to
ensure that layers are enabled even if the user has not enabled them explicitly. ensure that layers are enabled even if the user has not enabled them explicitly.
Calls to these functions must go in the =config.el= file.
Calls to these functions must go in the =layers.el= file.
** Use-package ** Use-package
In the vast majority of cases, a package =init= function should do nothing but In the vast majority of cases, a package =init= function should do nothing but
@ -498,6 +502,9 @@ hooks, if the package should be loaded upon some event. It is not unusual to
have both! have both!
** Use-package hooks ** Use-package hooks
:PROPERTIES:
:CUSTOM_ID: use-package-hooks
:END:
Spacemacs includes a macro for adding more code to the =:init= or =:config= Spacemacs includes a macro for adding more code to the =:init= or =:config=
blocks of a call to =use-package=, after the fact. This is useful for =pre-init= blocks of a call to =use-package=, after the fact. This is useful for =pre-init=
or =post-init= functions to "inject" code into the =use-package= call of the or =post-init= functions to "inject" code into the =use-package= call of the


+ 3
- 3
emacs.d/doc/QUICK_START.org View File

@ -80,8 +80,8 @@ dotspacemacs-configuration-layers '(auto-completion
At anytime you can apply the changes made to the dotfile or layers At anytime you can apply the changes made to the dotfile or layers
_without restarting_ Spacemacs by pressing ~SPC f e R~. _without restarting_ Spacemacs by pressing ~SPC f e R~.
The [[file:../core/templates/.spacemacs.template][dotfile template]] contain further information about how to customize
Spacemacs. See the dotfile configuration section of the [[file:DOCUMENTATION.org][documentation]] for
The [[https://github.com/syl20bnr/spacemacs/blob/master/core/templates/.spacemacs.template][dotfile template]] contains further information about how to customize
Spacemacs. See the dotfile configuration section of the [[file:DOCUMENTATION.org::#dotfile-configuration][documentation]] for
more details. more details.
* Dotdirectory (~/.spacemacs.d) * Dotdirectory (~/.spacemacs.d)
@ -174,4 +174,4 @@ about functions, variables, modes etc. These commands are bound thusly:
| ~SPC h d v~ | describe-variable | | ~SPC h d v~ | describe-variable |
* How-To's * How-To's
Some quick =how-to's= are compiled in the [[file:FAQ.org::How%20do%20I...][FAQ.org]] file.
Some quick =how-to's= are compiled in the [[file:FAQ.org::#how-do-i][FAQ.]]

+ 28
- 13
emacs.d/doc/VIMUSERS.org View File

@ -60,7 +60,7 @@ for new users. This section attempts to clear up any confusion.
*** Modes vs. States *** Modes vs. States
In vim you have various editing modes like =insert mode= and =visual mode= to In vim you have various editing modes like =insert mode= and =visual mode= to
manipulate text. In Emacs, we have [[./DOCUMENTATION.org#states][states]]. These are equivalent to vim modes.
manipulate text. In Emacs, we have [[file:DOCUMENTATION.org::#states][states]]. These are equivalent to vim modes.
For example, =evil-insert-state= is the same as =insert-mode= in vim. For example, =evil-insert-state= is the same as =insert-mode= in vim.
A =minor-mode= in Emacs is like a feature that is activated. For example, A =minor-mode= in Emacs is like a feature that is activated. For example,
@ -79,8 +79,8 @@ several packages that integrate well with each other. For example, the =python=
layer includes support for auto-completion, documentation look-up, tests, and layer includes support for auto-completion, documentation look-up, tests, and
much more by using several different packages. This keeps you from thinking much more by using several different packages. This keeps you from thinking
about what packages to install, and instead worry about what features you want. about what packages to install, and instead worry about what features you want.
More information on layers can be found in the [[./VIMUSERS.org#customization][customization]] section and in the
[[./DOCUMENTATION.org#configuration-layers][documentation]]. There is also a more in-depth guide on writing layers [[file:LAYERS.org][here]].
More information on layers can be found in the [[#customization][customization]] section and in the
[[file:DOCUMENTATION.org::#configuration-layers][documentation]]. There is also a more in-depth guide on writing layers [[file:LAYERS.org][here]].
*** Transient-states *** Transient-states
Spacemacs provides a special functionality called transient-states. Transient-states Spacemacs provides a special functionality called transient-states. Transient-states
@ -99,7 +99,7 @@ Spacemacs uses ~SPC~ as its ~<Leader>~ key. This document will use ~SPC~ to refe
the ~<Leader>~ key. All keybindings are mnemonic and are organized under the the ~<Leader>~ key. All keybindings are mnemonic and are organized under the
~<Leader>~ key. For example, the keybindings for language-specific commands are ~<Leader>~ key. For example, the keybindings for language-specific commands are
always under the ~SPC m~ prefix. A full list of conventions used in Spacemacs is always under the ~SPC m~ prefix. A full list of conventions used in Spacemacs is
[[./CONVENTIONS.org][here]]. Note that all keybindings can be changed.
[[file:CONVENTIONS.org][here]]. Note that all keybindings can be changed.
Spacemacs uses [[https://github.com/justbur/emacs-which-key][which-key]] to show available keybindings after a delay: Spacemacs uses [[https://github.com/justbur/emacs-which-key][which-key]] to show available keybindings after a delay:
@ -124,17 +124,20 @@ are located under the ~SPC b~ prefix.
|---------------------------+------------------------------------------------------| |---------------------------+------------------------------------------------------|
| ~SPC b b <buffer-name>~ | Create a buffer named =<buffer-name>=. | | ~SPC b b <buffer-name>~ | Create a buffer named =<buffer-name>=. |
| ~SPC b b~ | Search through open buffers and recent files. | | ~SPC b b~ | Search through open buffers and recent files. |
| ~SPC b n~ or ~:bnext~ | Switch to the next buffer. (See [[*Special%20buffers][Special buffers]]) |
| ~SPC b p~ or ~:bprevious~ | Switch to the previous buffer. (See [[*Special%20buffers][Special buffers]]) |
| ~SPC b n~ or ~:bnext~ | Switch to the next buffer. (See [[#special-buffers][Special buffers]]) |
| ~SPC b p~ or ~:bprevious~ | Switch to the previous buffer. (See [[#special-buffers][Special buffers]]) |
| ~SPC b d~ or ~:bdelete~ | Kill current buffer. | | ~SPC b d~ or ~:bdelete~ | Kill current buffer. |
| ~SPC b C-d~ | Kill buffers using a regular expression. | | ~SPC b C-d~ | Kill buffers using a regular expression. |
| ~SPC b m~ | Kill all buffers except the current buffer. | | ~SPC b m~ | Kill all buffers except the current buffer. |
| ~SPC b .~ | Buffer transient-state. | | ~SPC b .~ | Buffer transient-state. |
**** Special buffers **** Special buffers
:PROPERTIES:
:CUSTOM_ID: special-buffers
:END:
By default Emacs creates a lot of buffers that most people will never need, like By default Emacs creates a lot of buffers that most people will never need, like
=*Messages*=. Spacemacs automatically ignores these when using these =*Messages*=. Spacemacs automatically ignores these when using these
key bindings. More information can be found [[./DOCUMENTATION.org#special-buffers][here]].
key bindings. More information can be found [[file:DOCUMENTATION.org::#special-buffers][here]].
*** Windows *** Windows
Windows are like splits in vim. They are useful for editing multiple files at Windows are like splits in vim. They are useful for editing multiple files at
@ -187,6 +190,9 @@ explore:
| ~SPC ?~ | Lists all keybindings. | | ~SPC ?~ | Lists all keybindings. |
* Customization * Customization
:PROPERTIES:
:CUSTOM_ID: customization
:END:
** The .spacemacs file ** The .spacemacs file
When you first start spacemacs, you will be prompted to choose an editing style. When you first start spacemacs, you will be prompted to choose an editing style.
If you are reading this, you likely want to choose the vim style. A =.spacemacs= If you are reading this, you likely want to choose the vim style. A =.spacemacs=
@ -286,6 +292,9 @@ Here is an example of a function that is useful in real life:
#+end_src #+end_src
** Activating a Layer ** Activating a Layer
:PROPERTIES:
:CUSTOM_ID: activating-a-layer
:END:
As said in the terms section, layers provide an easy way to add features. As said in the terms section, layers provide an easy way to add features.
Activating a layer is done in the =.spacemacs= file. In the file search for the Activating a layer is done in the =.spacemacs= file. In the file search for the
=dotspacemacs-configuration-layers= variable. By default, it should look like =dotspacemacs-configuration-layers= variable. By default, it should look like
@ -358,16 +367,16 @@ execute code before or after a package loads. It would look like this:
**Note**: Only one layer can have a =init= function for a package. If you want **Note**: Only one layer can have a =init= function for a package. If you want
to override the configuration of a package in another layer, use a to override the configuration of a package in another layer, use a
=<layer-name>/pre-init= function in addition to [[file:LAYERS.org#use-package-hooks][use-package hooks]].
=<layer-name>/pre-init= function in addition to [[file:LAYERS.org::#use-package-hooks][use-package hooks]].
If a package is not available on MELPA, you must use a local package or a If a package is not available on MELPA, you must use a local package or a
package recipe. For more details see [[file:LAYERS.org#anatomy-of-a-layer][anatomy of a layer]].
package recipe. For more details see [[file:LAYERS.org::#anatomy-of-a-layer][anatomy of a layer]].
Make sure you [[Activating a Layer][add]] your layer to your =.spacemacs= file and restart to
Make sure you [[#activating-a-layer][add]] your layer to your =.spacemacs= file and restart to
activate it. activate it.
A detailed description of the loading process and how layers work can be found in A detailed description of the loading process and how layers work can be found in
[[file:LAYERS.org][LAYERS.org]].
the [[file:LAYERS.org][configuration layers documentation.]]
** Installing a single package ** Installing a single package
Sometimes creating a layer is a bit overkill. Maybe you just want one package Sometimes creating a layer is a bit overkill. Maybe you just want one package
@ -375,9 +384,12 @@ and don't want to maintain a whole layer. Spacemacs provides a variable in the
=dotspacemacs/layers= function in =.spacemacs= called =dotspacemacs/layers= function in =.spacemacs= called
=dotspacemacs-additional-packages=. Just add a package name to the list and it =dotspacemacs-additional-packages=. Just add a package name to the list and it
will be installed when you restart. Loading the package is covered in the next will be installed when you restart. Loading the package is covered in the next
[[Loading packages][section]].
[[#loading-packages][section]].
** Loading packages ** Loading packages
:PROPERTIES:
:CUSTOM_ID: loading-packages
:END:
Ever wonder how Spacemacs can load over a 100 packages in just a few seconds? Ever wonder how Spacemacs can load over a 100 packages in just a few seconds?
Such low loading times must require some kind of unreadable black magic that no Such low loading times must require some kind of unreadable black magic that no
one can understand. Thanks to [[https://github.com/jwiegley/use-package][use-package]], this is not true. It is a package one can understand. Thanks to [[https://github.com/jwiegley/use-package][use-package]], this is not true. It is a package
@ -410,6 +422,9 @@ This is just a very basic overview of =use-package=. There are many other ways
to control how a package loads using it that aren't covered here. to control how a package loads using it that aren't covered here.
** Uninstalling a package ** Uninstalling a package
:PROPERTIES:
:CUSTOM_ID: uninstalling-a-package
:END:
Spacemacs provides a variable in the =dotspacemacs/init= function in Spacemacs provides a variable in the =dotspacemacs/init= function in
=.spacemacs= called =dotspacemacs-excluded-packages=. Just add a package name to =.spacemacs= called =dotspacemacs-excluded-packages=. Just add a package name to
the list and it will be uninstalled when you restart. the list and it will be uninstalled when you restart.
@ -457,7 +472,7 @@ when you are not navigating between them. You can use ~SPC s c~ or ~:nohlsearch~
to disable search result highlighting. to disable search result highlighting.
To disable the result highlighting when it is not needed anymore automatically, To disable the result highlighting when it is not needed anymore automatically,
you can [[Uninstalling a package][uninstall]] the =evil-search-highlight-persist= package.
you can [[#uninstalling-a-package][uninstall]] the =evil-search-highlight-persist= package.
*** Sessions *** Sessions
Spacemacs does not automatically restore your windows and buffers when you Spacemacs does not automatically restore your windows and buffers when you


+ 6
- 7
emacs.d/init.el View File

@ -1,6 +1,6 @@
;;; init.el --- Spacemacs Initialization File ;;; init.el --- Spacemacs Initialization File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -16,20 +16,19 @@
;; lower value in your dotfile (function `dotspacemacs/user-config') ;; lower value in your dotfile (function `dotspacemacs/user-config')
(setq gc-cons-threshold 100000000) (setq gc-cons-threshold 100000000)
(defconst spacemacs-version "0.200.7" "Spacemacs version.")
(defconst spacemacs-version "0.200.9" "Spacemacs version.")
(defconst spacemacs-emacs-min-version "24.4" "Minimal version of Emacs.") (defconst spacemacs-emacs-min-version "24.4" "Minimal version of Emacs.")
(if (not (version<= spacemacs-emacs-min-version emacs-version)) (if (not (version<= spacemacs-emacs-min-version emacs-version))
(message (concat "Your version of Emacs (%s) is too old. "
"Spacemacs requires Emacs version %s or above.")
emacs-version spacemacs-emacs-min-version)
(error (concat "Your version of Emacs (%s) is too old. "
"Spacemacs requires Emacs version %s or above.")
emacs-version spacemacs-emacs-min-version)
(load-file (concat (file-name-directory load-file-name) (load-file (concat (file-name-directory load-file-name)
"core/core-load-paths.el")) "core/core-load-paths.el"))
(require 'core-spacemacs) (require 'core-spacemacs)
(spacemacs/init) (spacemacs/init)
(spacemacs/maybe-install-dotfile)
(configuration-layer/sync) (configuration-layer/sync)
(spacemacs-buffer/display-info-box)
(spacemacs-buffer/display-startup-note)
(spacemacs/setup-startup-hook) (spacemacs/setup-startup-hook)
(require 'server) (require 'server)
(unless (server-running-p) (server-start))) (unless (server-running-p) (server-start)))

+ 1
- 1
emacs.d/layers/+chat/erc/README.org View File

@ -18,7 +18,7 @@ Layer for [[http://www.emacswiki.org/emacs/ERC][ERC IRC chat]].
* Features * Features
- Highlight nicks (using [[https://github.com/leathekd/erc-hl-nicks][erc-hl-nicks]]) - Highlight nicks (using [[https://github.com/leathekd/erc-hl-nicks][erc-hl-nicks]])
- Image inline support (using [[https://github.com/kidd/erc-image.el][erc-image]]) - Image inline support (using [[https://github.com/kidd/erc-image.el][erc-image]])
- Logging to ~/.emacs.d/.cache/erc-logs and ViewLogMode for viewing logs
- Logging to =~/.emacs.d/.cache/erc-logs= and =ViewLogMode= for viewing logs
(using [[https://github.com/Niluge-KiWi/erc-view-log][erc-view-log]]) (using [[https://github.com/Niluge-KiWi/erc-view-log][erc-view-log]])
- YouTube videos Thumbnails inline (using [[https://github.com/yhvh/erc-yt][erc-yt]]) - YouTube videos Thumbnails inline (using [[https://github.com/yhvh/erc-yt][erc-yt]])
- Social Graph for ERC messages (using [[https://github.com/vibhavp/erc-social-graph][erc-social-graph]]) - Social Graph for ERC messages (using [[https://github.com/vibhavp/erc-social-graph][erc-social-graph]])


+ 1
- 1
emacs.d/layers/+chat/erc/config.el View File

@ -1,6 +1,6 @@
;;; config.el --- erc Layer configuration File for Spacemacs ;;; config.el --- erc Layer configuration File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+chat/erc/funcs.el View File

@ -1,6 +1,6 @@
;;; funcs.el --- Spacemacs ERC Layer functions File ;;; funcs.el --- Spacemacs ERC Layer functions File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+chat/erc/local/erc-sasl/erc-sasl.el View File

@ -75,7 +75,7 @@ current session"
(base64-encode-string (base64-encode-string
(concat "\0" (erc-current-nick) (concat "\0" (erc-current-nick)
"\0" erc-session-password) t))))) "\0" erc-session-password) t)))))
(progn
(progn
(erc-display-message (erc-display-message
parsed 'error parsed 'error
(if erc-server-connected 'active proc) (if erc-server-connected 'active proc)


+ 1
- 1
emacs.d/layers/+chat/erc/packages.el View File

@ -1,6 +1,6 @@
;;; packages.el --- erc Layer packages File for Spacemacs ;;; packages.el --- erc Layer packages File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+chat/jabber/funcs.el View File

@ -1,6 +1,6 @@
;;; funcs.el --- Jabber layer functions File for Spacemacs ;;; funcs.el --- Jabber layer functions File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+chat/jabber/packages.el View File

@ -1,6 +1,6 @@
;;; packages.el --- jabber Layer packages File for Spacemacs ;;; packages.el --- jabber Layer packages File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Tosh Lyons <tosh.lyons@gmail.com> ;; Author: Tosh Lyons <tosh.lyons@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+chat/rcirc/config.el View File

@ -1,6 +1,6 @@
;;; config.el --- rcirc Layer configuration File for Spacemacs ;;; config.el --- rcirc Layer configuration File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+chat/rcirc/funcs.el View File

@ -1,6 +1,6 @@
;;; funcs.el --- rcirc Layer functions File for Spacemacs ;;; funcs.el --- rcirc Layer functions File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+chat/slack/README.org View File

@ -23,7 +23,7 @@ file.
Follow the instructions in the [[https://github.com/yuya373/emacs-slack/blob/master/README.md][emacs-slack]] package for obtaining your client ID, Follow the instructions in the [[https://github.com/yuya373/emacs-slack/blob/master/README.md][emacs-slack]] package for obtaining your client ID,
client secret, and token. client secret, and token.
To test that eveyrthing is alright put the following snippet in your
To test that everything is alright put the following snippet in your
=dotspacemacs/user-config()= replacing =client-id=, =client-secret= and =token= =dotspacemacs/user-config()= replacing =client-id=, =client-secret= and =token=
with your info. with your info.


+ 1
- 1
emacs.d/layers/+chat/slack/packages.el View File

@ -1,6 +1,6 @@
;;; packages.el --- slack layer packages file for Spacemacs. ;;; packages.el --- slack layer packages file for Spacemacs.
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Kosta Harlan <kosta@kostaharlan.net> ;; Author: Kosta Harlan <kosta@kostaharlan.net>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+checkers/spell-checking/README.org View File

@ -85,7 +85,7 @@ set the layer variable =enable-flyspell-auto-completion= to t:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers (setq-default dotspacemacs-configuration-layers
'((spell-checking :variables =enable-flyspell-auto-completion= t)))
'((spell-checking :variables enable-flyspell-auto-completion t)))
#+END_SRC #+END_SRC
* Key Bindings * Key Bindings


+ 1
- 1
emacs.d/layers/+checkers/spell-checking/config.el View File

@ -1,6 +1,6 @@
;;; config.el --- Spell Checking Layer configuration File for Spacemacs ;;; config.el --- Spell Checking Layer configuration File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+checkers/spell-checking/funcs.el View File

@ -1,6 +1,6 @@
;;; funcs.el --- Spell Checking Layer functions File for Spacemacs ;;; funcs.el --- Spell Checking Layer functions File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 13
- 4
emacs.d/layers/+checkers/spell-checking/packages.el View File

@ -1,6 +1,6 @@
;;; packages.el --- Spell Checking Layer packages File for Spacemacs ;;; packages.el --- Spell Checking Layer packages File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -75,13 +75,22 @@
(spacemacs/set-leader-keys "Sc" 'flyspell-correct-previous-word-generic))) (spacemacs/set-leader-keys "Sc" 'flyspell-correct-previous-word-generic)))
(defun spell-checking/init-flyspell-correct-ivy () (defun spell-checking/init-flyspell-correct-ivy ()
(use-package flyspell-correct-ivy))
(use-package flyspell-correct-ivy
:commands (flyspell-correct-ivy)
:init
(setq flyspell-correct-interface #'flyspell-correct-ivy)))
(defun spell-checking/init-flyspell-correct-helm () (defun spell-checking/init-flyspell-correct-helm ()
(use-package flyspell-correct-helm))
(use-package flyspell-correct-helm
:commands (flyspell-correct-helm)
:init
(setq flyspell-correct-interface #'flyspell-correct-helm)))
(defun spell-checking/init-flyspell-correct-popup () (defun spell-checking/init-flyspell-correct-popup ()
(use-package flyspell-correct-popup))
(use-package flyspell-correct-popup
:commands (flyspell-correct-popup)
:init
(setq flyspell-correct-interface #'flyspell-correct-popup)))
(defun spell-checking/init-flyspell-popup () (defun spell-checking/init-flyspell-popup ()
(use-package flyspell-popup (use-package flyspell-popup


+ 3
- 3
emacs.d/layers/+checkers/syntax-checking/README.org View File

@ -31,9 +31,9 @@ to =nil=:
#+END_SRC #+END_SRC
** Disabling by default ** Disabling by default
By default, syntax-checking is enabled in all available major modes and may be
toggled off with ~SPC t s~. You can default this to off by setting the variable
=syntax-checking-enable-by-default= to =nil=:
By default, syntax-checking is enabled in all available major modes (except for
=emacs-lisp-mode=) and may be toggled off with ~SPC t s~. You can default this to off
by setting the variable =syntax-checking-enable-by-default= to =nil=:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers (setq-default dotspacemacs-configuration-layers


+ 1
- 1
emacs.d/layers/+checkers/syntax-checking/config.el View File

@ -1,6 +1,6 @@
;;; config.el --- Syntax Checking Layer configuration File for Spacemacs ;;; config.el --- Syntax Checking Layer configuration File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+checkers/syntax-checking/funcs.el View File

@ -1,6 +1,6 @@
;;; funcs.el --- Syntax Checking Layer functions File for Spacemacs ;;; funcs.el --- Syntax Checking Layer functions File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+checkers/syntax-checking/packages.el View File

@ -1,6 +1,6 @@
;;; packages.el --- Syntax Checking Layer packages File for Spacemacs ;;; packages.el --- Syntax Checking Layer packages File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 7
- 7
emacs.d/layers/+completion/auto-completion/README.org View File

@ -27,7 +27,7 @@ This layer provides auto-completion to Spacemacs.
The following completion engines are supported: The following completion engines are supported:
- [[http://company-mode.github.io/][company]] - [[http://company-mode.github.io/][company]]
- [[http://auto-complete.org/][auto-complete]]
- [[https://github.com/auto-complete/auto-complete][auto-complete]]
Snippets are supported via [[https://github.com/capitaomorte/yasnippet][yasnippet]] and [[https://github.com/abo-abo/auto-yasnippet][auto-yasnippet]]. Snippets are supported via [[https://github.com/capitaomorte/yasnippet][yasnippet]] and [[https://github.com/abo-abo/auto-yasnippet][auto-yasnippet]].
@ -81,10 +81,10 @@ you don't use it already.
** Snippets directories ** Snippets directories
The following directories are added by default: The following directories are added by default:
- ~/.emacs.d/elpa/yasnippet-xxxxx/snippets
- ~/.emacs.d/layers/auto-completion/snippets
- ~/.emacs.d/private/snippets (conditional to the value of =auto-completion-private-snippets-directory=)
- ~/.spacemacs.d/snippets (conditional to the existence of =~/.spacemacs.d= directory)
- =~/.emacs.d/elpa/yasnippet-xxxxx/snippets=
- =~/.emacs.d/layers/auto-completion/snippets=
- =~/.emacs.d/private/snippets= (conditional to the value of =auto-completion-private-snippets-directory=)
- =~/.spacemacs.d/snippets= (conditional to the existence of =~/.spacemacs.d= directory)
You can provide additional directories by setting the variable You can provide additional directories by setting the variable
=auto-completion-private-snippets-directory= which can take a string in case of =auto-completion-private-snippets-directory= which can take a string in case of
@ -142,7 +142,7 @@ for a given mode.
You may want to enable company globally to get auto-completion You may want to enable company globally to get auto-completion
everywhere even in the modes which are not configured by Spacemacs. To do everywhere even in the modes which are not configured by Spacemacs. To do
so, you just have to add =(global-company-mode)= in the so, you just have to add =(global-company-mode)= in the
=dotspacemacs/user -config= function of your dotfile.
=dotspacemacs/user-config= function of your dotfile.
Note that if you want to enable =auto-complete= globally you will have to Note that if you want to enable =auto-complete= globally you will have to
disable =company= first, see the next section to do so. disable =company= first, see the next section to do so.
@ -192,7 +192,7 @@ your ~.spacemacs~ file with (e.g.)
'((auto-completion :variables '((auto-completion :variables
spacemacs-default-company-backends '(company-files company-capf)))) spacemacs-default-company-backends '(company-files company-capf))))
#+END_SRC #+END_SRC
** Improved faces ** Improved faces
For nicer-looking faces, try adding the following to `custom-set-faces` in your dotspacemacs file. For nicer-looking faces, try adding the following to `custom-set-faces` in your dotspacemacs file.


+ 1
- 1
emacs.d/layers/+completion/auto-completion/config.el View File

@ -1,6 +1,6 @@
;;; config.el --- Auto-completion configuration File for Spacemacs ;;; config.el --- Auto-completion configuration File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 2
- 2
emacs.d/layers/+completion/auto-completion/funcs.el View File

@ -1,6 +1,6 @@
;;; funcs.el --- Auto-completion functions File ;;; funcs.el --- Auto-completion functions File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -232,7 +232,7 @@
"Call `yas-expand' and switch to `insert state'" "Call `yas-expand' and switch to `insert state'"
(interactive) (interactive)
(call-interactively 'aya-expand) (call-interactively 'aya-expand)
(unless holy-mode (evil-insert-state)))
(evil-insert-state))
;; Yasnippet and Smartparens ;; Yasnippet and Smartparens


+ 5
- 1
emacs.d/layers/+completion/auto-completion/packages.el View File

@ -1,6 +1,6 @@
;;; packages.el --- Auto-completion Layer packages File for Spacemacs ;;; packages.el --- Auto-completion Layer packages File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -16,6 +16,7 @@
company company
(company-quickhelp :toggle auto-completion-enable-help-tooltip) (company-quickhelp :toggle auto-completion-enable-help-tooltip)
company-statistics company-statistics
fuzzy
(helm-company :toggle (configuration-layer/package-usedp 'helm)) (helm-company :toggle (configuration-layer/package-usedp 'helm))
(helm-c-yasnippet :toggle (configuration-layer/package-usedp 'helm)) (helm-c-yasnippet :toggle (configuration-layer/package-usedp 'helm))
hippie-exp hippie-exp
@ -112,6 +113,9 @@
"company-statistics-cache.el")) "company-statistics-cache.el"))
(add-hook 'company-mode-hook 'company-statistics-mode)))) (add-hook 'company-mode-hook 'company-statistics-mode))))
(defun auto-completion/init-fuzzy ()
(use-package fuzzy :defer t))
(defun auto-completion/init-company-quickhelp () (defun auto-completion/init-company-quickhelp ()
(use-package company-quickhelp (use-package company-quickhelp
:commands company-quickhelp-manual-begin :commands company-quickhelp-manual-begin


+ 10
- 1
emacs.d/layers/+completion/helm/funcs.el View File

@ -1,6 +1,6 @@
;;; funcs.el --- Helm Layer functions File for Spacemacs ;;; funcs.el --- Helm Layer functions File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -213,3 +213,12 @@ Ensure that helm is required before calling FUNC."
(line-number-at-pos)) (line-number-at-pos))
spacemacs--gne-line-func 'helm-grep-action spacemacs--gne-line-func 'helm-grep-action
next-error-function 'spacemacs/gne-next))) next-error-function 'spacemacs/gne-next)))
;; theme
(defun spacemacs/helm-themes ()
"Remove limit on number of candidates on `helm-themes'"
(interactive)
(let (helm-candidate-number-limit)
(helm-themes)))

+ 85
- 0
emacs.d/layers/+completion/helm/local/helm-spacemacs-help/helm-spacemacs-faq.el View File

@ -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

+ 5
- 59
emacs.d/layers/+completion/helm/local/helm-spacemacs-help/helm-spacemacs-help.el View File

@ -30,7 +30,6 @@
(require 'ht) (require 'ht)
(require 'helm) (require 'helm)
(require 'helm-command) (require 'helm-command)
(require 'helm-org)
(require 'core-configuration-layer) (require 'core-configuration-layer)
(defvar helm-spacemacs--initialized nil (defvar helm-spacemacs--initialized nil
@ -44,13 +43,8 @@
(defun helm-spacemacs-help//init (&optional arg) (defun helm-spacemacs-help//init (&optional arg)
(when (or arg (null helm-spacemacs--initialized)) (when (or arg (null helm-spacemacs--initialized))
(let ((configuration-layer--load-packages-files t)
(configuration-layer--package-properties-read-onlyp t)
(configuration-layer--inhibit-warnings t))
(configuration-layer/discover-layers)
(configuration-layer/declare-layers (configuration-layer/get-layers-list))
(configuration-layer/make-all-packages)
(setq helm-spacemacs--initialized t))))
(configuration-layer/make-all-packages)
(setq helm-spacemacs--initialized t)))
;;;###autoload ;;;###autoload
(defun helm-spacemacs-help (arg) (defun helm-spacemacs-help (arg)
@ -63,8 +57,7 @@
,(helm-spacemacs-help//layer-source) ,(helm-spacemacs-help//layer-source)
,(helm-spacemacs-help//package-source) ,(helm-spacemacs-help//package-source)
,(helm-spacemacs-help//dotspacemacs-source) ,(helm-spacemacs-help//dotspacemacs-source)
,(helm-spacemacs-help//toggle-source)
,(helm-spacemacs-help//faq-source))))
,(helm-spacemacs-help//toggle-source))))
;;;###autoload ;;;###autoload
(defun helm-spacemacs-help-dotspacemacs () (defun helm-spacemacs-help-dotspacemacs ()
@ -107,14 +100,6 @@
(helm :buffer "*helm: spacemacs*" (helm :buffer "*helm: spacemacs*"
:sources `(,(helm-spacemacs-help//toggle-source)))) :sources `(,(helm-spacemacs-help//toggle-source))))
;;;###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//documentation-source () (defun helm-spacemacs-help//documentation-source ()
"Construct the helm source for the documentation section." "Construct the helm source for the documentation section."
(helm-build-sync-source "Spacemacs Documentation" (helm-build-sync-source "Spacemacs Documentation"
@ -143,6 +128,8 @@
;; give each document an appropriate title ;; give each document an appropriate title
(mapcar (lambda (r) (mapcar (lambda (r)
(cond (cond
((string-equal r "BEGINNERS_TUTORIAL.org")
`("Beginners tutorial" . ,r))
((string-equal r "CONTRIBUTING.org") ((string-equal r "CONTRIBUTING.org")
`("How to contribute to Spacemacs" . ,r)) `("How to contribute to Spacemacs" . ,r))
((string-equal r "CONVENTIONS.org") ((string-equal r "CONVENTIONS.org")
@ -369,47 +356,6 @@
(re-search-forward (format "^[a-z\s\\(\\-]*%s" candidate)) (re-search-forward (format "^[a-z\s\\(\\-]*%s" candidate))
(beginning-of-line)) (beginning-of-line))
(defvar helm-spacemacs-help--faq-filename
(concat spacemacs-docs-directory "FAQ.org")
"Location of the FAQ file.")
(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-help) (provide 'helm-spacemacs-help)
;;; helm-spacemacs-help.el ends here ;;; helm-spacemacs-help.el ends here

+ 23
- 22
emacs.d/layers/+completion/helm/packages.el View File

@ -1,6 +1,6 @@
;;; packages.el --- Helm Layer packages File ;;; packages.el --- Helm Layer packages File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -24,7 +24,9 @@
helm-swoop helm-swoop
helm-themes helm-themes
(helm-spacemacs-help :location local) (helm-spacemacs-help :location local)
(helm-spacemacs-faq :location local)
imenu imenu
persp-mode
popwin popwin
projectile projectile
)) ))
@ -182,7 +184,7 @@
(defun spacemacs/helm-file-do-ag (&optional _) (defun spacemacs/helm-file-do-ag (&optional _)
"Wrapper to execute `helm-ag-this-file.'" "Wrapper to execute `helm-ag-this-file.'"
(interactive) (interactive)
(helm-ag-this-file))
(helm-do-ag-this-file))
(defun spacemacs/helm-file-do-ag-region-or-symbol () (defun spacemacs/helm-file-do-ag-region-or-symbol ()
"Search in current file with `ag' using a default input." "Search in current file with `ag' using a default input."
@ -525,25 +527,19 @@ Search for a search tool in the order provided by `dotspacemacs-search-tools'."
helm-spacemacs-help-packages helm-spacemacs-help-packages
helm-spacemacs-help-docs helm-spacemacs-help-docs
helm-spacemacs-help-toggles) helm-spacemacs-help-toggles)
:init
(progn
(defun spacemacs-base/helm-spacemacs-deprecated (arg)
"Provide helm-spacemacs with a binding's depreciation message."
(interactive "P")
(warn (concat "The 'SPC f e h' (or 'M-m f e h') binding is now "
"deprecated and will be remove in the next release. "
"Please use 'SPC h SPC' (or 'M-m h SPC') instead."))
(helm-spacemacs arg))
(spacemacs/set-leader-keys "feh" 'spacemacs-base/helm-spacemacs-deprecated)
(spacemacs/set-leader-keys "fef" 'helm-spacemacs-help-faq)
(spacemacs/set-leader-keys
"h ." 'helm-spacemacs-help-dotspacemacs
"h SPC" 'helm-spacemacs-help
"h f" 'helm-spacemacs-help-faq
"h l" 'helm-spacemacs-help-layers
"h p" 'helm-spacemacs-help-packages
"h r" 'helm-spacemacs-help-docs
"h t" 'helm-spacemacs-help-toggles))))
:init (spacemacs/set-leader-keys
"h ." 'helm-spacemacs-help-dotspacemacs
"h SPC" 'helm-spacemacs-help
"h f" 'helm-spacemacs-help-faq
"h l" 'helm-spacemacs-help-layers
"h p" 'helm-spacemacs-help-packages
"h r" 'helm-spacemacs-help-docs
"h t" 'helm-spacemacs-help-toggles)))
(defun helm/init-helm-spacemacs-faq ()
(use-package helm-spacemacs-faq
:commands helm-spacemacs-help-faq
:init (spacemacs/set-leader-keys "h f" 'helm-spacemacs-help-faq)))
(defun helm/init-helm-swoop () (defun helm/init-helm-swoop ()
(use-package helm-swoop (use-package helm-swoop
@ -580,7 +576,7 @@ Search for a search tool in the order provided by `dotspacemacs-search-tools'."
:defer t :defer t
:init :init
(spacemacs/set-leader-keys (spacemacs/set-leader-keys
"Ts" 'helm-themes)))
"Ts" 'spacemacs/helm-themes)))
(defun helm/post-init-imenu () (defun helm/post-init-imenu ()
(spacemacs/set-leader-keys "ji" 'spacemacs/helm-jump-in-buffer)) (spacemacs/set-leader-keys "ji" 'spacemacs/helm-jump-in-buffer))
@ -593,3 +589,8 @@ Search for a search tool in the order provided by `dotspacemacs-search-tools'."
(defun helm/post-init-projectile () (defun helm/post-init-projectile ()
(setq projectile-completion-system 'helm)) (setq projectile-completion-system 'helm))
(defun helm/post-init-persp-mode ()
(setq spacemacs-layouts-transient-state-add-bindings
'(("b" spacemacs/persp-helm-mini :exit t)
("l" spacemacs/helm-perspectives :exit t))))

+ 2
- 2
emacs.d/layers/+completion/ivy/config.el View File

@ -1,6 +1,6 @@
;;; config.el --- Ivy Layer Configuration File for Spacemacs ;;; config.el --- Ivy Layer Configuration File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -32,7 +32,7 @@ than this amount.")
("v" spacemacs/find-file-vsplit "in vertical split") ("v" spacemacs/find-file-vsplit "in vertical split")
("s" spacemacs/find-file-split "in horizontal split") ("s" spacemacs/find-file-split "in horizontal split")
("l" find-file-literally "literally") ("l" find-file-literally "literally")
("d" spacemacs/delete-file "delete file")
("d" spacemacs/delete-file-confirm "delete file")
("r" spacemacs/rename-file "rename file")) ("r" spacemacs/rename-file "rename file"))
"Default ivy actions for files.") "Default ivy actions for files.")


+ 8
- 1
emacs.d/layers/+completion/ivy/funcs.el View File

@ -1,6 +1,6 @@
;;; funcs.el --- Ivy Layer functions File for Spacemacs ;;; funcs.el --- Ivy Layer functions File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -96,6 +96,12 @@
(spacemacs//gne-init-counsel)) (spacemacs//gne-init-counsel))
(pop-to-buffer buf)))) (pop-to-buffer buf))))
(defun spacemacs//counsel-edit ()
"Edit the current search results in a buffer using wgrep."
(interactive)
(run-with-idle-timer 0 nil 'ivy-wgrep-change-to-wgrep-mode)
(ivy-occur))
(defun spacemacs//gne-init-counsel () (defun spacemacs//gne-init-counsel ()
(with-current-buffer "*ivy results*" (with-current-buffer "*ivy results*"
(setq spacemacs--gne-min-line 1 (setq spacemacs--gne-min-line 1
@ -113,6 +119,7 @@
(defvar spacemacs--counsel-map (defvar spacemacs--counsel-map
(let ((map (make-sparse-keymap))) (let ((map (make-sparse-keymap)))
(define-key map (kbd "<f3>") 'spacemacs//counsel-save-in-buffer) (define-key map (kbd "<f3>") 'spacemacs//counsel-save-in-buffer)
(define-key map (kbd "C-c C-e") 'spacemacs//counsel-edit)
map)) map))
;; see `counsel-ag' ;; see `counsel-ag'


+ 1
- 1
emacs.d/layers/+completion/ivy/layers.el View File

@ -1,6 +1,6 @@
;;; layers.el --- Ivy Layer layers File for Spacemacs ;;; layers.el --- Ivy Layer layers File for Spacemacs
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 2
- 7
emacs.d/layers/+completion/ivy/local/ivy-spacemacs-help/ivy-spacemacs-help.el View File

@ -42,13 +42,8 @@
(defun ivy-spacemacs-help//init (&optional arg) (defun ivy-spacemacs-help//init (&optional arg)
(when (or arg (null ivy-spacemacs--initialized)) (when (or arg (null ivy-spacemacs--initialized))
(let ((configuration-layer--load-packages-files t)
(configuration-layer--package-properties-read-onlyp t)
(configuration-layer--inhibit-warnings t))
(configuration-layer/discover-layers)
(configuration-layer/declare-layers (configuration-layer/get-layers-list))
(configuration-layer/make-all-packages)
(setq ivy-spacemacs--initialized t))))
(configuration-layer/make-all-packages)
(setq ivy-spacemacs--initialized t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Docs ;; Docs


+ 7
- 3
emacs.d/layers/+completion/ivy/packages.el View File

@ -1,6 +1,6 @@
;;; packages.el --- Ivy Layer packages File ;;; packages.el --- Ivy Layer packages File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -12,6 +12,7 @@
(setq ivy-packages (setq ivy-packages
'( '(
auto-highlight-symbol auto-highlight-symbol
bookmark
counsel counsel
(counsel-projectile :toggle (configuration-layer/package-usedp 'projectile)) (counsel-projectile :toggle (configuration-layer/package-usedp 'projectile))
evil evil
@ -191,9 +192,9 @@
'(("c" persp-kill-without-buffers "Close layout(s)") '(("c" persp-kill-without-buffers "Close layout(s)")
("k" persp-kill "Kill layout(s)"))) ("k" persp-kill "Kill layout(s)")))
(setq spacemacs-layouts-transient-state-remove-bindings (setq spacemacs-layouts-transient-state-remove-bindings
'("b" "l" "C" "X"))
'("C" "X"))
(setq spacemacs-layouts-transient-state-add-bindings (setq spacemacs-layouts-transient-state-add-bindings
'(("b" spacemacs/ivy-spacemacs-layout-buffer)
'(("b" spacemacs/ivy-spacemacs-layout-buffer :exit t)
("l" spacemacs/ivy-spacemacs-layouts :exit t) ("l" spacemacs/ivy-spacemacs-layouts :exit t)
("C" spacemacs/ivy-spacemacs-layout-close-other :exit t) ("C" spacemacs/ivy-spacemacs-layout-close-other :exit t)
("X" spacemacs/ivy-spacemacs-layout-kill-other :exit t)))) ("X" spacemacs/ivy-spacemacs-layout-kill-other :exit t))))
@ -203,6 +204,9 @@
(spacemacs/set-leader-keys (spacemacs/set-leader-keys
"pv" 'projectile-vc)) "pv" 'projectile-vc))
(defun ivy/post-init-bookmark ()
(spacemacs/set-leader-keys "fb" 'counsel-bookmark))
(defun ivy/init-smex () (defun ivy/init-smex ()
(use-package smex (use-package smex
:defer t :defer t


+ 3
- 4
emacs.d/layers/+distributions/spacemacs-base/config.el View File

@ -1,6 +1,6 @@
;;; config.el --- Spacemacs Base Layer configuration File ;;; config.el --- Spacemacs Base Layer configuration File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -18,6 +18,7 @@
;; Also auto refresh dired, but be quiet about it ;; Also auto refresh dired, but be quiet about it
(setq global-auto-revert-non-file-buffers t (setq global-auto-revert-non-file-buffers t
auto-revert-verbose nil) auto-revert-verbose nil)
(add-to-list 'global-auto-revert-ignore-modes 'Buffer-menu-mode)
;; Make dired "guess" target directory for some operations, like copy to ;; Make dired "guess" target directory for some operations, like copy to
;; directory visited in other split buffer. ;; directory visited in other split buffer.
@ -134,9 +135,7 @@ It runs `tabulated-list-revert-hook', then calls `tabulated-list-print'."
;; but IS available during the subsequent config reloads ;; but IS available during the subsequent config reloads
(if (fboundp 'spacemacs/toggle-fullscreen-frame-on) (if (fboundp 'spacemacs/toggle-fullscreen-frame-on)
(spacemacs/toggle-fullscreen-frame-on) (spacemacs/toggle-fullscreen-frame-on)
(spacemacs/toggle-frame-fullscreen))
(if dotspacemacs-maximized-at-startup
(add-hook 'window-setup-hook 'toggle-frame-maximized)))
(spacemacs/toggle-frame-fullscreen)))
(setq ns-use-native-fullscreen (not dotspacemacs-fullscreen-use-non-native)) (setq ns-use-native-fullscreen (not dotspacemacs-fullscreen-use-non-native))


+ 242
- 50
emacs.d/layers/+distributions/spacemacs-base/funcs.el View File

@ -1,6 +1,6 @@
;;; funcs.el --- Spacemacs Base Layer functions File ;;; funcs.el --- Spacemacs Base Layer functions File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -47,6 +47,8 @@ the current state and point position."
(dotimes (_ count) (save-excursion (evil-insert-newline-below)))) (dotimes (_ count) (save-excursion (evil-insert-newline-below))))
(defun spacemacs/evil-goto-next-line-and-indent (&optional count) (defun spacemacs/evil-goto-next-line-and-indent (&optional count)
"Match the current lines indentation to the next line.
A COUNT argument matches the indentation to the next COUNT lines."
(interactive "p") (interactive "p")
(let ((counter (or count 1))) (let ((counter (or count 1)))
(while (> counter 0) (while (> counter 0)
@ -148,41 +150,113 @@ automatically applied to."
"Determines if a buffer is useless." "Determines if a buffer is useless."
(not (spacemacs/useful-buffer-p buffer))) (not (spacemacs/useful-buffer-p buffer)))
;; from magnars modified by ffevotte for dedicated windows support
(defun spacemacs/rotate-windows (count)
(defun spacemacs/swap-windows (window1 window2)
"Swap two windows.
WINDOW1 and WINDOW2 must be valid windows. They may contain child
windows."
(let ((state1 (window-state-get window1))
(state2 (window-state-get window2)))
;; to put state into dedicated windows, we must undedicate them first (not
;; needed with Emacs 25.1)
(dolist (win (list window1 window2))
(if (window-live-p win)
(set-window-dedicated-p win nil)
;; win has sub-windows, undedicate all of them
(walk-window-subtree (lambda (leaf-window)
(set-window-dedicated-p leaf-window nil))
win)))
(window-state-put state1 window2)
(window-state-put state2 window1)))
;; from @bmag
(defun spacemacs/window-layout-toggle ()
"Toggle between horizontal and vertical layout of two windows."
(interactive)
(if (= (count-windows) 2)
(let* ((window-tree (car (window-tree)))
(current-split-vertical-p (car window-tree))
(first-window (nth 2 window-tree))
(second-window (nth 3 window-tree))
(second-window-state (window-state-get second-window))
(splitter (if current-split-vertical-p
#'split-window-horizontally
#'split-window-vertically)))
(delete-other-windows first-window)
;; `window-state-put' also re-selects the window if needed, so we don't
;; need to call `select-window'
(window-state-put second-window-state (funcall splitter)))
(error "Can't toggle window layout when the number of windows isn't two.")))
;; originally from magnars and modified by ffevotte for dedicated windows
;; support, it has quite diverged by now
(defun spacemacs/rotate-windows-forward (count)
"Rotate each window forwards. "Rotate each window forwards.
A negative prefix argument rotates each window backwards. A negative prefix argument rotates each window backwards.
Dedicated (locked) windows are left untouched." Dedicated (locked) windows are left untouched."
(interactive "p") (interactive "p")
(let* ((non-dedicated-windows (remove-if 'window-dedicated-p (window-list)))
(let* ((non-dedicated-windows (cl-remove-if 'window-dedicated-p (window-list)))
(states (mapcar #'window-state-get non-dedicated-windows))
(num-windows (length non-dedicated-windows)) (num-windows (length non-dedicated-windows))
(i 0)
(step (+ num-windows count))) (step (+ num-windows count)))
(cond ((not (> num-windows 1))
(message "You can't rotate a single window!"))
(t
(dotimes (counter (- num-windows 1))
(let* ((next-i (% (+ step i) num-windows))
(w1 (elt non-dedicated-windows i))
(w2 (elt non-dedicated-windows next-i))
(b1 (window-buffer w1))
(b2 (window-buffer w2))
(s1 (window-start w1))
(s2 (window-start w2)))
(set-window-buffer w1 b2)
(set-window-buffer w2 b1)
(set-window-start w1 s2)
(set-window-start w2 s1)
(setq i next-i)))))))
(if (< num-windows 2)
(error "You can't rotate a single window!")
(dotimes (i num-windows)
(window-state-put
(elt states i)
(elt non-dedicated-windows (% (+ step i) num-windows)))))))
(defun spacemacs/rotate-windows-backward (count) (defun spacemacs/rotate-windows-backward (count)
"Rotate each window backwards. "Rotate each window backwards.
Dedicated (locked) windows are left untouched." Dedicated (locked) windows are left untouched."
(interactive "p") (interactive "p")
(spacemacs/rotate-windows (* -1 count)))
(spacemacs/rotate-windows-forward (* -1 count)))
(defun spacemacs/move-buffer-to-window (windownum follow-focus-p)
"Moves a buffer to a window, using the spacemacs numbering. follow-focus-p
controls whether focus moves to new window (with buffer), or stays on
current"
(interactive)
(let ((b (current-buffer))
(w1 (selected-window))
(w2 (winum-get-window-by-number windownum)))
(unless (eq w1 w2)
(set-window-buffer w2 b)
(switch-to-prev-buffer)
(unrecord-window-buffer w1 b)))
(when follow-focus-p (select-window (winum-get-window-by-number windownum))))
(defun spacemacs/swap-buffers-to-window (windownum follow-focus-p)
"Swaps visible buffers between active window and selected window.
follow-focus-p controls whether focus moves to new window (with buffer), or
stays on current"
(interactive)
(let* ((b1 (current-buffer))
(w1 (selected-window))
(w2 (winum-get-window-by-number windownum))
(b2 (window-buffer w2)))
(unless (eq w1 w2)
(set-window-buffer w1 b2)
(set-window-buffer w2 b1)
(unrecord-window-buffer w1 b1)
(unrecord-window-buffer w2 b2)))
(when follow-focus-p (select-window-by-number windownum)))
(dotimes (i 9)
(let ((n (+ i 1)))
(eval `(defun ,(intern (format "buffer-to-window-%s" n)) (&optional arg)
,(format "Move buffer to the window with number %i." n)
(interactive "P")
(if arg
(spacemacs/swap-buffers-to-window ,n t)
(spacemacs/move-buffer-to-window ,n t))))
(eval `(defun ,(intern (format "move-buffer-window-no-follow-%s" n)) ()
(interactive)
(spacemacs/move-buffer-to-window ,n nil)))
(eval `(defun ,(intern (format "swap-buffer-window-no-follow-%s" n)) ()
(interactive)
(spacemacs/swap-buffers-to-window ,n nil)))
))
(defun spacemacs/rename-file (filename &optional new-filename) (defun spacemacs/rename-file (filename &optional new-filename)
"Rename FILENAME to NEW-FILENAME. "Rename FILENAME to NEW-FILENAME.
@ -221,11 +295,11 @@ projectile cache when it's possible and update recentf list."
"Renames current buffer and file it is visiting." "Renames current buffer and file it is visiting."
(interactive) (interactive)
(let* ((name (buffer-name)) (let* ((name (buffer-name))
(filename (buffer-file-name))
(dir (file-name-directory filename)))
(filename (buffer-file-name)))
(if (not (and filename (file-exists-p filename))) (if (not (and filename (file-exists-p filename)))
(error "Buffer '%s' is not visiting a file!" name) (error "Buffer '%s' is not visiting a file!" name)
(let ((new-name (read-file-name "New name: " dir)))
(let* ((dir (file-name-directory filename))
(new-name (read-file-name "New name: " dir)))
(cond ((get-buffer new-name) (cond ((get-buffer new-name)
(error "A buffer named '%s' already exists!" new-name)) (error "A buffer named '%s' already exists!" new-name))
(t (t
@ -264,6 +338,13 @@ removal."
(projectile-project-p)) (projectile-project-p))
(call-interactively #'projectile-invalidate-cache))))) (call-interactively #'projectile-invalidate-cache)))))
(defun spacemacs/delete-file-confirm (filename)
"Remove specified file or directory after users approval.
FILENAME is deleted using `spacemacs/delete-file' function.."
(interactive "f")
(funcall-interactively #'spacemacs/delete-file filename t))
;; from magnars ;; from magnars
(defun spacemacs/delete-current-buffer-file () (defun spacemacs/delete-current-buffer-file ()
"Removes file connected to current buffer and kills buffer." "Removes file connected to current buffer and kills buffer."
@ -283,7 +364,7 @@ removal."
;; from magnars ;; from magnars
(defun spacemacs/sudo-edit (&optional arg) (defun spacemacs/sudo-edit (&optional arg)
(interactive "p")
(interactive "P")
(let ((fname (if (or arg (not buffer-file-name)) (let ((fname (if (or arg (not buffer-file-name))
(read-file-name "File: ") (read-file-name "File: ")
buffer-file-name))) buffer-file-name)))
@ -710,23 +791,68 @@ the right."
(interactive) (interactive)
(call-interactively 'write-file)) (call-interactively 'write-file))
;; from https://www.emacswiki.org/emacs/CopyingWholeLines
(defun spacemacs/duplicate-line-or-region (&optional n)
"Duplicate current line, or region if active.
With argument N, make N copies.
With negative N, comment out original line and use the absolute value."
(interactive "*p")
(let ((use-region (use-region-p)))
(save-excursion
(let ((text (if use-region ; Get region if active, otherwise line
(buffer-substring (region-beginning) (region-end))
(prog1 (thing-at-point 'line)
(end-of-line)
(if (< 0 (forward-line 1)) ; Go to beginning of next line, or make a new one
(newline))))))
(dotimes (i (abs (or n 1))) ; Insert N times, or once if not specified
(insert text))))
(if use-region nil ; Only if we're working with a line (not a region)
(let ((pos (- (point) (line-beginning-position)))) ; Save column
(if (> 0 n) ; Comment out original with negative arg
(comment-region (line-beginning-position) (line-end-position)))
(forward-line 1)
(forward-char pos)))))
(defun spacemacs/uniquify-lines () (defun spacemacs/uniquify-lines ()
"Remove duplicate adjacent lines in region or current buffer"
"Remove duplicate adjacent lines in a region or the current buffer"
(interactive) (interactive)
(save-excursion (save-excursion
(save-restriction (save-restriction
(let ((beg (if (region-active-p) (region-beginning) (point-min)))
(end (if (region-active-p) (region-end) (point-max))))
(let* ((region-active (or (region-active-p) (evil-visual-state-p)))
(beg (if region-active (region-beginning) (point-min)))
(end (if region-active (region-end) (point-max))))
(goto-char beg) (goto-char beg)
(while (re-search-forward "^\\(.*\n\\)\\1+" end t) (while (re-search-forward "^\\(.*\n\\)\\1+" end t)
(replace-match "\\1")))))) (replace-match "\\1"))))))
(defun spacemacs/sort-lines ()
"Sort lines in region or current buffer"
(defun spacemacs/sort-lines (&optional reverse)
"Sort lines in a region or the current buffer.
A non-nil argument sorts in reverse order."
(interactive "P")
(let* ((region-active (or (region-active-p) (evil-visual-state-p)))
(beg (if region-active (region-beginning) (point-min)))
(end (if region-active (region-end) (point-max))))
(sort-lines reverse beg end)))
(defun spacemacs/sort-lines-reverse ()
"Sort lines in reverse order, in a region or the current buffer."
(interactive)
(spacemacs/sort-lines -1))
(defun spacemacs/sort-lines-by-column (&optional reverse)
"Sort lines by the selected column.
A non-nil argument sorts in reverse order."
(interactive "P")
(let* ((region-active (or (region-active-p) (evil-visual-state-p)))
(beg (if region-active (region-beginning) (point-min)))
(end (if region-active (region-end) (point-max))))
(sort-columns reverse beg end)))
(defun spacemacs/sort-lines-by-column-reverse ()
"Sort lines by the selected column in reverse order."
(interactive) (interactive)
(let ((beg (if (region-active-p) (region-beginning) (point-min)))
(end (if (region-active-p) (region-end) (point-max))))
(sort-lines nil beg end)))
(spacemacs/sort-lines-by-column -1))
;; BEGIN linum mouse helpers ;; BEGIN linum mouse helpers
@ -767,16 +893,12 @@ the right."
(defun spacemacs/select-current-block () (defun spacemacs/select-current-block ()
"Select the current block of text between blank lines." "Select the current block of text between blank lines."
(interactive) (interactive)
(let (p1 p2)
(progn
(if (re-search-backward "\n[ \t]*\n" nil "move")
(progn (re-search-forward "\n[ \t]*\n")
(setq p1 (point)))
(setq p1 (point)))
(if (re-search-forward "\n[ \t]*\n" nil "move")
(progn (re-search-backward "\n[ \t]*\n")
(setq p2 (point)))
(setq p2 (point))))
(let (p1)
(when (re-search-backward "\n[ \t]*\n" nil "move")
(re-search-forward "\n[ \t]*\n"))
(setq p1 (point))
(if (re-search-forward "\n[ \t]*\n" nil "move")
(re-search-backward "\n[ \t]*\n"))
(set-mark p1))) (set-mark p1)))
;; END linum mouse helpers ;; END linum mouse helpers
@ -802,7 +924,10 @@ the right."
"Count how many times each word is used in the region. "Count how many times each word is used in the region.
Punctuation is ignored." Punctuation is ignored."
(interactive "r") (interactive "r")
(let (words alist_words_compare (formated ""))
(let (words
alist_words_compare
(formated "")
(overview (call-interactively 'count-words)))
(save-excursion (save-excursion
(goto-char start) (goto-char start)
(while (re-search-forward "\\w+" end t) (while (re-search-forward "\\w+" end t)
@ -829,7 +954,9 @@ Compare them on count first,and in case of tie sort them alphabetically."
(setq formated (concat formated (format "[%s: %d], " name count))))) (setq formated (concat formated (format "[%s: %d], " name count)))))
(when (interactive-p) (when (interactive-p)
(if (> (length formated) 2) (if (> (length formated) 2)
(message (substring formated 0 -2))
(message (format "%s\nWord count: %s"
overview
(substring formated 0 -2)))
(message "No words."))) (message "No words.")))
words)) words))
@ -894,12 +1021,29 @@ a split-side entry, its value must be usable as the SIDE argument for
(when compilation-last-buffer (when compilation-last-buffer
(delete-windows-on compilation-last-buffer))) (delete-windows-on compilation-last-buffer)))
;; Line number
(defun spacemacs/no-linum (&rest ignore) (defun spacemacs/no-linum (&rest ignore)
"Disable linum if current buffer." "Disable linum if current buffer."
(when (or 'linum-mode global-linum-mode) (when (or 'linum-mode global-linum-mode)
(linum-mode 0))) (linum-mode 0)))
(defun spacemacs/linum-update-window-scale-fix (win)
(defun spacemacs/enable-line-numbers-p ()
"Return non-nil if line numbers should be enabled for current buffer.
Decision is based on `dotspacemacs-line-numbers'."
(and dotspacemacs-line-numbers
(spacemacs//linum-current-buffer-is-not-special)
(spacemacs//linum-curent-buffer-is-not-too-big)
(or (spacemacs//linum-backward-compabitility)
(spacemacs//linum-enabled-for-current-major-mode))))
(defun spacemacs//linum-on (origfunc &rest args)
"Advice function to improve `linum-on' function."
(when (spacemacs/enable-line-numbers-p)
(apply origfunc args)))
(defun spacemacs//linum-update-window-scale-fix (win)
"Fix linum for scaled text in the window WIN." "Fix linum for scaled text in the window WIN."
(set-window-margins win (set-window-margins win
(ceiling (* (if (boundp 'text-scale-mode-step) (ceiling (* (if (boundp 'text-scale-mode-step)
@ -908,3 +1052,51 @@ a split-side entry, its value must be usable as the SIDE argument for
(if (car (window-margins)) (if (car (window-margins))
(car (window-margins)) 1))))) (car (window-margins)) 1)))))
(defun spacemacs//linum-backward-compabitility ()
"Return non-nil if `dotspacemacs-line-numbers' has an old format and if
`linum' should be enabled."
(and dotspacemacs-line-numbers
(not (listp dotspacemacs-line-numbers))
(or (eq dotspacemacs-line-numbers t)
(eq dotspacemacs-line-numbers 'relative))))
(defun spacemacs//linum-current-buffer-is-not-special ()
"Return non-nil if current buffer is not a special buffer."
(not (string-match-p "\\*.*\\*" (buffer-name))))
(defun spacemacs//linum-curent-buffer-is-not-too-big ()
"Return non-nil if buffer size is not too big."
(not (and (listp dotspacemacs-line-numbers)
(spacemacs/mplist-get dotspacemacs-line-numbers :size-limit-kb)
(> (buffer-size)
(* 1000 (car (spacemacs/mplist-get dotspacemacs-line-numbers
:size-limit-kb)))))))
;; mode in :enabled, not in :disabled ==> t
;; mode not in :enabled, in :disabled ==> nil
;; mode in :enabled, parent in :disabled ==> t
;; parent in :enabled, mode in :disabled ==> nil
;; not in :enabled, not in :disabled, :enabled is empty ==> t
;; not in :enabled, not in :disabled, :enabled is not empty ==> nil
;; both :enabled and :disabled are empty ==> t
(defun spacemacs//linum-enabled-for-current-major-mode ()
"Return non-nil if line number is enabled for current major-mode."
(let* ((enabled-for-modes (spacemacs/mplist-get dotspacemacs-line-numbers
:enabled-for-modes))
(disabled-for-modes (spacemacs/mplist-get dotspacemacs-line-numbers
:disabled-for-modes))
(enabled-for-parent (apply #'derived-mode-p enabled-for-modes))
(disabled-for-parent (apply #'derived-mode-p disabled-for-modes)))
(or
;; current mode or a parent is in :enabled-for-modes, and there isn't a
;; more specific parent (or the mode itself) in :disabled-for-modes
(and enabled-for-parent
;; handles the case where current major-mode has a parent both in
;; :enabled-for-modes and in :disabled-for-modes. Return non-nil if
;; enabled-for-parent is the more specific parent (IOW doesn't derive
;; from disabled-for-parent)
(not (spacemacs/derived-mode-p enabled-for-parent disabled-for-parent)))
;; current mode (or parent) not explicitly disabled, and :enabled-for-modes
;; not explicitly specified by user (meaning if it isn't explicitly
;; disabled then it's enabled)
(and (null enabled-for-modes) (not disabled-for-parent)))))

+ 106
- 37
emacs.d/layers/+distributions/spacemacs-base/keybindings.el View File

@ -1,6 +1,6 @@
;;; keybindings.el --- Spacemacs Base Layer key-bindings File ;;; keybindings.el --- Spacemacs Base Layer key-bindings File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -130,6 +130,10 @@
"bs" 'spacemacs/switch-to-scratch-buffer "bs" 'spacemacs/switch-to-scratch-buffer
"bY" 'spacemacs/copy-whole-buffer-to-clipboard "bY" 'spacemacs/copy-whole-buffer-to-clipboard
"bw" 'read-only-mode) "bw" 'read-only-mode)
(dotimes (i 9)
(let ((n (+ i 1)))
(spacemacs/set-leader-keys (format "b%i" n)
(intern (format "buffer-to-window-%s" n)))))
;; Cycling settings ----------------------------------------------------------- ;; Cycling settings -----------------------------------------------------------
(spacemacs/set-leader-keys "Tn" 'spacemacs/cycle-spacemacs-theme) (spacemacs/set-leader-keys "Tn" 'spacemacs/cycle-spacemacs-theme)
;; errors --------------------------------------------------------------------- ;; errors ---------------------------------------------------------------------
@ -229,6 +233,7 @@
"cr" 'recompile "cr" 'recompile
"cd" 'spacemacs/close-compilation-window) "cd" 'spacemacs/close-compilation-window)
(with-eval-after-load 'compile (with-eval-after-load 'compile
(evil-define-key 'motion compilation-mode-map (kbd "gf") 'find-file-at-point)
(define-key compilation-mode-map "r" 'recompile) (define-key compilation-mode-map "r" 'recompile)
(define-key compilation-mode-map "g" nil)) (define-key compilation-mode-map "g" nil))
;; narrow & widen ------------------------------------------------------------- ;; narrow & widen -------------------------------------------------------------
@ -303,7 +308,15 @@
:on (hidden-mode-line-mode -1) :on (hidden-mode-line-mode -1)
:off (hidden-mode-line-mode) :off (hidden-mode-line-mode)
:documentation "Toggle the visibility of modeline." :documentation "Toggle the visibility of modeline."
:evil-leader "tmT")
(spacemacs|add-toggle display-time
:mode display-time-mode
:documentation "Display time in modeline."
:evil-leader "tmt") :evil-leader "tmt")
(spacemacs|add-toggle syntax-highlighting
:mode font-lock-mode
:documentation "Toggle syntax highlighting."
:evil-leader "ths")
(spacemacs|add-toggle transparent-frame (spacemacs|add-toggle transparent-frame
:status nil :status nil
:on (spacemacs/toggle-transparency) :on (spacemacs/toggle-transparency)
@ -353,6 +366,7 @@
(golden-ratio))) (golden-ratio)))
(spacemacs/set-leader-keys (spacemacs/set-leader-keys
"w TAB" 'spacemacs/alternate-window
"w2" 'spacemacs/layout-double-columns "w2" 'spacemacs/layout-double-columns
"w3" 'spacemacs/layout-triple-columns "w3" 'spacemacs/layout-triple-columns
"wb" 'spacemacs/switch-to-minibuffer-window "wb" 'spacemacs/switch-to-minibuffer-window
@ -380,7 +394,7 @@
"wc" 'spacemacs/toggle-centered-buffer-mode "wc" 'spacemacs/toggle-centered-buffer-mode
"wC" 'spacemacs/centered-buffer-mode-full-width "wC" 'spacemacs/centered-buffer-mode-full-width
"wo" 'other-frame "wo" 'other-frame
"wr" 'spacemacs/rotate-windows
"wr" 'spacemacs/rotate-windows-forward
"wR" 'spacemacs/rotate-windows-backward "wR" 'spacemacs/rotate-windows-backward
"ws" 'split-window-below "ws" 'split-window-below
"wS" 'split-window-below-and-focus "wS" 'split-window-below-and-focus
@ -392,6 +406,7 @@
"ww" 'other-window "ww" 'other-window
"w/" 'split-window-right "w/" 'split-window-right
"w=" 'balance-windows "w=" 'balance-windows
"w+" 'spacemacs/window-layout-toggle
"w_" 'spacemacs/maximize-horizontally) "w_" 'spacemacs/maximize-horizontally)
;; text ----------------------------------------------------------------------- ;; text -----------------------------------------------------------------------
(defalias 'count-region 'count-words-region) (defalias 'count-region 'count-words-region)
@ -418,7 +433,11 @@
"xjl" 'set-justification-left "xjl" 'set-justification-left
"xjn" 'set-justification-none "xjn" 'set-justification-none
"xjr" 'set-justification-right "xjr" 'set-justification-right
"xlc" 'spacemacs/sort-lines-by-column
"xlC" 'spacemacs/sort-lines-by-column-reverse
"xld" 'spacemacs/duplicate-line-or-region
"xls" 'spacemacs/sort-lines "xls" 'spacemacs/sort-lines
"xlS" 'spacemacs/sort-lines-reverse
"xlu" 'spacemacs/uniquify-lines "xlu" 'spacemacs/uniquify-lines
"xtc" 'transpose-chars "xtc" 'transpose-chars
"xtl" 'transpose-lines "xtl" 'transpose-lines
@ -446,12 +465,44 @@
(spacemacs|define-transient-state buffer (spacemacs|define-transient-state buffer
:title "Buffer Selection Transient State" :title "Buffer Selection Transient State"
:doc (concat "
[_C-1_.._C-9_] goto nth window [_n_]^^ next buffer
[_1_.._9_] move buffer to nth window [_N_/_p_] previous buffer
[_M-1_.._M-9_] swap buffer w/ nth window [_d_]^^ kill buffer
^^^^ [_q_]^^ quit")
:bindings :bindings
("n" next-buffer "next")
("N" previous-buffer "previous")
("p" previous-buffer "previous")
("K" spacemacs/kill-this-buffer "kill")
("q" nil "quit" :exit t))
("n" next-buffer)
("N" previous-buffer)
("p" previous-buffer)
("d" spacemacs/kill-this-buffer)
("q" nil :exit t)
("1" move-buffer-window-no-follow-1)
("2" move-buffer-window-no-follow-2)
("3" move-buffer-window-no-follow-3)
("4" move-buffer-window-no-follow-4)
("5" move-buffer-window-no-follow-5)
("6" move-buffer-window-no-follow-6)
("7" move-buffer-window-no-follow-7)
("8" move-buffer-window-no-follow-8)
("9" move-buffer-window-no-follow-9)
("M-1" swap-buffer-window-no-follow-1)
("M-2" swap-buffer-window-no-follow-2)
("M-3" swap-buffer-window-no-follow-3)
("M-4" swap-buffer-window-no-follow-4)
("M-5" swap-buffer-window-no-follow-5)
("M-6" swap-buffer-window-no-follow-6)
("M-7" swap-buffer-window-no-follow-7)
("M-8" swap-buffer-window-no-follow-8)
("M-9" swap-buffer-window-no-follow-9)
("C-1" winum-select-window-1)
("C-2" winum-select-window-2)
("C-3" winum-select-window-3)
("C-4" winum-select-window-4)
("C-5" winum-select-window-5)
("C-6" winum-select-window-6)
("C-7" winum-select-window-7)
("C-8" winum-select-window-8)
("C-9" winum-select-window-9))
(spacemacs/set-leader-keys "b." 'spacemacs/buffer-transient-state/body) (spacemacs/set-leader-keys "b." 'spacemacs/buffer-transient-state/body)
;; end of Buffer transient state ;; end of Buffer transient state
@ -481,28 +532,29 @@
(spacemacs|define-transient-state window-manipulation (spacemacs|define-transient-state window-manipulation
:title "Window Manipulation Transient State" :title "Window Manipulation Transient State"
:doc (concat " :doc (concat "
Select^^^^ Move^^^^ Split^^ Resize^^ Other^^
^^^^ ^^^^ ^^ ^^ ^^
[_j_/_k_] down/up [_J_/_K_] down/up [_s_] vertical [_[_] shrink horizontally [_q_] quit
[_h_/_l_] left/right [_H_/_L_] left/right [_S_] vert & follow [_]_] enlarge horizontally [_u_] restore prev layout
[_0_-_9_] window N [_r_]^^ rotate fwd [_v_] horizontal [_{_] shrink vertically [_U_] restore next layout
[_w_]^^ other window [_R_]^^ rotate bwd [_V_] horiz & follow [_}_] enlarge vertically [_d_] close current
[_o_]^^ other frame ^^^^ ^^ ^^ [_D_] close other"
Select^^^^ Move^^^^ Split^^ Resize^^ Other^^
^^^^ ^^^^ ^^ ^^ ^^
[_j_/_k_] down/up [_J_/_K_] down/up [_s_] vertical [_[_] shrink horiz [_u_] restore prev layout
[_h_/_l_] left/right [_H_/_L_] left/right [_S_] verti & follow [_]_] enlarge horiz [_U_] restore next layout
[_0_.._9_] window 0..9 [_r_]^^ rotate fwd [_v_] horizontal [_{_] shrink verti [_d_] close current
[_w_]^^ other window [_R_]^^ rotate bwd [_V_] horiz & follow [_}_] enlarge verti [_D_] close other
[_o_]^^ other frame ^^^^ ^^ ^^ "
(if (configuration-layer/package-usedp 'golden-ratio) (if (configuration-layer/package-usedp 'golden-ratio)
"\n ^^^^ ^^^^ ^^ ^^ [_g_] golden-ratio %`golden-ratio-mode"
""))
"[_g_] golden-ratio %`golden-ratio-mode"
"")
"\n ^^^^ ^^^^ ^^ ^^ [_q_] quit")
:bindings :bindings
("q" nil :exit t) ("q" nil :exit t)
("0" select-window-0)
("1" select-window-1)
("2" select-window-2)
("3" select-window-3)
("4" select-window-4)
("5" select-window-5)
("6" select-window-6)
("7" select-window-7)
("8" select-window-8)
("9" select-window-9)
("0" winum-select-window-0)
("1" winum-select-window-1)
("2" winum-select-window-2)
("3" winum-select-window-3)
("4" winum-select-window-4)
("5" winum-select-window-5)
("6" winum-select-window-6)
("7" winum-select-window-7)
("8" winum-select-window-8)
("9" winum-select-window-9)
("-" split-window-below-and-focus) ("-" split-window-below-and-focus)
("/" split-window-right-and-focus) ("/" split-window-right-and-focus)
("[" spacemacs/shrink-window-horizontally) ("[" spacemacs/shrink-window-horizontally)
@ -528,7 +580,7 @@
("L" evil-window-move-far-right) ("L" evil-window-move-far-right)
("<S-right>" evil-window-move-far-right) ("<S-right>" evil-window-move-far-right)
("o" other-frame) ("o" other-frame)
("r" spacemacs/rotate-windows)
("r" spacemacs/rotate-windows-forward)
("R" spacemacs/rotate-windows-backward) ("R" spacemacs/rotate-windows-backward)
("s" split-window-below) ("s" split-window-below)
("S" split-window-below-and-focus) ("S" split-window-below-and-focus)
@ -589,20 +641,37 @@ otherwise it is scaled down."
"Toggle between transparent and opaque state for FRAME. "Toggle between transparent and opaque state for FRAME.
If FRAME is nil, it defaults to the selected frame." If FRAME is nil, it defaults to the selected frame."
(interactive) (interactive)
(let* ((alpha (frame-parameter frame 'alpha))
(dotfile-setting (cons dotspacemacs-active-transparency
dotspacemacs-inactive-transparency)))
(set-frame-parameter
frame 'alpha
(if (not (equal alpha dotfile-setting))
dotfile-setting
'(100 . 100)))))
(let ((alpha (frame-parameter frame 'alpha))
(dotfile-setting (cons dotspacemacs-active-transparency
dotspacemacs-inactive-transparency)))
(if (equal alpha dotfile-setting)
(spacemacs/disable-transparency frame)
(spacemacs/enable-transparency frame dotfile-setting))))
(defun spacemacs/enable-transparency (&optional frame alpha)
"Enable transparency for FRAME.
If FRAME is nil, it defaults to the selected frame.
ALPHA is a pair of active and inactive transparency values. The
default value for ALPHA is based on
`dotspacemacs-active-transparency' and
`dotspacemacs-inactive-transparency'."
(interactive)
(let ((alpha-setting (or alpha
(cons dotspacemacs-active-transparency
dotspacemacs-inactive-transparency))))
(set-frame-parameter frame 'alpha alpha-setting)))
(defun spacemacs/disable-transparency (&optional frame)
"Disable transparency for FRAME.
If FRAME is nil, it defaults to the selected frame."
(interactive)
(set-frame-parameter frame 'alpha '(100 . 100)))
(defun spacemacs/increase-transparency (&optional frame) (defun spacemacs/increase-transparency (&optional frame)
"Increase transparency for FRAME. "Increase transparency for FRAME.
If FRAME is nil, it defaults to the selected frame." If FRAME is nil, it defaults to the selected frame."
(interactive) (interactive)
(let* ((current-alpha (car (frame-parameter frame 'alpha)))
(let* ((current-alpha (or (car (frame-parameter frame 'alpha)) 100))
(increased-alpha (- current-alpha 5))) (increased-alpha (- current-alpha 5)))
(when (>= increased-alpha frame-alpha-lower-limit) (when (>= increased-alpha frame-alpha-lower-limit)
(set-frame-parameter frame 'alpha (set-frame-parameter frame 'alpha
@ -612,7 +681,7 @@ If FRAME is nil, it defaults to the selected frame."
"Decrease transparency for FRAME. "Decrease transparency for FRAME.
If FRAME is nil, it defaults to the selected frame." If FRAME is nil, it defaults to the selected frame."
(interactive) (interactive)
(let* ((current-alpha (car (frame-parameter frame 'alpha)))
(let* ((current-alpha (or (car (frame-parameter frame 'alpha)) 100))
(decreased-alpha (+ current-alpha 5))) (decreased-alpha (+ current-alpha 5)))
(when (<= decreased-alpha 100) (when (<= decreased-alpha 100)
(set-frame-parameter frame 'alpha (set-frame-parameter frame 'alpha


+ 1
- 1
emacs.d/layers/+distributions/spacemacs-base/local/centered-buffer-mode/centered-buffer-mode.el View File

@ -41,7 +41,7 @@ that differed modifications won't cause an overflow."
:type 'integer :type 'integer
:group 'spacemacs-centered-buffer-mode) :group 'spacemacs-centered-buffer-mode)
(defcustom spacemacs-centered-buffer-mode-fringe-color "black"
(defcustom spacemacs-centered-buffer-mode-fringe-color (face-background 'default)
"Color of the fringes." "Color of the fringes."
:type 'color :type 'color
:group 'spacemacs-centered-buffer-mode) :group 'spacemacs-centered-buffer-mode)


+ 7
- 7
emacs.d/layers/+distributions/spacemacs-base/local/evil-evilified-state/evil-evilified-state.el View File

@ -1,6 +1,6 @@
;;; evil-evilified-state.el --- A minimalistic evil state ;;; evil-evilified-state.el --- A minimalistic evil state
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; Keywords: convenience editing evil spacemacs ;; Keywords: convenience editing evil spacemacs
@ -30,14 +30,14 @@
;; The shadowed original mode key bindings are automatically reassigned ;; The shadowed original mode key bindings are automatically reassigned
;; following a set of rules: ;; following a set of rules:
;; Keys such as
;; /,:,h,j,k,l,n,N,v,V,gg,G,C-f,C-b,C-d,C-e,C-u,C-y and C-z
;; Keys such as
;; /,:,h,j,k,l,n,N,v,V,gg,G,C-f,C-b,C-d,C-e,C-u,C-y and C-z
;; are working as in Evil. ;; are working as in Evil.
;; Other keys will be moved according to this pattern: ;; Other keys will be moved according to this pattern:
;; a -> A -> C-a -> C-A ;; a -> A -> C-a -> C-A
;; The first unreserved key will be used.
;; The first unreserved key will be used.
;; There is an exception for g, which will be directly ;; There is an exception for g, which will be directly
;; bound to C-G, since G and C-g (latest being an important escape key in Emacs)
;; bound to C-G, since G and C-g (latest being an important escape key in Emacs)
;; are already being used. ;; are already being used.
;;; Code: ;;; Code:
@ -275,8 +275,8 @@ Each pair KEYn FUNCTIONn is defined in MAP after the evilification of it."
(evilified-state--find-new-event event) nil (evilified-state--find-new-event event) nil
processed pending-funcs))) processed pending-funcs)))
(when pending-funcs (when pending-funcs
(spacemacs-buffer/warning
(concat (format (concat "Auto-evilication could not remap these "
(message
(concat (format (concat "Auto-evilification could not remap these "
"functions in map `%s':\n") "functions in map `%s':\n")
map-symbol) map-symbol)
(mapconcat (lambda (x) (mapconcat (lambda (x)


+ 1
- 1
emacs.d/layers/+distributions/spacemacs-base/local/holy-mode/holy-mode.el View File

@ -1,6 +1,6 @@
;;; holy-mode.el --- Enter the church of Emacs ;;; holy-mode.el --- Enter the church of Emacs
;; Copyright (C) 2014-2015 syl20bnr
;; Copyright (c) 2015-2017 Sylvain Benner
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; Keywords: convenience editing ;; Keywords: convenience editing


+ 1
- 1
emacs.d/layers/+distributions/spacemacs-base/local/hybrid-mode/hybrid-mode.el View File

@ -108,7 +108,7 @@
;; This code is from evil insert state definition, any change upstream ;; This code is from evil insert state definition, any change upstream
;; should be reflected here ;; should be reflected here
;; see https://bitbucket.org/lyro/evil/src/a25b848c90c7942fe89d9ec283c6bb44fb7b3cf4/evil-states.el?fileviewer=file-view-default#evil-states.el-74
;; see https://github.com/emacs-evil/evil/blob/56e92f7cb4e04e665670460093b41f58446b7a2b/evil-states.el#L108
(evil-define-state hybrid (evil-define-state hybrid
"Hybrid state for hybrid mode." "Hybrid state for hybrid mode."
:tag " <H> " :tag " <H> "


+ 22
- 13
emacs.d/layers/+distributions/spacemacs-base/packages.el View File

@ -1,6 +1,6 @@
;;; packages.el --- Spacemacs Base Layer packages File ;;; packages.el --- Spacemacs Base Layer packages File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -45,7 +45,7 @@
(recentf :location built-in) (recentf :location built-in)
(savehist :location built-in) (savehist :location built-in)
(saveplace :location built-in) (saveplace :location built-in)
spacemacs-theme
(spacemacs-theme :location built-in)
(subword :location built-in) (subword :location built-in)
(tar-mode :location built-in) (tar-mode :location built-in)
(uniquify :location built-in) (uniquify :location built-in)
@ -240,16 +240,25 @@
:init (spacemacs/set-leader-keys "ji" 'imenu))) :init (spacemacs/set-leader-keys "ji" 'imenu)))
(defun spacemacs-base/init-linum () (defun spacemacs-base/init-linum ()
(when dotspacemacs-line-numbers
(add-hook 'prog-mode-hook 'linum-mode)
(add-hook 'text-mode-hook 'linum-mode))
(setq linum-format "%4d")
(spacemacs|add-toggle line-numbers
:mode linum-mode
:documentation "Show the line numbers."
:evil-leader "tn")
(advice-add #'linum-update-window
:after #'spacemacs/linum-update-window-scale-fix))
(use-package linum
:init
(progn
(setq linum-format "%4d")
(spacemacs|add-toggle line-numbers
:mode linum-mode
:documentation "Show the line numbers."
:evil-leader "tn")
(advice-add #'linum-update-window
:after #'spacemacs//linum-update-window-scale-fix)
(advice-add #'linum-on
:around #'spacemacs//linum-on))
:config
(progn
(when (spacemacs//linum-backward-compabitility)
(add-hook 'prog-mode-hook 'linum-mode)
(add-hook 'text-mode-hook 'linum-mode))
(when dotspacemacs-line-numbers
(global-linum-mode)))))
(defun spacemacs-base/init-occur-mode () (defun spacemacs-base/init-occur-mode ()
(evilified-state-evilify-map occur-mode-map (evilified-state-evilify-map occur-mode-map
@ -345,7 +354,7 @@
"pc" 'projectile-compile-project "pc" 'projectile-compile-project
"pD" 'projectile-dired "pD" 'projectile-dired
"pg" 'projectile-find-tag "pg" 'projectile-find-tag
"p C-g" 'projectile-regenerate-tags
"pG" 'projectile-regenerate-tags
"pI" 'projectile-invalidate-cache "pI" 'projectile-invalidate-cache
"pk" 'projectile-kill-buffers "pk" 'projectile-kill-buffers
"pR" 'projectile-replace "pR" 'projectile-replace


+ 1
- 1
emacs.d/layers/+distributions/spacemacs-bootstrap/config.el View File

@ -1,6 +1,6 @@
;;; config.el --- Spacemacs Bootstrap Layer configuration File ;;; config.el --- Spacemacs Bootstrap Layer configuration File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 1
emacs.d/layers/+distributions/spacemacs-bootstrap/funcs.el View File

@ -1,6 +1,6 @@
;;; funcs.el --- Spacemacs Bootstrap Layer functions File ;;; funcs.el --- Spacemacs Bootstrap Layer functions File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 16
- 6
emacs.d/layers/+distributions/spacemacs-bootstrap/packages.el View File

@ -1,6 +1,6 @@
;;; packages.el --- Mandatory Bootstrap Layer packages File ;;; packages.el --- Mandatory Bootstrap Layer packages File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -135,6 +135,7 @@
(define-key evil-normal-state-map (kbd "K") 'spacemacs/evil-smart-doc-lookup) (define-key evil-normal-state-map (kbd "K") 'spacemacs/evil-smart-doc-lookup)
(define-key evil-normal-state-map (kbd "gd") 'spacemacs/jump-to-definition) (define-key evil-normal-state-map (kbd "gd") 'spacemacs/jump-to-definition)
(define-key evil-normal-state-map (kbd "gD") 'spacemacs/jump-to-definition-other-window)
;; scrolling transient state ;; scrolling transient state
(spacemacs|define-transient-state scroll (spacemacs|define-transient-state scroll
@ -275,13 +276,14 @@
(spacemacs/set-leader-keys "hk" 'which-key-show-top-level) (spacemacs/set-leader-keys "hk" 'which-key-show-top-level)
;; Needed to avoid nil variable error before update to recent which-key
(defvar which-key-replacement-alist nil)
;; Replace rules for better naming of functions ;; Replace rules for better naming of functions
(let ((new-descriptions (let ((new-descriptions
;; being higher in this list means the replacement is applied later ;; being higher in this list means the replacement is applied later
'( '(
("spacemacs/\\(.+\\)" . "\\1") ("spacemacs/\\(.+\\)" . "\\1")
("spacemacs/toggle-\\(.+\\)" . "\\1") ("spacemacs/toggle-\\(.+\\)" . "\\1")
("select-window-\\([0-9]\\)" . "window \\1")
("spacemacs/alternate-buffer" . "last buffer") ("spacemacs/alternate-buffer" . "last buffer")
("spacemacs/toggle-mode-line-\\(.+\\)" . "\\1") ("spacemacs/toggle-mode-line-\\(.+\\)" . "\\1")
("avy-goto-word-or-subword-1" . "avy word") ("avy-goto-word-or-subword-1" . "avy word")
@ -300,12 +302,20 @@
("spacemacs/toggle-hybrid-mode" . "hybrid (hybrid-mode)") ("spacemacs/toggle-hybrid-mode" . "hybrid (hybrid-mode)")
("spacemacs/toggle-holy-mode" . "emacs (holy-mode)") ("spacemacs/toggle-holy-mode" . "emacs (holy-mode)")
("evil-lisp-state-\\(.+\\)" . "\\1") ("evil-lisp-state-\\(.+\\)" . "\\1")
("\\(.+\\)-transient-state/\\(.+\\)" . "\\2")
("\\(.+\\)-transient-state/body" . "\\1-transient-state"))))
("spacemacs/\\(.+\\)-transient-state/\\(.+\\)" . "\\2")
("spacemacs/\\(.+\\)-transient-state/body" . "\\1-transient-state"))))
(dolist (nd new-descriptions) (dolist (nd new-descriptions)
;; ensure the target matches the whole string ;; ensure the target matches the whole string
(push (cons (concat "\\`" (car nd) "\\'") (cdr nd))
which-key-description-replacement-alist)))
(push (cons (cons nil (concat "\\`" (car nd) "\\'")) (cons nil (cdr nd)))
which-key-replacement-alist)))
(push '(("\\(.*\\) 0" . "select-window-0") . ("\\1 0..9" . "window 0..9"))
which-key-replacement-alist)
(push '((nil . "select-window-[1-9]") . t) which-key-replacement-alist)
(push '(("\\(.*\\) 1" . "buffer-to-window-1") . ("\\1 1..9" . "buffer to window 1..9"))
which-key-replacement-alist)
(push '((nil . "buffer-to-window-[2-9]") . t) which-key-replacement-alist)
(dolist (leader-key `(,dotspacemacs-leader-key ,dotspacemacs-emacs-leader-key)) (dolist (leader-key `(,dotspacemacs-leader-key ,dotspacemacs-emacs-leader-key))
(which-key-add-key-based-replacements (which-key-add-key-based-replacements


+ 6
- 1
emacs.d/layers/+distributions/spacemacs/layers.el View File

@ -1,6 +1,6 @@
;;; layers.el --- Spacemacs Layer layers File ;;; layers.el --- Spacemacs Layer layers File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -26,3 +26,8 @@
(unless (or (configuration-layer/layer-usedp 'ivy) (unless (or (configuration-layer/layer-usedp 'ivy)
(configuration-layer/layer-usedp 'helm)) (configuration-layer/layer-usedp 'helm))
(configuration-layer/declare-layers '(helm))) (configuration-layer/declare-layers '(helm)))
(when (and (configuration-layer/layer-usedp 'ivy)
(configuration-layer/layer-usedp 'helm))
(spacemacs-buffer/warning (concat "Both the `helm' and `ivy' layers are enabled. "
"This may lead to unexpected behaviour.")))

+ 1
- 1
emacs.d/layers/+emacs/better-defaults/config.el View File

@ -1,6 +1,6 @@
;;; config.el --- Better Emacs Defaults Layer configuration variables File ;;; config.el --- Better Emacs Defaults Layer configuration variables File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Thomas de Beauchêne <thomas.de.beauchene@gmail.com> ;; Author: Thomas de Beauchêne <thomas.de.beauchene@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs


+ 1
- 12
emacs.d/layers/+emacs/better-defaults/funcs.el View File

@ -1,6 +1,6 @@
;;; funcs.el --- Better Emacs Defaults Layer functions File ;;; funcs.el --- Better Emacs Defaults Layer functions File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -19,14 +19,3 @@
;; correctly (see https://github.com/syl20bnr/spacemacs/issues/3278) ;; correctly (see https://github.com/syl20bnr/spacemacs/issues/3278)
(call-interactively #'kill-region) (call-interactively #'kill-region)
(backward-kill-word arg))) (backward-kill-word arg)))
;; http://endlessparentheses.com/fill-and-unfill-paragraphs-with-a-single-key.html
(defun spacemacs/fill-or-unfill ()
"Like `fill-paragraph', but unfill if used twice."
(interactive)
(let ((fill-column
(if (eq last-command 'spacemacs/fill-or-unfill)
(progn (setq this-command nil)
(point-max))
fill-column)))
(call-interactively #'fill-paragraph)))

+ 1
- 2
emacs.d/layers/+emacs/better-defaults/keybindings.el View File

@ -1,6 +1,6 @@
;;; keybindings.el --- Better Emacs Defaults Layer key bindings File ;;; keybindings.el --- Better Emacs Defaults Layer key bindings File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -10,4 +10,3 @@
;;; License: GPLv3 ;;; License: GPLv3
(global-set-key (kbd "C-w") 'spacemacs/backward-kill-word-or-region) (global-set-key (kbd "C-w") 'spacemacs/backward-kill-word-or-region)
(global-set-key [remap fill-paragraph] #'spacemacs/fill-or-unfill)

+ 10
- 2
emacs.d/layers/+emacs/better-defaults/packages.el View File

@ -1,6 +1,6 @@
;;; packages.el --- Better Emacs Defaults Layer functions File ;;; packages.el --- Better Emacs Defaults Layer functions File
;; ;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;; ;;
;; Author: Thomas de Beauchêne <thomas.de.beauchene@gmail.com> ;; Author: Thomas de Beauchêne <thomas.de.beauchene@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs ;; URL: https://github.com/syl20bnr/spacemacs
@ -10,7 +10,8 @@
;;; License: GPLv3 ;;; License: GPLv3
(defconst better-defaults-packages (defconst better-defaults-packages
'(mwim)
'(mwim
unfill)
"The list of Lisp packages required by the mwim layer.") "The list of Lisp packages required by the mwim layer.")
(defun better-defaults/init-mwim () (defun better-defaults/init-mwim ()
@ -25,3 +26,10 @@
(if better-defaults-move-to-end-of-code-first (if better-defaults-move-to-end-of-code-first
(global-set-key (kbd "C-e") 'mwim-end-of-code-or-line) (global-set-key (kbd "C-e") 'mwim-end-of-code-or-line)
(global-set-key (kbd "C-e") 'mwim-end-of-line-or-code))))) (global-set-key (kbd "C-e") 'mwim-end-of-line-or-code)))))
(defun better-defaults/init-unfill ()
(use-package unfill
:defer t
:commands (unfill-region unfill-paragraph unfill-toggle)
:init
(global-set-key [remap fill-paragraph] #'unfill-toggle)))

+ 16
- 5
emacs.d/layers/+emacs/ibuffer/README.org View File

@ -6,10 +6,12 @@
- [[#layer][Layer]] - [[#layer][Layer]]
- [[#grouping-buffers][Grouping buffers]] - [[#grouping-buffers][Grouping buffers]]
- [[#key-bindings][Key bindings]] - [[#key-bindings][Key bindings]]
- [[#global][Global]]
- [[#ibuffer][IBuffer]]
* Description * Description
This layer configures Emacs ibuffer for Spacemacs.
This layer configures Emacs IBuffer for Spacemacs.
* Install * Install
** Layer ** Layer
@ -36,9 +38,18 @@ Example:
#+END_SRC #+END_SRC
* Key bindings * Key bindings
** Global
| Key Binding | Description |
|-------------+-------------------|
| ~SPC b B~ | open ibuffer menu |
| Key Binding | Description |
|-------------+-------------------------------|
| ~SPC b B~ | open IBuffer menu (global) |
*Note:* The layer will also replace regular ~C-x C-b~ by ibuffer.
*Note:* The layer will also replace regular ~C-x C-b~ with =ibuffer=.
** IBuffer
| Key Binding | Description |
|-------------+-------------------------------|
| ~g r~ | update IBuffer ("refresh") |
| ~g j~ | move to next filter group |
| ~g k~ | move to previous filter group |

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save