From 7c3d17224cecf57e98f8a7489bb9d00701346e24 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 4 Nov 2014 11:35:07 -0500 Subject: [PATCH 01/13] Update contribution guidelines --- CONTRIBUTE.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index 9dbd1b3cd4bb..748734fae19f 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -18,6 +18,9 @@ branch. _PR = pull request_ **Guidelines:** + +1) Ideally and for simple PRs: + - branch from `develop` only - one topic per PR - one commit per PR @@ -25,6 +28,15 @@ _PR = pull request_ 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] From b78fd90a42b4861654a0e698a40dcf34a0139fcc Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 4 Nov 2014 13:09:26 -0500 Subject: [PATCH 02/13] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 454ee3e748e6..1c64920c12a5 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ bookmarks tmp/ /history .python-environments/ +server/ From 2c3b0d919388b081bca7dbd803fd858e2fd427ae Mon Sep 17 00:00:00 2001 From: Daniel Wu Date: Tue, 4 Nov 2014 14:10:59 -0500 Subject: [PATCH 03/13] use web-mode for html files --- spacemacs/packages.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index a89a06eb9b9b..ff607cfaddcf 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1921,7 +1921,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) From b15dcb3f13504b8ebe38ae548e882747fb3d93fe Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 4 Nov 2014 16:10:05 -0500 Subject: [PATCH 04/13] Make * uses auto-highlight-symbol in all state except visual In visual state we use evil-visualstar In all other states we use auto-highlight-symbol This is very powerfull This change makes also ahs look for symbols everywhere (even in strings and comments) --- spacemacs/packages.el | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index ff607cfaddcf..e9ebb9be7dc6 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -372,7 +372,19 @@ 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)))))) ;; add a lisp state (use-package evil-lisp-state :init @@ -680,7 +692,8 @@ 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)) From 9f9be0ed171cde2780343713f07fcc5b6a89203d Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Tue, 4 Nov 2014 20:34:39 -0500 Subject: [PATCH 05/13] Don't pair apostrophe in markdown mode --- spacemacs/packages.el | 1 + 1 file changed, 1 insertion(+) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index e9ebb9be7dc6..ba44e0eb3fb4 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1850,6 +1850,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 () From 1326943321bdd5a1a402dcb0d046a215767f016a Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 4 Nov 2014 21:08:53 -0500 Subject: [PATCH 06/13] Make helm-swoop split window behaves like helm --- spacemacs/packages.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index e9ebb9be7dc6..cfbb184a06d0 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1395,6 +1395,9 @@ 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 From 3fb503c2b6467ac963a1ce3572c667e7d4af7992 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 4 Nov 2014 21:44:49 -0500 Subject: [PATCH 07/13] Resize window when golden-ratio is enabled via t g --- spacemacs/packages.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index cf8fda010d50..33937716516e 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1160,7 +1160,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 From 6738eb3d81f4c5444d31d89cbb66ebae3457cd6d Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 4 Nov 2014 22:07:32 -0500 Subject: [PATCH 08/13] Change ahs change range key to `r` instead of `c` ahs = auto-highlight-symbol This change was made to free `c` to clear persistent highlighting of search with ` s c` --- README.md | 12 ++++++------ spacemacs/packages.el | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 44855b024115..7eb73acb2711 100644 --- a/README.md +++ b/README.md @@ -946,22 +946,22 @@ Key Binding | Description ` s s` | initiate navigation micro-state ` s n` | go to next occurrence and initiate navigation micro-state ` s N` | go to previous occurrence and initiate navigation micro-state -` s c b` | change range to `whole buffer` -` s c d` | change range to `display area` -` s c f` | change range to `function` -` s C` | change range to default (`whole buffer`) +` s r b` | change range to `whole buffer` +` s r d` | change range to `display area` +` s r f` | change range to `function` +` 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: diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 33937716516e..cf0432b46b5d 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -696,14 +696,14 @@ DELETE-FUNC when calling CALLBACK. '(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 @@ -723,14 +723,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)) @@ -752,7 +752,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 () From 8451449346da8970471166d9364f0db70d749621 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 4 Nov 2014 22:09:21 -0500 Subject: [PATCH 09/13] Add evil-search-highlight-persist --- spacemacs/packages.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index cf0432b46b5d..24c199ea2fc9 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -29,6 +29,7 @@ ess-smart-underscore evil evil-exchange + evil-search-highlight-persist evil-leader evil-lisp-state evil-nerd-commenter @@ -385,6 +386,11 @@ DELETE-FUNC when calling CALLBACK. '(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 From 203097f20cb335e8a019c74bdcc7eea88e2dbb42 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 4 Nov 2014 22:27:46 -0500 Subject: [PATCH 10/13] Remove uneeded `SPC s s ` to initiate ahs --- README.md | 4 ++-- spacemacs/packages.el | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7eb73acb2711..7408d4f19cfb 100644 --- a/README.md +++ b/README.md @@ -943,7 +943,7 @@ Navigation between the highlighted symbols can be done with the commands: Key Binding | Description --------------|------------------------------------------------------------ -` s s` | initiate navigation micro-state +`*` | initiate navigation micro-state ` s n` | go to next occurrence and initiate navigation micro-state ` s N` | go to previous occurrence and initiate navigation micro-state ` s r b` | change range to `whole buffer` @@ -966,7 +966,7 @@ Any other key | leave the navigation micro-state The micro-state text in minibuffer display the following information: - [6/11]* press (n) or (N) to navigate, (h) for home symbol, (c) to change scope + [6/11]* press (n) or (N) to navigate, (R) for home symbol, (r) to change range Where ` [x/y]*` is: - M: the current range mode diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 24c199ea2fc9..3f192c1f9e7f 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -703,7 +703,6 @@ DELETE-FUNC when calling CALLBACK. (eval-after-load "evil-leader" '(evil-leader/set-key "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)) From dea7d559d1adddd1c9e0f8c9c9fcc0168102a9e8 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 4 Nov 2014 22:28:21 -0500 Subject: [PATCH 11/13] Helm-swoop is now bound to ` s` prefix --- README.md | 15 +++++++++++++++ spacemacs/packages.el | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7408d4f19cfb..14df8b92c8b6 100644 --- a/README.md +++ b/README.md @@ -978,6 +978,21 @@ Where ` [x/y]*` is: - `*`: appears if there is at least one occurrence which is not currently visible. +#### 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 +--------------|---------------------------------------------------------------- +` s s` | execute `helm-swoop` +` s S` | execute `helm-multi-swoop` +` 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 diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 3f192c1f9e7f..86818350c2a0 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1405,9 +1405,9 @@ DELETE-FUNC when calling CALLBACK. 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 From 55d03c12a5c79953465fcd4d1c3eba54ce4f4c8d Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 4 Nov 2014 22:28:49 -0500 Subject: [PATCH 12/13] Create searching section in readme --- README.md | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 14df8b92c8b6..98a9804a8e5a 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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. +`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 ` s c`. -To list all the symbols of a buffer press: - - s l - -##### 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 @@ -978,6 +978,26 @@ Where ` [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: + + s l + #### Helm-swoop This is very similar to `moccur`, it displays a `helm` buffer with all the @@ -1091,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 --------------|---------------------------------------------------------------- From 1062d941684a7757745048b20732af40a2a3f0e4 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Tue, 4 Nov 2014 22:43:04 -0500 Subject: [PATCH 13/13] Update solarize theme submodule --- spacemacs/extensions/solarized-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacemacs/extensions/solarized-theme b/spacemacs/extensions/solarized-theme index f976c371e5ca..d28f545d5869 160000 --- a/spacemacs/extensions/solarized-theme +++ b/spacemacs/extensions/solarized-theme @@ -1 +1 @@ -Subproject commit f976c371e5ca1829408ad1ef602fbd8af14384b0 +Subproject commit d28f545d5869df16a2015cea63bffae6f976c5a9