Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Nov 1, 2014
2 parents 21414cc + bd8fe3c commit d30c2b0
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 79 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,3 @@
[submodule "contrib/syl20bnr/extensions/o-blog"]
path = contrib/syl20bnr/extensions/o-blog
url = https://github.com/renard/o-blog.git
[submodule "spacemacs/extensions/evil-nerd-commenter"]
path = spacemacs/extensions/evil-nerd-commenter
url = https://github.com/redguardtoo/evil-nerd-commenter
145 changes: 96 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@ _Jump to [Install](#install) for more info and
- [Structure](#structure)
- [Extensions and Packages declaration and initialization](#extensions-and-packages-declaration-and-initialization)
- [Packages synchronization (Vundle like feature)](#packages-synchronization-vundle-like-feature)
- [Configuration](#configuration)
- [Contribution layers](#contribution-layers)
- [Contribution layers](#contribution-layers)
- [-](#-)
- [Submitting a contribution layer upstream](#submitting-a-contribution-layer-upstream)
- [Themes Megapack example](#themes-megapack-example)
- [Pull Request Guidelines](#pull-request-guidelines)
- [Dotfile Configuration](#dotfile-configuration)
- [Installation](#installation)
- [Content](#content)
- [Using contributions layers](#using-contributions-layers)
- [Adding a contribution layer](#adding-a-contribution-layer)
- [Submitting a contribution layer upstream](#submitting-a-contribution-layer-upstream)
- [Themes Megapack example](#themes-megapack-example)
- [Excluding packages](#excluding-packages)
- [Hooks](#hooks)
- [Custom variables](#custom-variables)
- [Excluding packages](#excluding-packages)
- [Hooks](#hooks)
- [Custom variables](#custom-variables)
- [Main principles](#main-principles)
- [Evil](#evil)
- [States](#states)
Expand Down Expand Up @@ -278,8 +281,7 @@ You have to manually copy the `~/.emacs.d/.spacemacs.template` file to
1) By default, [guide-key][] and [guide-key-tip][] are enabled.

Whenever you press a prefix command (like `<SPC>`) and wait for one second,
a tool tip (GUI) or buffer (terminal) appear listing the possible keys
following this prefix.
a buffer appear listing the possible keys following this prefix.

2) You can also easily get a full list of all the key bindings by pressing:

Expand Down Expand Up @@ -367,45 +369,17 @@ _and_ auto-delete orphan packages in your `elpa` directory.

It effectively makes `Spacemacs` to behave like [Vundle][vundle].

## Configuration

Some user configuration can be performed in your `~/.spacemacs` file.

### Contribution layers
## Contribution layers

`Spacemacs` leverages the configuration layers in order to make it possible for
you to share your own layer with other `Spacemacs` users. This kind of layer is
called `contribution layer`.

#### Using contributions layers

To use a contribution layer, add it to the `dotspacemacs-configuration-layers`
variable of your `~/.spacemacs`.

For instance to add the configuration layer of [RMS](#thank-you):
```elisp
(setq-default dotspacemacs-configuration-layers '(rms))
```
If this layer does not exist you can still try another one in
[the `contrib` directory](https://github.com/syl20bnr/spacemacs/tree/master/contrib).

By default contribution layers are expected to be stored in `~/.emacs.d/contrib`
and we encourage you to submit your layers upstream in order to share them,
grow the package coverage of `Spacemacs` and dispatch responsibilities for their
maintenance. But of course you are free to keep them somewhere else, if this is
your case you can declare additional paths where `Spacemacs` can look for
contribution layers. This is done by setting the list
`dotspacemacs-configuration-layer-path` in your `~/.spacemacs`:

```elisp
(setq-default dotspacemacs-configuration-layer-path '("~/.mycontribs/"))
```

#### Adding a contribution layer

Just create a configuration layer in `~/.emacs.d/contrib` or in a path that is
registered in `dotspacemacs-configuration-layer-path` variable of your
`~/.spacemacs` directory.
`~/.spacemacs` dotile (see the [dotfile section]() for more info on this file).

The base files of a configuration layer (see [structure](#structure)) are
optional so you just have to create only the files you need in your layer.
Expand All @@ -415,14 +389,13 @@ layer).

#### Submitting a contribution layer upstream

`Spacemacs` uses the `git-flow` model, so you'll have to submit your
contributions and fixes as features or hotfixes within a pull-request to apply
against the `develop` branch.

It is recommended to join a `README.md` file with your layer, ideally this file
should document the packages of your layer as well as the key bindings
associated with them.

To submit your contribution layer follow the [guidelines]()
for pull requests.

_Note: by submitting a configuration layer you become the maintainer of it._

#### Themes Megapack example
Expand All @@ -433,11 +406,84 @@ This is a simple contribution layer listing a bunch of themes, you can find it
To install it, just add `themes-megapack` to your `~/.spacemacs`. You have now
installed around 100 themes you are free to try with `<SPC> h t` (helm-themes).

### Excluding packages
## Pull Request Guidelines

`Spacemacs` uses the `git-flow` model, so you'll have to submit your
contributions and fixes within a pull-request to apply against the `develop`
branch.

_Guidelines:_
- always create a branch for your pull request.
- always branch from the `master` branch (this way `develop` remains in a
read-only state from a contributor point of view, it allows the maintainers
to freely perform altering tasks such as rewriting the history).
- commit often in your pull request branch with a concise and clear commit
message. The first line of a commit message should be short, you can explain
in details what you did in a paragraph by skipping a line after the first line.
`often` is subtle, see `Notes` below.
- if your pull request branch forked an old commit (i.e. not the current last
commit in upstream master) then fetch upstream master and rebase your pull
request branch on top of it and resolve any conflict locally in your pull
request branch.
- you are ready to open a pull request.

If you have any question on this process, join the [gitter chatroom][gitter]
and ask your questions there. Do not hesitate to ask your questions even the
simplest one, it will be a pleasure to help you in your desire to contribute!

_Notes:_
I encourage you to not squash too much your commits. Good candidates for squash
are commits which contain reverted modifications. For instance when you was
experimenting on a feature and performed a lot of refactoring in the process,
you can squash the intermediary refactoring commits. Typo commits are also good
candidates for squashing. Anyway, just try to find a good balance between one
huge commit and lot of small commits.

## Dotfile Configuration

User configuration can be stored in your `~/.spacemacs` file.

### Installation

`~/.spacemacs` is an optional file. If you want to use it you have to copy it
manually from the template file `~/.emacs.d/.spacemacs.template`

```sh
$ cp ~/.emacs.d/.spacemacs.template ~/.spacemacs
```

### Content

#### Using contributions layers

To use a contribution layer, add it to the `dotspacemacs-configuration-layers`
variable of your `~/.spacemacs`.

For instance to add the configuration layer of [RMS](#thank-you):
```elisp
(setq-default dotspacemacs-configuration-layers '(rms))
```
If this layer does not exist you can still try another one in
[the `contrib` directory](https://github.com/syl20bnr/spacemacs/tree/master/contrib).

By default contribution layers are expected to be stored in `~/.emacs.d/contrib`
and we encourage you to submit your layers upstream in order to share them,
grow the package coverage of `Spacemacs` and dispatch responsibilities for their
maintenance. But of course you are free to keep them somewhere else, if this is
your case you can declare additional paths where `Spacemacs` can look for
contribution layers. This is done by setting the list
`dotspacemacs-configuration-layer-path` in your `~/.spacemacs`:

```elisp
(setq-default dotspacemacs-configuration-layer-path '("~/.mycontribs/"))
```

#### Excluding packages

You can also 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`, this variable can exclude both packages and
extensions.
extensions (see [Configuration layers](#configuration-layers) for more info
on packages and extensions).

For instance to disable the `rainbow-delimiters` package:
```elisp
Expand All @@ -448,7 +494,7 @@ Note that for now, excluded packages that have been installed are not
uninstalled. You'll have to delete them manually from your `~/.emacs.d/elpa`
directory.

### Hooks
#### Hooks

Two special functions of the `~/.spacemacs` file can be used to perform
configuration at the beginning and end of `Spacemacs` loading process.
Expand All @@ -457,7 +503,7 @@ configuration at the beginning and end of `Spacemacs` loading process.
loading.
- `dotspacemacs/config` is triggered at the very end of `Spacemacs` loading.

### Custom variables
#### Custom variables

Custom variables configuration from `M-x customize-group` which are
automatically saved by Emacs are stored at the end of your `~/.spacemacs`
Expand Down Expand Up @@ -1665,3 +1711,4 @@ Thank you to the whole Emacs community from core developers to elisp hackers!
[themes-megapack]: https://github.com/syl20bnr/spacemacs/tree/master/contrib/themes-megapack
[guide-key]: https://github.com/kai2nenobu/guide-key
[guide-key-tip]: https://github.com/aki2o/guide-key-tip
[gitter]: https://gitter.im/syl20bnr/spacemacs
7 changes: 7 additions & 0 deletions contrib/ranger-control/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ranger Control

This module hooks into the command server in MacRanger to add the command `<SPC> p d`
which adds a special `e` tab in ranger that is in the current projectile directory.

Currently this functionality only works with MacRanger but I plan on making it a plugin
that anyone can install into their ranger.
2 changes: 2 additions & 0 deletions contrib/ranger-control/config.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(evil-leader/set-key
"pc" 'ranger-control/projectile-cd)
12 changes: 12 additions & 0 deletions contrib/ranger-control/funcs.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(defun ranger-control/cd-tab (path)
(start-process "ranger-control-curl" nil "curl" "-X" "POST" "--data" path
"--connect-timeout" "0.1" "http://localhost:5964/cdtab-e"))

(defun ranger-control/kill-result-buffer (status)
"Kill the buffer returned by `url-retrieve'."
(kill-buffer (current-buffer)))

(defun ranger-control/projectile-cd ()
(interactive)
(use-package projectile :init
(ranger-control/cd-tab (projectile-project-root))))
6 changes: 6 additions & 0 deletions contrib/trishume/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Tristan Hume's Contrib Layer

Mostly consists of support for additional languages including:
LaTeX, Idris, OpenSCAD, Julia, Arduino, QML, Lua

Also adds smooth scrolling and Helm Ag support.
71 changes: 62 additions & 9 deletions contrib/trishume/packages.el
Original file line number Diff line number Diff line change
@@ -1,20 +1,54 @@
(defvar trishume-packages
'(
auctex
cdlatex
smooth-scrolling
idris-mode
arduino-mode
scad-mode
qml-mode
julia-mode
helm-ag
lua-mode
))

(defun trishume/init-auctex ()
(use-package tex
:defer t
:config
(progn
(setq-default TeX-auto-save t)
(setq-default TeX-parse-self t)
(setq-default TeX-master nil)
(setq-default TeX-PDF-mode t))))
(defun load-auctex-on-demand ()
(interactive)
(use-package tex
:config
(progn
(use-package smartparens
:config (require 'smartparens-latex))

(defun build-view ()
(interactive)
(if (buffer-modified-p)
(progn
(let ((TeX-save-query nil))
(TeX-save-document (TeX-master-file)))
(setq build-proc (TeX-command "LaTeX" 'TeX-master-file -1))
(set-process-sentinel build-proc 'build-sentinel))
(TeX-view)))

(defun build-sentinel (process event)
(if (string= event "finished\n")
(TeX-view)
(message "Errors! Check with C-`")))

(add-hook 'LaTeX-mode-hook '(lambda () (local-set-key (kbd "H-r") 'build-view)))
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)

(evil-leader/set-key
"oe" 'LaTeX-environment
"oc" 'LaTeX-close-environment)

(setq-default TeX-auto-save t)
(setq-default TeX-parse-self t)
(setq-default TeX-master nil)
(setq-default TeX-PDF-mode t))))
(evil-leader/set-key
"el" 'load-auctex-on-demand))

(defun trishume/init-smooth-scrolling ()
(use-package smooth-scrolling
Expand All @@ -23,6 +57,21 @@
scroll-conservatively 9999
scroll-step 1)))

(defun trishume/init-arduino-mode ()
(use-package arduino-mode :defer t))

(defun trishume/init-idris-mode ()
(use-package idris-mode :defer t))

(defun trishume/init-scad-mode ()
(use-package scad-mode :defer t))

(defun trishume/init-qml-mode ()
(use-package qml-mode :defer t))

(defun trishume/init-julia-mode ()
(use-package julia-mode :defer t))

(defun trishume/init-helm-ag ()
(use-package helm-ag
:init
Expand All @@ -32,3 +81,7 @@
(helm-ag (projectile-project-root)))
(evil-leader/set-key
"pa" 'trishume-helm-ag))))

(defun trishume/init-lua-mode ()
(use-package lua-mode
:defer t))
14 changes: 0 additions & 14 deletions spacemacs/extensions.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
centered-cursor
dos
emoji-cheat-sheet
evil-nerd-commenter
evil-org-mode
evil-plugins
helm-rcirc
Expand Down Expand Up @@ -52,19 +51,6 @@
(use-package emoji-cheat-sheet
:commands emoji-cheat-sheet))

(defun spacemacs/init-evil-nerd-commenter ()
(use-package evil-nerd-commenter
:init
(progn
(evil-leader/set-key
"ncl" 'evilnc-comment-or-uncomment-lines
"nct" 'evilnc-quick-comment-or-uncomment-to-the-line
"ncy" 'evilnc-copy-and-comment-lines
"ncp" 'evilnc-comment-or-uncomment-paragraphs
"ncr" 'comment-or-uncomment-region
"nci" 'evilnc-toggle-invert-comment-line-by-line
"ncc" 'evilnc-comment-operator))))

(defun spacemacs/init-evil-org-mode ()
(use-package evil-org
:commands evil-org-mode
Expand Down
1 change: 0 additions & 1 deletion spacemacs/extensions/evil-nerd-commenter
Submodule evil-nerd-commenter deleted from c54cee
Loading

0 comments on commit d30c2b0

Please sign in to comment.