Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Oct 30, 2014
2 parents 8d5ab34 + 1cab472 commit d80a239
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 90 deletions.
20 changes: 10 additions & 10 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
[submodule "extensions/pylookup"]
[submodule "spacemacs/extensions/pylookup"]
path = spacemacs/extensions/pylookup
url = http://github.com/syl20bnr/pylookup
[submodule "extensions/projmake-mode"]
[submodule "spacemacs/extensions/projmake-mode"]
path = extensions/projmake-mode
url = http://github.com/ericbmerritt/projmake-mode
[submodule "extensions/revive"]
[submodule "spacemacs/extensions/revive"]
path = spacemacs/extensions/revive
url = http://github.com/vedang/revive-mode.git
[submodule "extensions/helm-c-moccur"]
[submodule "spacemacs/extensions/helm-c-moccur"]
path = extensions/helm-c-moccur
url = http://github.com/syl20bnr/helm-c-moccur
[submodule "extensions/solarized-theme"]
[submodule "spacemacs/extensions/solarized-theme"]
path = spacemacs/extensions/solarized-theme
url = http://github.com/syl20bnr/solarized-emacs
ignore = dirty
[submodule "extensions/evil-plugins"]
[submodule "spacemacs/extensions/evil-plugins"]
path = spacemacs/extensions/evil-plugins
url = http://github.com/tarao/evil-plugins
[submodule "extensions/nose"]
[submodule "spacemacs/extensions/nose"]
path = spacemacs/extensions/nose
url = http://github.com/syl20bnr/nose.el
[submodule "snippets"]
[submodule "spacemacs/snippets"]
path = spacemacs/snippets
url = http://github.com/syl20bnr/yasnippet-snippets
ignore = dirty
[submodule "extensions/use-package"]
[submodule "spacemacs/extensions/use-package"]
path = spacemacs/extensions/use-package
url = http://github.com/jwiegley/use-package
[submodule "extensions/emoji-cheat-sheet"]
[submodule "spacemacs/extensions/emoji-cheat-sheet"]
path = spacemacs/extensions/emoji-cheat-sheet
url = http://github.com/ShingoFukuyama/emacs-emoji-cheat-sheet
[submodule "spacemacs/extensions/evil-org-mode"]
Expand Down
99 changes: 60 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ _Jump to [Install](#install) for more info and
- [Install](#install)
- [Troubleshoot](#troubleshoot)
- [Loading fails](#loading-fails)
- [Version mismatch for ~/.spacemacs](#version-mismatch-for-spacemacs)
- [I have no file ~/.spacemacs](#i-have-no-file-spacemacs)
- [Help commands](#help-commands)
- [Key bindings](#key-bindings)
- [Other describe functions](#other-describe-functions)
- [Configuration layers](#configuration-layers)
- [Structure](#structure)
- [Extensions and Packages declaration and initialization](#extensions-and-packages-declaration-and-initialization)
Expand Down Expand Up @@ -61,7 +64,6 @@ _Jump to [Install](#install) for more info and
- [Commands](#commands)
- [Return to normal mode](#return-to-normal-mode)
- [Executing Vim, Emacs and shell commands](#executing-vim-emacs-and-shell-commands)
- [Key bindings help](#key-bindings-help)
- [Navigation](#navigation)
- [Point/Cursor](#pointcursor)
- [Vim motions with ace-jump mode](#vim-motions-with-ace-jump-mode)
Expand Down Expand Up @@ -243,6 +245,9 @@ be provided in this read me. _Stay tuned._
mv .emacs.d .emacs.bak
git clone --recursive http://github.com/syl20bnr/spacemacs .emacs.d

`master` is a stable branch, if you want the "bleeding edge" checkout the
`develop` branch.

2) Launch Emacs, the first time a bunch of packages will be downloaded and
installed. When the package installation is complete restart Emacs and
`Spacemacs` should be ready to use.
Expand All @@ -261,19 +266,37 @@ _('C-x b' means 'Ctrl + x then b' and 'RET' means 'return')_

Then you can copy/paste the error in a [Github issue][issues], thank you.

#### Version mismatch for ~/.spacemacs
#### I have no file ~/.spacemacs

If you get the error:
```
Error: '~/.spacemacs' version mismatch.
```
You have to manually copy the `~/.emacs.d/.spacemacs.template` file to
`~/.spacemacs`

## Help commands

### Key bindings

`Spacemacs` defines hundreds of key bindings, you can easily discover them
inside Emacs by pressing:

<SPC> ?

Then you have to update your `~/.spacemacs` to the last version. Unfortunately
there is no automatic way to do it. You will have to refer to the template file
`.spacemacs.template` in your `~/.emacs.d` and to the commit messages.
To narrow the list to `Spacemacs` specific key bindings set the pattern to
something like the regular expression:

`^SPC\ b`

If you need help to upgrade, open an issue or ask for help on the [Gitter
channel](https://gitter.im/syl20bnr/spacemacs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge).
The example above will list all the `buffer` related bindings.

### Other describe functions

Emacs `describe-xxx` function are accessible with the following bindings:

Key Binding | Description
--------------|------------------------------------------------------------------
`<SPC> h d f` | describe-function
`<SPC> h d k` | describe-key
`<SPC> h d m` | describe-mode
`<SPC> h d v` | describe-variable

## Configuration layers

Expand Down Expand Up @@ -663,7 +686,6 @@ The minor mode area can be toggled on and off with:
Ⓗ | [auto-highlight-symbol][auto-highlight] mode
Ⓒ | [centered-cursor][centered-cursor] mode
eⓅ | [e-project][e-project] mode
Ⓟ | [projectile][projectile] mode
Ⓕ | flycheck mode
Ⓕ2 | flymake mode
Ⓢ | flyspell mode
Expand Down Expand Up @@ -745,19 +767,6 @@ Vim | `:`
Emacs | `<SPC> :`
Shell | `<SPC> !`

### Key bindings help

A list of all the key bindings can be accessed by pressing:

<SPC> ?

To narrow the list to `Spacemacs` specific key bindings set the pattern to
something like the regular expression:

`^SPC\ b`

The example above will list all the `buffer` related bindings.

### Navigation

#### Point/Cursor
Expand Down Expand Up @@ -1105,23 +1114,35 @@ Custom fringe bitmaps:

### Project management

Projects in `Spacemacs` are managed with [projectile][projectile].
So projects are defined implicitly, for instance the root of a project
is found when a `.git` repository or `.projectile` file is encountered
in the file tree.
Projects in `Spacemacs` are managed with [projectile][projectile]. In
`projectile` projects are defined implicitly, for instance the root of a
project is found when a `.git` repository or `.projectile` file is
encountered in the file tree.

The only bound key for `projectile` is `projectile-commander` which is:

<SPC> p

Projects management commands (start with `p`):
`projectile commander` commands:

Key Binding | Description
------------------|------------------------------------------------------------
`<SPC> p C` | invalidate the cache of `projectile`
`<SPC> p d` | open a `dired` buffer at the root of the project
`<SPC> p f` | open a file of the project using `helm`
`<SPC> p F` | find a file if the project using `ido`
`<SPC> p k` | kill all the buffers of the project
`<SPC> p g` | grep search in the project
`<SPC> p r` | replace a string in the files of the project
`<SPC> p s` | switch to a buffer of the project
`a` | run `ack` on project
`A` | run `ag` on project
`b` | switch to project buffer
`d` | find directory in project
`D` | open project root in `dired`
`f` | find file in project
`F` | find file in project using `helm`
`g` | run `grep` on project
`j` | find a tag in project
`k` | kill all project buffers
`o` | run `multi-occur` on project
`R` | regenerate the project's [e|g]tags
`r` | replace a string in the project
`s` | switch project
`T` | find test files in project
`v` | open project root in `vc-dir` or `magit`

### Working with Git

Expand Down
6 changes: 6 additions & 0 deletions spacemacs/keybindings.el
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
"bw" 'toggle-read-only)
;; Cycling settings -----------------------------------------------------------
(evil-leader/set-key "ct" 'spacemacs/cycle-spacemacs-theme)
;; describe functions ---------------------------------------------------------
(evil-leader/set-key
"hdf" 'describe-function
"hdk" 'describe-key
"hdm" 'describe-mode
"hdv" 'describe-variable)
;; errors ---------------------------------------------------------------------
(evil-leader/set-key
"en" 'next-error
Expand Down
85 changes: 44 additions & 41 deletions spacemacs/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,10 @@ DELETE-FUNC when calling CALLBACK.
(spacemacs/escape-state ',seq ',shadowed nil nil 'evil-exit-visual-state)))
(define-key evil-motion-state-map key
`(lambda () (interactive)
(spacemacs/escape-state ',seq ',shadowed nil nil 'evil-normal-state)))
(let ((exit-func (if (eq 'help-mode major-mode)
'quit-window
'evil-normal-state)))
(spacemacs/escape-state ',seq ',shadowed nil nil exit-func))))
(eval-after-load 'evil-lisp-state
`(define-key evil-lisp-state-map ,key
(lambda () (interactive)
Expand Down Expand Up @@ -1269,16 +1272,17 @@ DELETE-FUNC when calling CALLBACK.

(defun spacemacs/init-helm ()
(use-package helm
:idle (helm-mode 1)
:idle-priority 0
:config
(progn
(evil-leader/set-key
:defer t
:init
(evil-leader/set-key
":" 'helm-M-x
"bs" 'helm-mini
"sl" 'helm-semantic-or-imenu
"hb" 'helm-bookmarks
"kil" 'helm-how-kill-ring)
"kil" 'helm-show-kill-ring)
:config
(progn
(helm-mode +1)
;; alter helm-bookmark key bindings to be simpler
(defun simpler-helm-bookmark-keybindings ()
(define-key helm-bookmark-map (kbd "C-d") 'helm-bookmark-run-delete)
Expand Down Expand Up @@ -1352,21 +1356,23 @@ DELETE-FUNC when calling CALLBACK.
:init
(progn
(ido-vertical-mode t)
(define-key ido-file-completion-map (kbd "C-d") 'ido-delete-file-at-head)
(define-key ido-file-completion-map (kbd "C-k") 'ido-prev-match)
(define-key ido-file-dir-completion-map (kbd "C-<return>") 'ido-select-text)
(define-key ido-file-dir-completion-map (kbd "C-h") 'ido-delete-backward-updir)
(define-key ido-file-dir-completion-map (kbd "C-j") 'ido-next-match)
(define-key ido-file-dir-completion-map (kbd "C-l") 'ido-exit-minibuffer)
(define-key ido-file-dir-completion-map (kbd "C-S-j") 'ido-next-match-dir)
(define-key ido-file-dir-completion-map (kbd "C-S-k") 'ido-prev-match-dir)
;; more natural navigation keys: up, down to change current item
;; left to go up dir
;; right to open the selected item
(define-key ido-file-dir-completion-map (kbd "<up>") 'ido-prev-match)
(define-key ido-file-dir-completion-map (kbd "<down>") 'ido-next-match)
(define-key ido-file-dir-completion-map (kbd "<left>") 'ido-delete-backward-updir)
(define-key ido-file-dir-completion-map (kbd "<right>") 'ido-exit-minibuffer))))
(defadvice ido-vertical-define-keys (after spacemacs/ido-vertical-define-keys activate)
;; overwrite the key bindings for ido vertical mode only
(define-key ido-completion-map (kbd "C-d") 'ido-delete-file-at-head)
(define-key ido-completion-map (kbd "C-k") 'ido-prev-match)
(define-key ido-completion-map (kbd "C-<return>") 'ido-select-text)
(define-key ido-completion-map (kbd "C-h") 'ido-delete-backward-updir)
(define-key ido-completion-map (kbd "C-j") 'ido-next-match)
(define-key ido-completion-map (kbd "C-l") 'ido-exit-minibuffer)
(define-key ido-completion-map (kbd "C-S-j") 'ido-next-match-dir)
(define-key ido-completion-map (kbd "C-S-k") 'ido-prev-match-dir)
;; 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 spacemacs/init-js2-mode ()
(use-package js2-mode
Expand Down Expand Up @@ -1561,24 +1567,21 @@ DELETE-FUNC when calling CALLBACK.

(defun spacemacs/init-projectile ()
(use-package projectile
:commands (projectile-switch-to-buffer
projectile-invalidate-cache
projectile-dired
projectile-find-file
projectile-kill-buffers
projectile-grep
projectile-replace)
:defer t
:init
(evil-leader/set-key
"pC" 'projectile-invalidate-cache
"pd" 'projectile-dired
"pF" 'projectile-find-file
"pg" 'projectile-grep
"pk" 'projectile-kill-buffers
"pr" 'projectile-replace
"ps" 'projectile-switch-to-buffer)
(progn
(setq-default projectile-enable-caching t)
(evil-leader/set-key "p" 'projectile-commander))
:config
(spacemacs//diminish projectile-mode "")))
(progn
(projectile-global-mode)
(def-projectile-commander-method ?F
"Find file in project using helm."
(helm-projectile))
(def-projectile-commander-method ?r
"Replace a string in the project."
(projectile-replace))
(spacemacs//hide-lighter projectile-mode))))

(defun spacemacs/init-python ()
(use-package python
Expand Down Expand Up @@ -1792,9 +1795,9 @@ DELETE-FUNC when calling CALLBACK.
(use-package tern-auto-complete
:defer t
:init
(progn
(tern-ac-setup)
(add-hook 'js2-mode-hook (lambda () (tern-mode t))))))
(add-hook 'js2-mode-hook (lambda () (tern-mode t)))
:config
(tern-ac-setup)))

(defun spacemacs/init-undo-tree ()
(use-package undo-tree
Expand Down

0 comments on commit d80a239

Please sign in to comment.