Skip to content

Commit

Permalink
Merge branch 'develop' (v0.49.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Jan 26, 2015
2 parents a48cee6 + 0e46304 commit 0e4dc90
Show file tree
Hide file tree
Showing 33 changed files with 1,234 additions and 442 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ before_install:
sudo apt-get -qqy install emacs-snapshot;

script:
emacs -batch -l ert -l core/test/* -f ert-run-tests-batch-and-exit
./travis/run_build.sh
65 changes: 43 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
***
![title](https://raw.githubusercontent.com/syl20bnr/spacemacs/master/doc/img/title.png)
![title](./doc/img/title.png)
[philosophy][] | [goals][] | [for who?][] | [screenshots][] | [documentation][DOCUMENTATION.md] | [contribute][CONTRIBUTE.md] | [achievements][] | [FAQ][]
***
[![Build Status](https://travis-ci.org/syl20bnr/spacemacs.svg)](https://travis-ci.org/syl20bnr/spacemacs) [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/syl20bnr/spacemacs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Twitter][]](http://www.twitter.com/spacemacs)
Expand Down Expand Up @@ -212,53 +212,72 @@ Update of `Spacemacs` by clicking on the indicator will be implemented _soon_.
# Configuration

`Spacemacs` divides its configuration into self-contained units called
[configuration layers][config]. It uses a dotfile, `~/.spacemacs`, to control
which of these features to enable.
[configuration layers][config]. These layers can be stacked on top of each other
to achieve a custom configuration.

`Spacemacs` also uses a dotfile `~/.spacemacs` to control which layers to
load and to quick configure some `Spacemacs` features.

## Configuration layers

A configuration layer is a directory containing at least the following files:

- `packages.el`: Defines and configures packages to be downloaded from Emacs package repositories
- `extensions.el`: Configures packages that do not need to be downloaded with
the package manager, such as built-in Emacs features and git submodules.
- `packages.el`: Defines and configures packages to be downloaded from Emacs
package repositories using `package.el`
- `extensions.el`: Configures packages which cannot be downloaded with
`package.el` such as built-in Emacs features and git submodules.

You should create your own configuration layers in the [private][] directory.
The following command automates this process:
If you already have your own `Emacs` configuration you can move it to your
own layer.
The following command creates a layer in the `private` directory:

<SPC> : configuration-layer/create-layer RET

_Caveat:_ For your privacy, the contents of the `private` directory are not
under source control. See the documentation for a discussion on how to
[manage your private configuration][manage_config].

Any configuration layers you create must be explicitly loaded in your
`~/.spacemacs` file.

**Note:** For your privacy, the contents of the `private` directory are not
under source control. See the documentation for a discussion on how to
[manage your private configuration][manage_config].

## Dotfile (.spacemacs)

The `.spacemacs` file controls which features to load and provides a way to
customize Spacemacs.
The `.spacemacs` file controls which configuration layers to load and provides
a way to customize `Spacemacs`.

The following command will create `.spacemacs` in your home directory:
The following command will create a `.spacemacs` file in your home directory:

<SPC> : dotspacemacs/install RET

To open the installed dotfile:

<SPC> f e d

To load configuration layers, add them to the list beside
Example to load some configuration layers using the variable
`dotspacemacs-configuration-layers`:

```lisp
```elisp
;; List of configuration layers to load.
dotspacemacs-configuration-layers '(company-mode smex)
```

The comments in this file contain further information about how to customize
Spacemacs. See the [dotfile configuration][dotfile] section of the documentation
for more information.
Some configuration layers have configuration variables to enable specific
support. For instance the [git layer][] has several configuration variables,
they can be set directly in the `dotspacemacs-configuration-layers` like this:

```elisp
;; List of configuration layers to load.
dotspacemacs-configuration-layers '(company-mode
(git :variables
git-magit-status-fullscreen t
git-enable-github-support t
git-gutter-use-fringe t)
smex)
```

The [comments in this file][dotfile template] contain further information about
how to customize Spacemacs. See the [dotfile configuration][dotfile] section of
the documentation for more information.

# Learning Spacemacs

Expand Down Expand Up @@ -391,17 +410,19 @@ info on this.
[achievements]: doc/DOCUMENTATION.md#achievements
[troubleshoot]: doc/DOCUMENTATION.md#troubleshoot
[contrib layers]: doc/DOCUMENTATION.md#using-configuration-layers
[Git support]: doc/DOCUMENTATION.md#working-with-git
[Git support]: contrib/git/README.md
[git layer]: contrib/git
[ace-jump]: doc/DOCUMENTATION.md#vim-motions-with-ace-jump-mode
[project management]: doc/DOCUMENTATION.md#project-management
[Evil Mode]: doc/DOCUMENTATION.md#evil
[private]: https://github.com/syl20bnr/spacemacs/tree/master/private
[private]: ./private
[DOCUMENTATION.md]: doc/DOCUMENTATION.md
[font section]: doc/DOCUMENTATION.md#font
[CONTRIBUTE.md]: doc/CONTRIBUTE.md
[powerline-seps]: doc/DOCUMENTATION.md#powerline-separators
[FAQ]: https://github.com/syl20bnr/spacemacs#faq
[dotfile]: https://github.com/syl20bnr/spacemacs#dotfile-spacemacs
[dotfile template]: ./core/templates/.spacemacs.template
[install OSX section]: https://github.com/syl20bnr/spacemacs#os-x
[osx layer]: contrib/osx/README.md
[guide-key]: https://github.com/kai2nenobu/guide-key
Expand Down
1 change: 0 additions & 1 deletion contrib/auctex/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@

(setq-default TeX-auto-save t)
(setq-default TeX-parse-self t)
(setq-default TeX-master nil)
(setq-default TeX-PDF-mode t))))

(defun auctex/init-evil-matchit ()
Expand Down
35 changes: 30 additions & 5 deletions contrib/colors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,28 @@
- [Install](#install)
- [Key bindings](#key-bindings)
- [Rainbow Identifiers](#rainbow-identifiers)
- [Screenshots](#screenshots)
- [Python](#python)
- [Rainbow delimiters](#rainbow-delimiters)
- [Rainbow Mode](#rainbow-mode)

<!-- markdown-toc end -->

## Description

This layer colors your life with:
- [rainbow identifiers][]
- [rainbow delimiters][]
- [rainbow mode][]

[rainbow identifiers][] mode will colorize each variables and functions with an
almost unique color. The keywords and the declaration of function colors are
disabled in order to make the colorized variables and functions stand out.

[rainbow delimiters][] highlights delimiters such as parentheses, brackets or
braces according to their depth.

[rainbow mode][] displays strings representing colors with the color they
represent as background.

## Install

To use this contribution add it to your `~/.spacemacs`
Expand All @@ -40,6 +48,8 @@ The prefix associated with colors is <kbd>C</kbd>.

### Rainbow Identifiers

![theme_tweaks_python](img/theme-tweaks-python.png)

`rainbow-identifiers` mode can be toggled on and off with:

<SPC> t C i
Expand All @@ -58,10 +68,25 @@ Key Binding | Description
`=` | reset the `saturation` or `lightness`
Any other key | leave the change mini-mode

## Screenshots
### Rainbow delimiters

### Python
`rainbow-delimiters` mode can be toggled on and off with:

![theme_tweaks_python](img/theme-tweaks-python.png)
<SPC> t C d

Note that the toggle is local to the current buffer.

### Rainbow Mode

![rainbow_mode](img/rainbow-mode.png)

`rainbow-mode` mode can be toggled on and off with:

<SPC> t C c

Note that the toggle is local to the current buffer.

[rainbow identifiers]: https://github.com/Fanael/rainbow-identifiers
[rainbow delimiters]: https://github.com/Fanael/rainbow-delimiters
[rainbow mode]: https://julien.danjou.info/projects/emacs-packages

16 changes: 12 additions & 4 deletions contrib/colors/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@
;; Prefixes
;; ---------------------------------------------------------------------------

(setq spacemacs/key-binding-prefixes '(("C" . "colors")
("Ci" . "colors-identifiers")
("tC" . "toggles-colors")))
;; Variables

(defvar colors-enable-rainbow-identifiers nil
"If non nil the `rainbow-identifers' package is enabled.")

;; Command prefixes

(setq colors/key-binding-prefixes '(("C" . "colors")
("tC" . "toggles-colors")))
(when colors-enable-rainbow-identifiers
(push (cons "Ci" "colors-identifiers") colors/key-binding-prefixes))
(mapc (lambda (x) (spacemacs/declare-prefix (car x) (cdr x)))
spacemacs/key-binding-prefixes)
colors/key-binding-prefixes)
Binary file added contrib/colors/img/rainbow-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 28 additions & 3 deletions contrib/colors/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,30 @@

(defvar colors-packages
'(
rainbow-identifiers
;; not working well for now
;; rainbow-blocks
rainbow-delimiters
rainbow-mode
)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")

(when colors-enable-rainbow-identifiers
(push 'rainbow-identifiers colors-packages))

(defun colors/init-rainbow-blocks ()
(use-package rainbow-blocks
:disabled t
:init (add-hook 'emacs-lisp-mode-hook 'rainbow-blocks-mode)))

(defun colors/init-rainbow-delimiters ()
(use-package rainbow-delimiters
:defer t
:init
(progn
(evil-leader/set-key "tCd" 'rainbow-delimiters-mode)
(add-to-hooks 'rainbow-delimiters-mode '(prog-mode-hook)))))

(defun colors/init-rainbow-identifiers ()
(use-package rainbow-identifiers
:commands rainbow-identifiers-mode
Expand Down Expand Up @@ -87,11 +106,11 @@ disabling some faces in order to make colored identifiers stand out."
(face-all-attributes font-lock-keyword-face frame)))
;; tweak the font locks
(colors//tweak-theme-colors-font-lock)))
(colors//tweak-theme-colors spacemacs-cur-theme)
(colors//tweak-theme-colors spacemacs--cur-theme)

(defadvice spacemacs/post-theme-init (after colors/post-theme-init activate)
"Adjust lightness and brightness of rainbow-identifiers on post theme init."
(colors//tweak-theme-colors spacemacs-cur-theme))
(colors//tweak-theme-colors spacemacs--cur-theme))

:config
(progn
Expand Down Expand Up @@ -172,3 +191,9 @@ Press any other key to exit." component (eval var) component component)))
;; key bindings
(evil-leader/set-key "Cis" 'colors/start-change-color-saturation)
(evil-leader/set-key "Cil" 'colors/start-change-color-lightness))))

(defun colors/init-rainbow-mode ()
(use-package rainbow-mode
:commands rainbow-mode
:init (evil-leader/set-key "tCc" 'rainbow-mode)
:config (spacemacs|hide-lighter rainbow-mode)))
34 changes: 34 additions & 0 deletions contrib/lang/erlang-elixir/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

(defvar erlang-elixir-packages
'(
alchemist
edts
elixir-mode
erlang
Expand All @@ -21,6 +22,39 @@
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")

(defun erlang-elixir/init-alchemist ()
(add-hook 'elixir-mode-hook 'alchemist-mode)
(setq alchemist-project-compile-when-needed t)
(evil-leader/set-key-for-mode 'elixir-mode
"mm:" 'alchemist-mix
"mta" 'alchemist-mix-test
"mtb" 'alchemist-mix-test-this-buffer
"mtt" 'alchemist-mix-test-at-point
"mmc" 'alchemist-mix-compile
"mmx" 'alchemist-mix-run
"mmh" 'alchemist-mix-help
"mgt" 'alchemist-project-open-tests-for-current-file
"mcb" 'alchemist-compile-this-buffer
"mxb" 'alchemist-execute-this-buffer
"mxf" 'alchemist-execute-file
"mx:" 'alchemist-execute
"mh:" 'alchemist-help
"mhH" 'alchemist-help-history
"mhh" 'alchemist-help-search-at-point
"mhr" 'alchemist-help-search-marked-region
"mi" 'alchemist-iex-run
"mmi" 'alchemist-iex-project-run
"msl" 'alchemist-iex-send-current-line
"msL" 'alchemist-iex-send-current-line-and-go
"msr" 'alchemist-iex-send-region
"msR" 'alchemist-iex-send-region-and-go
"mel" 'alchemist-eval-current-line
"meL" 'alchemist-eval-print-current-line
"mer" 'alchemist-eval-region
"meR" 'alchemist-eval-print-region
"meb" 'alchemist-eval-buffer
"meB" 'alchemist-eval-print-buffer))

(defun erlang-elixir/init-edts ()

(defun erlang-elixir//load-edts ()
Expand Down
4 changes: 0 additions & 4 deletions contrib/lang/go/extensions.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
(defvar go-post-extensions
'(
;; post extension gos go here
go-autocomplete
go-oracle
)
"List of all extensions to load after the packages.")
Expand All @@ -21,9 +20,6 @@
;; Often the body of an initialize function uses `use-package'
;; For more info on `use-package', see readme:
;; https://github.com/jwiegley/use-package
(defun go/init-go-autocomplete()
(load-file "$GOPATH/src/github.com/nsf/gocode/emacs/go-autocomplete.el")
)

(defun go/init-go-oracle()
(load-file "$GOPATH/src/code.google.com/p/go.tools/cmd/oracle/oracle.el")
Expand Down
27 changes: 21 additions & 6 deletions contrib/lang/go/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
flycheck
go-mode
go-eldoc
go-autocomplete
company-go
)
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")
Expand All @@ -13,9 +15,9 @@ which require an initialization must be listed explicitly in the list.")
(defun go/init-go-mode()
(use-package go-mode
:defer t
:init
(progn
(evil-leader/set-key
:config
(add-hook 'before-save-hook 'gofmt-before-save)
(evil-leader/set-key-for-mode 'go-mode
"mdp" 'godoc-at-point
"mig" 'go-goto-imports
"mia" 'go-import-add
Expand All @@ -24,10 +26,23 @@ which require an initialization must be listed explicitly in the list.")
"mpr" 'go-play-region
"mpd" 'go-download-play
"mgg" 'godef-jump
))
:config
(add-hook 'before-save-hook 'gofmt-before-save)
)
))

(defun go/init-go-eldoc()
(add-hook 'go-mode-hook 'go-eldoc-setup))

(defun go/init-go-autocomplete()
(use-package go-autocomplete
:if (boundp 'ac-sources)
:defer t
:init (add-to-list 'ac-sources 'ac-source-go)
)
)
(defun go/init-company-go ()
(use-package company-go
:if (boundp 'company-backends)
:defer t
:init (add-to-list 'company-backends 'company-go)
)
)
Loading

0 comments on commit 0e4dc90

Please sign in to comment.