Skip to content

Commit

Permalink
Merge branch 'develop' (v0.5.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Nov 5, 2014
2 parents 6c5b0c5 + 1062d94 commit b17e259
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ bookmarks
tmp/
/history
.python-environments/
server/
12 changes: 12 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,25 @@ branch.
_PR = pull request_

**Guidelines:**

1) Ideally and for simple PRs:

- branch from `develop` only
- one topic per PR
- one commit per PR
- if you have several commits on different topics, close the PR and create
one PR per topic
- if you still have several commits, squash them into only one commit
- rebase your PR branch on top of upstream `develop` before submitting the PR

Those PRs are fast-forwarded.

2) For complex pull requests:

- squash only the commits with uninteresting changes like typos, syntax fixes,
etc... and keep the important steps in different commits.

Those PRs are merged.

**Getting Help:**
If you have any question on this process, join the [gitter chatroom][gitter]
Expand Down
77 changes: 56 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ for contribution guidelines_
- [Ido](#ido)
- [NeoTree file tree](#neotree-file-tree)
- [Bookmarks](#bookmarks)
- [Symbols](#symbols)
- [Listing symbols by semantic](#listing-symbols-by-semantic)
- [Auto-highlight and edition](#auto-highlight-and-edition)
- [Searching](#searching)
- [Persistent highlighting](#persistent-highlighting)
- [Auto-highlight symbols](#auto-highlight-symbols)
- [Visual Star](#visual-star)
- [Listing symbols by semantic](#listing-symbols-by-semantic)
- [Helm-swoop](#helm-swoop)
- [Window manipulation](#window-manipulation)
- [Golden ratio](#golden-ratio)
- [Text manipulation commands](#text-manipulation-commands)
Expand Down Expand Up @@ -917,18 +920,15 @@ Key Binding | Description

To save a new bookmark, just type the name of the bookmark and press `RET`.

#### Symbols
### Searching

##### Listing symbols by semantic
#### Persistent highlighting

Use `helm-semantic-or-imenu` command from `Helm` to quickly navigate between
the symbols in a buffer.

To list all the symbols of a buffer press:

<SPC> s l
`Spacemacs` uses `evil-search-highlight-persist` to keep the searched expression
highlighted until the next search. It is also possible to clear the
highlighting by pressing `<SPC> s c`.

##### Auto-highlight and edition
#### Auto-highlight symbols

`Spacemacs` supports auto highlighting of the current symbol (provided by the
[auto-highlight-symbol][auto-highlight] mode) and add a micro-state to it
Expand All @@ -943,30 +943,30 @@ Navigation between the highlighted symbols can be done with the commands:

Key Binding | Description
--------------|------------------------------------------------------------
`<SPC> s s` | initiate navigation micro-state
`*` | initiate navigation micro-state
`<SPC> s n` | go to next occurrence and initiate navigation micro-state
`<SPC> s N` | go to previous occurrence and initiate navigation micro-state
`<SPC> s c b` | change range to `whole buffer`
`<SPC> s c d` | change range to `display area`
`<SPC> s c f` | change range to `function`
`<SPC> s C` | change range to default (`whole buffer`)
`<SPC> s r b` | change range to `whole buffer`
`<SPC> s r d` | change range to `display area`
`<SPC> s r f` | change range to `function`
`<SPC> s R` | change range to default (`whole buffer`)

In 'Spacemacs' highlight symbol micro-state:

Key Binding | Description
--------------|------------------------------------------------------------
`c` | change scope (`function`, `display area`, `whole buffer`)
`e` | edit occurrences
`n` | go to next occurrence
`N` | go to previous occurrence
`d` | go to next definition occurrence
`D` | go to previous definition occurrence
`r` | go to home occurrence (reset position to starting occurrence)
`r` | change range (`function`, `display area`, `whole buffer`)
`R` | go to home occurrence (reset position to starting occurrence)
Any other key | leave the navigation micro-state

The micro-state text in minibuffer display the following information:

<M> [6/11]* press (n) or (N) to navigate, (h) for home symbol, (c) to change scope
<M> [6/11]* press (n) or (N) to navigate, (R) for home symbol, (r) to change range

Where `<M> [x/y]*` is:
- M: the current range mode
Expand All @@ -978,6 +978,41 @@ Where `<M> [x/y]*` is:
- `*`: appears if there is at least one occurrence which is not currently
visible.

#### Visual Star

With [evil-visualstar][] you can search for the next occurrence of the current
selection.

It is pretty useful combined with the [expand-region](#region-selection)
bindings.

_Note:_ If the current state is not the `visual state` then pressing `*` uses
[auto-highlight-symbol](#auto-highlight-symbols) and its micro-state.

#### Listing symbols by semantic

Use `helm-semantic-or-imenu` command from `Helm` to quickly navigate between
the symbols in a buffer.

To list all the symbols of a buffer press:

<SPC> s l

#### Helm-swoop

This is very similar to `moccur`, it displays a `helm` buffer with all the
occurrences of the word under point. You can then change the search query
in real-time and navigate between them easily.

You can even edit the occurrences directly in the `helm` buffer and apply
the modifications to the buffer.

Key Binding | Description
--------------|----------------------------------------------------------------
`<SPC> s s` | execute `helm-swoop`
`<SPC> s S` | execute `helm-multi-swoop`
`<SPC> s C-s` | execute `helm-multi-swoop-all`

### Window manipulation

Every window has a number displayed at the start of the mode-line and can
Expand Down Expand Up @@ -1076,7 +1111,7 @@ Spell checking commands start with `S`:
### Region selection

Vi `Visual` modes are all supported by `evil`, `Spacemacs` adds another
`Visual` mode via the [expand-region][expand-region] mode.
`Visual` mode via the [expand-region][] mode.

Key Binding | Description
--------------|----------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion spacemacs/extensions/solarized-theme
Submodule solarized-theme updated 1 files
+3 −0 solarized.el
57 changes: 41 additions & 16 deletions spacemacs/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
ess-smart-underscore
evil
evil-exchange
evil-search-highlight-persist
evil-leader
evil-lisp-state
evil-nerd-commenter
Expand Down Expand Up @@ -372,7 +373,24 @@ DELETE-FUNC when calling CALLBACK.
(unless (display-graphic-p)
(require 'evil-terminal-cursor-changer))
;; initiate a search of the selected text
(use-package evil-visualstar)
(use-package evil-visualstar
:init
;; neat trick, when we are not in visual mode we use ahs to search
(eval-after-load 'auto-highlight-symbol
'(progn
(define-key evil-normal-state-map (kbd "*") 'ahs-forward)
(define-key evil-normal-state-map (kbd "#") 'ahs-backward)
(define-key evil-motion-state-map (kbd "*") 'ahs-forward)
(define-key evil-motion-state-map (kbd "#") 'ahs-backward)
(eval-after-load 'evil-lisp-state
'(progn
(define-key evil-normal-state-map (kbd "*") 'ahs-forward)
(define-key evil-normal-state-map (kbd "#") 'ahs-backward))))))
;; persistent search highlight like Vim hisearch
(use-package evil-search-highlight-persist
:init
(global-evil-search-highlight-persist)
(evil-leader/set-key "sc" 'evil-search-highlight-persist-remove-all))
;; add a lisp state
(use-package evil-lisp-state
:init
Expand Down Expand Up @@ -680,17 +698,17 @@ DELETE-FUNC when calling CALLBACK.
(custom-set-variables
'(ahs-case-fold-search nil)
'(ahs-default-range (quote ahs-range-whole-buffer))
'(ahs-idle-interval 0.25))
'(ahs-idle-interval 0.25)
'(ahs-inhibit-face-list nil))
(eval-after-load "evil-leader"
'(evil-leader/set-key
"sC" (lambda () (interactive) (eval '(ahs-change-range ahs-default-range) nil))
"scb" (lambda () (interactive) (eval '(ahs-change-range 'ahs-range-whole-buffer) nil))
"scd" (lambda () (interactive) (eval '(ahs-change-range 'ahs-range-display) nil))
"scf" (lambda () (interactive) (eval '(ahs-change-range 'ahs-range-beginning-of-defun) nil))
"se" 'ahs-edit-mode
"ss" (lambda () (interactive) (eval '(progn (ahs-highlight-now) (ahs-back-to-start)) nil))
"sn" (lambda () (interactive) (eval '(progn (ahs-highlight-now) (ahs-forward)) nil))
"sN" (lambda () (interactive) (eval '(progn (ahs-highlight-now) (ahs-backward)) nil))
"srb" (lambda () (interactive) (eval '(ahs-change-range 'ahs-range-whole-buffer) nil))
"srd" (lambda () (interactive) (eval '(ahs-change-range 'ahs-range-display) nil))
"srf" (lambda () (interactive) (eval '(ahs-change-range 'ahs-range-beginning-of-defun) nil))
"sR" (lambda () (interactive) (eval '(ahs-change-range ahs-default-range) nil))
"ts" 'auto-highlight-symbol-mode))
(spacemacs//hide-lighter auto-highlight-symbol-mode)
;; micro-state to easily jump from a highlighted symbol to the others
Expand All @@ -710,14 +728,14 @@ DELETE-FUNC when calling CALLBACK.
(interactive)
(set-temporary-overlay-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "c") (lambda () (interactive)
(eval '(ahs-change-range) nil)))
(define-key map (kbd "d") 'ahs-forward-definition)
(define-key map (kbd "D") 'ahs-backward-definition)
(define-key map (kbd "e") 'ahs-edit-mode)
(define-key map (kbd "n") 'ahs-forward)
(define-key map (kbd "N") 'ahs-backward)
(define-key map (kbd "r") 'ahs-back-to-start)
(define-key map (kbd "R") 'ahs-back-to-start)
(define-key map (kbd "r") (lambda () (interactive)
(eval '(ahs-change-range) nil)))
map) nil)
(let* ((i 0)
(overlay-count (length ahs-overlay-list))
Expand All @@ -739,7 +757,7 @@ DELETE-FUNC when calling CALLBACK.
(propx/y (propertize x/y 'face ahs-plugin-whole-buffer-face))
(hidden (if (< 0 (- overlay-count (nth 4 st))) "*" ""))
(prophidden (propertize hidden 'face '(:weight bold))))
(message "%s %s%s press (n) or (N) to navigate, (r) for reset, (c) to change scope"
(message "%s %s%s press (n) or (N) to navigate, (R) for reset, (r) to change range"
propplugin propx/y prophidden)))))))

(defun spacemacs/init-bookmark ()
Expand Down Expand Up @@ -1147,7 +1165,8 @@ DELETE-FUNC when calling CALLBACK.
(interactive)
(if (symbol-value golden-ratio-mode)
(progn (golden-ratio-mode -1)(balance-windows))
(golden-ratio-mode)))
(golden-ratio-mode)
(golden-ratio)))
(evil-leader/set-key "tg" 'spacemacs/toggle-golden-ratio))
:config
(progn
Expand Down Expand Up @@ -1382,10 +1401,13 @@ DELETE-FUNC when calling CALLBACK.
(use-package helm-swoop
:defer t
:init
(setq helm-swoop-split-with-multiple-windows t
helm-swoop-split-direction 'split-window-vertically
helm-swoop-split-window-function 'helm-default-display-buffer)
(evil-leader/set-key
"hS" 'helm-multi-swoop
"hs" 'helm-swoop
"h C-s" 'helm-multi-swoop-all)))
"sS" 'helm-multi-swoop
"ss" 'helm-swoop
"s C-s" 'helm-multi-swoop-all)))

(defun spacemacs/init-helm-themes ()
(use-package helm-themes
Expand Down Expand Up @@ -1837,6 +1859,7 @@ DELETE-FUNC when calling CALLBACK.
'(:add (spacemacs/smartparens-pair-newline-and-indent "RET")))
(sp-pair "[" nil :post-handlers
'(:add (spacemacs/smartparens-pair-newline-and-indent "RET")))
(sp-local-pair 'markdown-mode "'" nil :actions nil)
(sp-local-pair 'emacs-lisp-mode "'" nil :actions nil))))

(defun spacemacs/init-smeargle ()
Expand Down Expand Up @@ -1921,7 +1944,9 @@ DELETE-FUNC when calling CALLBACK.
(use-package web-mode
:mode (("\\.phtml\\'" . web-mode)
("\\.tpl\\.php\\'" . web-mode)
("\\.[gj]sp\\' " . web-mode)
("\\.html\\'" . web-mode)
("\\.htm\\'" . web-mode)
("\\.[gj]sp\\'" . web-mode)
("\\.as[cp]x\\'" . web-mode)
("\\.erb\\'" . web-mode)
("\\.mustache\\'" . web-mode)
Expand Down

0 comments on commit b17e259

Please sign in to comment.