From 5e8402239f134ef4d9fbae4f81a015d795942d9b Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 00:43:42 -0400 Subject: [PATCH 01/62] Update old name of submodules in .gitmodules --- .gitmodules | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitmodules b/.gitmodules index 5e53a28e341e..d74ae3056cec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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"] From 19cb635e5dc20c1863400c4b8ae367344a633b4d Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 00:44:38 -0400 Subject: [PATCH 02/62] Lazy loading of tern-auto-complete --- spacemacs/packages.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index ef577dd2a111..b9907c55d8f5 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1792,9 +1792,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 From 09e058d36fb28643160ee6da7ac091011961f6e1 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 00:46:16 -0400 Subject: [PATCH 03/62] Lazy loading of helm --- spacemacs/packages.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index b9907c55d8f5..6e9c59a4518f 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1269,8 +1269,7 @@ DELETE-FUNC when calling CALLBACK. (defun spacemacs/init-helm () (use-package helm - :idle (helm-mode 1) - :idle-priority 0 + :defer t :config (progn (evil-leader/set-key From 5ab9d95fcab4bb8d3ad86949111c279d075a609e Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 01:03:01 -0400 Subject: [PATCH 04/62] Fixes #46 Weird behavior of projectile Projectile takes time to load (around 0.2 seconds) and it is lazy loading friendly if we want to enable it globally. To be able to lazy load it, we encapsulate the binded calls in spacemacs/xxx functions which take care of firing the mode globally if required. --- spacemacs/packages.el | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 6e9c59a4518f..faeae4dd29be 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1560,24 +1560,34 @@ 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) + :commands projectile-global-mode :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 + (defun spacemacs/projectile-lazy-loading (func) + "Wrap FUNC in order to be able to lazy load projectile." + (let ((funcstr (symbol-name func))) + (eval `(defun ,(intern (format "spacemacs/%s" funcstr)) (arg) + ,(format "Call %s" funcstr) + (interactive "P") + (projectile-global-mode) + (call-interactively ',func arg))))) + (mapc 'spacemacs/projectile-lazy-loading '(projectile-invalidate-cache + projectile-dired + projectile-find-file + projectile-grep + projectile-kill-buffers + projectile-replace + projectile-switch-to-buffer)) + (evil-leader/set-key + "pC" 'spacemacs/projectile-invalidate-cache + "pd" 'spacemacs/projectile-dired + "pF" 'spacemacs/projectile-find-file + "pg" 'spacemacs/projectile-grep + "pk" 'spacemacs/projectile-kill-buffers + "pr" 'spacemacs/projectile-replace + "ps" 'spacemacs/projectile-switch-to-buffer)) :config - (spacemacs//diminish projectile-mode " Ⓟ"))) + (spacemacs//hide-lighter projectile-mode))) (defun spacemacs/init-python () (use-package python From 2bfc200c96ac41e1c21751631854297f9a6d9cd1 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 09:07:41 -0400 Subject: [PATCH 05/62] Correctly load helm bindings at initialization time instead of at loading time which is useless :-) --- spacemacs/packages.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index faeae4dd29be..29d95bba7fa5 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1270,14 +1270,15 @@ DELETE-FUNC when calling CALLBACK. (defun spacemacs/init-helm () (use-package helm :defer t - :config - (progn - (evil-leader/set-key + :init + (evil-leader/set-key ":" 'helm-M-x "bs" 'helm-mini "sl" 'helm-semantic-or-imenu "hb" 'helm-bookmarks "kil" 'helm-how-kill-ring) + :config + (progn ;; 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) From 816f1cf3d1dfe826c3166d0c49a95bab30dadcec Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 09:11:03 -0400 Subject: [PATCH 06/62] Fix helm-show-kill-ring binding --- spacemacs/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 29d95bba7fa5..2b1b011310fd 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1276,7 +1276,7 @@ DELETE-FUNC when calling CALLBACK. "bs" 'helm-mini "sl" 'helm-semantic-or-imenu "hb" 'helm-bookmarks - "kil" 'helm-how-kill-ring) + "kil" 'helm-show-kill-ring) :config (progn ;; alter helm-bookmark key bindings to be simpler From 161366592ac78f01478c52a87b7b33b41993f94c Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 10:01:12 -0400 Subject: [PATCH 07/62] Fix helm lazy loading for describe-xxx functions --- spacemacs/packages.el | 1 + 1 file changed, 1 insertion(+) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 2b1b011310fd..031bc54be756 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1279,6 +1279,7 @@ DELETE-FUNC when calling CALLBACK. "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) From 35cf2f03717495e278d0547816b10688fce631fe Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 10:02:28 -0400 Subject: [PATCH 08/62] Add bindings for describe functions --- README.md | 44 +++++++++++++++++++++++++++------------- spacemacs/keybindings.el | 6 ++++++ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 0d506a2ae2ae..b4e2896b5e3c 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,9 @@ _Jump to [Install](#install) for more info and - [Troubleshoot](#troubleshoot) - [Loading fails](#loading-fails) - [Version mismatch for ~/.spacemacs](#version-mismatch-for-spacemacs) + - [Getting Help](#getting-help) + - [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) @@ -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) @@ -275,6 +277,33 @@ there is no automatic way to do it. You will have to refer to the template file 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). +## Getting Help + +### Key bindings + +`Spacemacs` defines hundreds of key bindings, you can easily discover them +inside Emacs by pressing: + + ? + +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. + +### Other describe functions + +Emacs `describe-xxx` function are accessible with the following bindings: + +Key Binding | Description +--------------|------------------------------------------------------------------ +` h d f` | describe-function +` h d k` | describe-key +` h d m` | describe-mode +` h d v` | describe-variable + ## Configuration layers _This part of Spacemacs is still in beta, the structure can change over @@ -745,19 +774,6 @@ Vim | `:` Emacs | ` :` Shell | ` !` -### Key bindings help - -A list of all the key bindings can be accessed by pressing: - - ? - -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 diff --git a/spacemacs/keybindings.el b/spacemacs/keybindings.el index 42d3b43526c5..cc399b0c6a65 100644 --- a/spacemacs/keybindings.el +++ b/spacemacs/keybindings.el @@ -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 From f007d98245d53109c5dfabbfbdc6e56309a91432 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 10:46:50 -0400 Subject: [PATCH 09/62] Add notes about master and develop branches in install section --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b4e2896b5e3c..87a5f8930908 100644 --- a/README.md +++ b/README.md @@ -245,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. From cfeb465fb2869fb0f4a95e37be5cca82a6fb84c1 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 14:10:49 -0400 Subject: [PATCH 10/62] Remove obsolete readme section --- README.md | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 87a5f8930908..4b397aac228f 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ _Jump to [Install](#install) for more info and - [Install](#install) - [Troubleshoot](#troubleshoot) - [Loading fails](#loading-fails) - - [Version mismatch for ~/.spacemacs](#version-mismatch-for-spacemacs) - - [Getting Help](#getting-help) + - [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) @@ -266,21 +266,12 @@ _('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. -``` - -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. - -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). +You have to manually copy the `~/.emacs.d/.spacemacs.template` file to +`~/.spacemacs` -## Getting Help +## Help commands ### Key bindings From 49118fa96b7acb519d6530f3be119aea79945ff6 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 22:21:40 -0400 Subject: [PATCH 11/62] Use projectile-commander and bind it to ` p p` --- spacemacs/packages.el | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 031bc54be756..ec0fd9f92d02 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1562,34 +1562,14 @@ DELETE-FUNC when calling CALLBACK. (defun spacemacs/init-projectile () (use-package projectile - :commands projectile-global-mode - :init - (progn - (defun spacemacs/projectile-lazy-loading (func) - "Wrap FUNC in order to be able to lazy load projectile." - (let ((funcstr (symbol-name func))) - (eval `(defun ,(intern (format "spacemacs/%s" funcstr)) (arg) - ,(format "Call %s" funcstr) - (interactive "P") - (projectile-global-mode) - (call-interactively ',func arg))))) - (mapc 'spacemacs/projectile-lazy-loading '(projectile-invalidate-cache - projectile-dired - projectile-find-file - projectile-grep - projectile-kill-buffers - projectile-replace - projectile-switch-to-buffer)) - (evil-leader/set-key - "pC" 'spacemacs/projectile-invalidate-cache - "pd" 'spacemacs/projectile-dired - "pF" 'spacemacs/projectile-find-file - "pg" 'spacemacs/projectile-grep - "pk" 'spacemacs/projectile-kill-buffers - "pr" 'spacemacs/projectile-replace - "ps" 'spacemacs/projectile-switch-to-buffer)) + :defer t + :init (evil-leader/set-key "pp" 'projectile-commander) :config - (spacemacs//hide-lighter projectile-mode))) + (progn + (def-projectile-commander-method ?F + "Find file in project using helm." + (helm-projectile)) + (spacemacs//hide-lighter projectile-mode)))) (defun spacemacs/init-python () (use-package python From 383e388f50dbe9986ac62adeeb293c30c8f4cd1d Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 22:47:02 -0400 Subject: [PATCH 12/62] Fix ido-vertical key bindings stability Sometimes the spacemacs key bindings for ido-vertical did not work. --- spacemacs/packages.el | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index ec0fd9f92d02..f8a2cecbada8 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1353,21 +1353,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-") '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 "") 'ido-prev-match) - (define-key ido-file-dir-completion-map (kbd "") 'ido-next-match) - (define-key ido-file-dir-completion-map (kbd "") 'ido-delete-backward-updir) - (define-key ido-file-dir-completion-map (kbd "") '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-") '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 "") 'ido-prev-match) + (define-key ido-completion-map (kbd "") 'ido-next-match) + (define-key ido-completion-map (kbd "") 'ido-delete-backward-updir) + (define-key ido-completion-map (kbd "") 'ido-exit-minibuffer))))) (defun spacemacs/init-js2-mode () (use-package js2-mode From 6eb523c324c6f4c939c567cf8c6f55e22678e6fd Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 23:01:42 -0400 Subject: [PATCH 13/62] `fd` can exit help window --- spacemacs/packages.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index f8a2cecbada8..4be67fb28de0 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -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) From 09f1a36129853e1b670315f4cd488769db8ae40f Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 23:29:14 -0400 Subject: [PATCH 14/62] Fixes #51 Projectile cache remains empty I had to explicitly enable projectile-enable-caching and explicitly start projectile-mode to initialize projectile-projects-cache --- spacemacs/packages.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 4be67fb28de0..28ac6e5f0cfa 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1568,9 +1568,13 @@ DELETE-FUNC when calling CALLBACK. (defun spacemacs/init-projectile () (use-package projectile :defer t - :init (evil-leader/set-key "pp" 'projectile-commander) + :init + (progn + (setq-default projectile-enable-caching t) + (evil-leader/set-key "pp" 'projectile-commander)) :config (progn + (projectile-global-mode) (def-projectile-commander-method ?F "Find file in project using helm." (helm-projectile)) From 19d6ee6ebc11d27a358ed1bc874f204062bb00da Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 23:53:11 -0400 Subject: [PATCH 15/62] Simplify binding for projectile-commander to p Also add ?r projectile-replace to commander --- spacemacs/packages.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 28ac6e5f0cfa..8058f5ecd71a 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1571,13 +1571,16 @@ DELETE-FUNC when calling CALLBACK. :init (progn (setq-default projectile-enable-caching t) - (evil-leader/set-key "pp" 'projectile-commander)) + (evil-leader/set-key "p" 'projectile-commander)) :config (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 () From 55b0154b7eccd1d4f2f5137b45f11b4a4eab85f8 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Wed, 29 Oct 2014 23:53:58 -0400 Subject: [PATCH 16/62] Update projectile documentation in readme --- README.md | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4b397aac228f..6b1e7acd06e0 100644 --- a/README.md +++ b/README.md @@ -686,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 @@ -1115,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. -Projects management commands (start with `p`): +The only bound key for `projectile` is `projectile-commander` which is: + + p + +`projectile commander` commands: Key Binding | Description ------------------|------------------------------------------------------------ -` p C` | invalidate the cache of `projectile` -` p d` | open a `dired` buffer at the root of the project -` p f` | open a file of the project using `helm` -` p F` | find a file if the project using `ido` -` p k` | kill all the buffers of the project -` p g` | grep search in the project -` p r` | replace a string in the files of the project -` 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 From 4f3bb9e1baf456fb0ae2ae6b388e30471d54acc7 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Thu, 30 Oct 2014 17:22:10 -0400 Subject: [PATCH 17/62] Remove ?r command for projectile-commander It is now part of the package --- spacemacs/packages.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 8058f5ecd71a..7d1678155973 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1578,9 +1578,6 @@ DELETE-FUNC when calling CALLBACK. (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 () From a124d3c3f695776c2cfeadbfe7d1bbeddfce5cad Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Thu, 30 Oct 2014 17:26:18 -0400 Subject: [PATCH 18/62] Change projectile commander command ?F to ?h This is the command for helm-projectile --- README.md | 2 +- spacemacs/packages.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b1e7acd06e0..6b3c24cd371f 100644 --- a/README.md +++ b/README.md @@ -1133,8 +1133,8 @@ The only bound key for `projectile` is `projectile-commander` which is: `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 +`h` | find file in project using `helm` `j` | find a tag in project `k` | kill all project buffers `o` | run `multi-occur` on project diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 7d1678155973..2df4181db6d6 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1575,7 +1575,7 @@ DELETE-FUNC when calling CALLBACK. :config (progn (projectile-global-mode) - (def-projectile-commander-method ?F + (def-projectile-commander-method ?h "Find file in project using helm." (helm-projectile)) (spacemacs//hide-lighter projectile-mode)))) From 0e2b9bea8465c2dcf579326e06520bd5aa5d0c0f Mon Sep 17 00:00:00 2001 From: ralesi Date: Thu, 30 Oct 2014 14:34:14 -0700 Subject: [PATCH 19/62] Added guide-key to help find SPC mappings --- spacemacs/packages.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 2df4181db6d6..853d25eebbe0 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -51,6 +51,7 @@ ghc golden-ratio google-translate + guide-key haskell-mode helm helm-css-scss @@ -1189,6 +1190,19 @@ DELETE-FUNC when calling CALLBACK. (setq google-translate-default-source-language "En") (setq google-translate-default-target-language "Fr")))) +(defun spacemacs/init-guide-key () + (use-package guide-key + :config + (progn + (setq guide-key/guide-key-sequence '("C-x" "C-c" "SPC" "g" "z" "C-h")) + (setq guide-key/recursive-key-sequence-flag t) + (setq guide-key/popup-window-position 'right) + (setq guide-key/idle-delay 0.3) + (setq guide-key/text-scale-amount 0) + (guide-key-mode 1) + ) + )) + (defun spacemacs/init-haskell-mode () (require 'haskell-yas) (use-package haskell-mode From d1129a37c47bd7ef6e9e56f246c8ed1e11f771c1 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Thu, 30 Oct 2014 21:12:23 -0400 Subject: [PATCH 20/62] Diminish the lighter of guide-key-mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Diminish it to Ⓖ --- spacemacs/packages.el | 1 + 1 file changed, 1 insertion(+) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 853d25eebbe0..7431121f76ae 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1200,6 +1200,7 @@ DELETE-FUNC when calling CALLBACK. (setq guide-key/idle-delay 0.3) (setq guide-key/text-scale-amount 0) (guide-key-mode 1) + (spacemacs//diminish guide-key-mode " Ⓖ") ) )) From b31c91faca51c1f361cb2d775c5b1a2eb34296d0 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Thu, 30 Oct 2014 22:37:11 -0400 Subject: [PATCH 21/62] Use guide-key-tip to display guide-key in a tooltip guide-key does not play well with golden-ratio. also set delay to 1 seconds, can be configured in .spacemacs for shorter delay --- spacemacs/packages.el | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 7431121f76ae..bde655efaed5 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -51,7 +51,7 @@ ghc golden-ratio google-translate - guide-key + guide-key-tip haskell-mode helm helm-css-scss @@ -1190,19 +1190,18 @@ DELETE-FUNC when calling CALLBACK. (setq google-translate-default-source-language "En") (setq google-translate-default-target-language "Fr")))) -(defun spacemacs/init-guide-key () - (use-package guide-key - :config +(defun spacemacs/init-guide-key-tip () + (use-package guide-key-tip + :init (progn - (setq guide-key/guide-key-sequence '("C-x" "C-c" "SPC" "g" "z" "C-h")) - (setq guide-key/recursive-key-sequence-flag t) - (setq guide-key/popup-window-position 'right) - (setq guide-key/idle-delay 0.3) - (setq guide-key/text-scale-amount 0) + (setq guide-key/guide-key-sequence '("C-x" "C-c" "SPC" "g" "z" "C-h") + guide-key/recursive-key-sequence-flag t + guide-key/popup-window-position 'right + guide-key/idle-delay 1 + guide-key/text-scale-amount 0 + guide-key-tip/enabled t) (guide-key-mode 1) - (spacemacs//diminish guide-key-mode " Ⓖ") - ) - )) + (spacemacs//diminish guide-key-mode " Ⓖ")))) (defun spacemacs/init-haskell-mode () (require 'haskell-yas) From 4e7762daba4e0d1ca03ccb482b558d578dfc6e3c Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Thu, 30 Oct 2014 22:38:10 -0400 Subject: [PATCH 22/62] Remove lighter for auto-highlight-symbol --- spacemacs/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index bde655efaed5..a53a42904f13 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -701,7 +701,7 @@ DELETE-FUNC when calling CALLBACK. "sn" (lambda () (interactive) (eval '(progn (ahs-highlight-now) (ahs-forward)) nil)) "sN" (lambda () (interactive) (eval '(progn (ahs-highlight-now) (ahs-backward)) nil)) "ts" 'auto-highlight-symbol-mode)) - (spacemacs//diminish auto-highlight-symbol-mode " Ⓗ") + (spacemacs//hide-lighter auto-highlight-symbol-mode) ;; micro-state to easily jump from a highlighted symbol to the others (dolist (sym '(ahs-forward ahs-forward-definition From c82fe7f1d691bbba48690364a7fde033eb1a9fb3 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Thu, 30 Oct 2014 22:48:57 -0400 Subject: [PATCH 23/62] Fixes #40 and #53 Move evil-nerd-commenter to extensions Work-around a current bug in evil-nc with 24.4 byte-compilation --- .gitmodules | 3 +++ spacemacs/extensions.el | 14 ++++++++++++++ spacemacs/extensions/evil-nerd-commenter | 1 + spacemacs/packages.el | 15 --------------- 4 files changed, 18 insertions(+), 15 deletions(-) create mode 160000 spacemacs/extensions/evil-nerd-commenter diff --git a/.gitmodules b/.gitmodules index d74ae3056cec..04e895219e08 100644 --- a/.gitmodules +++ b/.gitmodules @@ -42,3 +42,6 @@ [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 diff --git a/spacemacs/extensions.el b/spacemacs/extensions.el index 4a2529e052bc..a05ab4f18c81 100644 --- a/spacemacs/extensions.el +++ b/spacemacs/extensions.el @@ -13,6 +13,7 @@ centered-cursor dos emoji-cheat-sheet + evil-nerd-commenter evil-org-mode evil-plugins helm-rcirc @@ -51,6 +52,19 @@ (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 diff --git a/spacemacs/extensions/evil-nerd-commenter b/spacemacs/extensions/evil-nerd-commenter new file mode 160000 index 000000000000..c54cee2648f6 --- /dev/null +++ b/spacemacs/extensions/evil-nerd-commenter @@ -0,0 +1 @@ +Subproject commit c54cee2648f6b2b2bbcf5856acebde3b4a20eddb diff --git a/spacemacs/packages.el b/spacemacs/packages.el index a53a42904f13..58227e1b96f3 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -34,7 +34,6 @@ evil-surround evil-terminal-cursor-changer evil-visualstar - evil-nerd-commenter exec-path-from-shell expand-region fill-column-indicator @@ -364,20 +363,6 @@ DELETE-FUNC when calling CALLBACK. ;; load surround (use-package evil-surround :init (global-evil-surround-mode 1)) - ;; load nerd-commenter - (if (version< emacs-version "24.4") - (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 - )))) ;; load evil-exchange (use-package evil-exchange :init (evil-exchange-install)) From 88f6aa5e5d475391afe1e1d4576655ac59397a06 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Thu, 30 Oct 2014 22:55:32 -0400 Subject: [PATCH 24/62] Fallback to guide-key in a window in terminal --- spacemacs/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 58227e1b96f3..1ed832f3fb03 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1184,7 +1184,7 @@ DELETE-FUNC when calling CALLBACK. guide-key/popup-window-position 'right guide-key/idle-delay 1 guide-key/text-scale-amount 0 - guide-key-tip/enabled t) + guide-key-tip/enabled (if window-system t)) (guide-key-mode 1) (spacemacs//diminish guide-key-mode " Ⓖ")))) From 2c0176718c5fdd66c64f8ed9511b305c2c2a8e9d Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Fri, 31 Oct 2014 00:26:58 -0400 Subject: [PATCH 25/62] Disable golden-ratio for guide-key buffer --- spacemacs/packages.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 1ed832f3fb03..0a881bda9bc5 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1153,6 +1153,18 @@ DELETE-FUNC when calling CALLBACK. ess-eval-buffer-and-go ess-eval-function-and-go ess-eval-line-and-go))) + + ;; Disable auto-resizing for some buffers + (defun spacemacs/no-golden-ratio-for-buffers (bufname) + "Disable golden-ratio if BUFNAME is the name of a visible buffer." + (and (get-buffer bufname) (get-buffer-window bufname 'visible))) + (defun spacemacs/no-golden-ratio-guide-key () + "Disable golden-ratio for guide-key popwin buffer." + (or (spacemacs/no-golden-ratio-for-buffers " *guide-key*") + (spacemacs/no-golden-ratio-for-buffers " *popwin-dummy*"))) + (add-to-list 'golden-ratio-inhibit-functions + 'spacemacs/no-golden-ratio-guide-key) + (spacemacs//diminish golden-ratio-mode " ⊞")))) (defun spacemacs/init-google-translate () From 8ef47d52b94cb16ad78b30db811c885a91063f43 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Fri, 31 Oct 2014 00:41:13 -0400 Subject: [PATCH 26/62] Add toggle command for guide-key with binding t G --- spacemacs/packages.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 0a881bda9bc5..ba28410a806b 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1191,6 +1191,13 @@ DELETE-FUNC when calling CALLBACK. (use-package guide-key-tip :init (progn + (defun spacemacs/toggle-guide-key () + "Toggle golden-ratio mode on and off." + (interactive) + (if (symbol-value guide-key-mode) + (guide-key-mode -1) + (guide-key-mode))) + (evil-leader/set-key "tG" 'spacemacs/toggle-guide-key) (setq guide-key/guide-key-sequence '("C-x" "C-c" "SPC" "g" "z" "C-h") guide-key/recursive-key-sequence-flag t guide-key/popup-window-position 'right From f63711555dbc18c641f570f8e84ee99af96f0a71 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Fri, 31 Oct 2014 00:41:38 -0400 Subject: [PATCH 27/62] Remove lambda for toggle golden-ration key binding --- spacemacs/packages.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index ba28410a806b..a759aa4bd526 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1122,11 +1122,14 @@ DELETE-FUNC when calling CALLBACK. (use-package golden-ratio :defer t :init - (evil-leader/set-key "tg" - '(lambda () (interactive) - (if (symbol-value golden-ratio-mode) - (progn (golden-ratio-mode -1)(balance-windows)) - (golden-ratio-mode)))) + (progn + (defun spacemacs/toggle-golden-ratio () + "Toggle golden-ratio mode on and off." + (interactive) + (if (symbol-value golden-ratio-mode) + (progn (golden-ratio-mode -1)(balance-windows)) + (golden-ratio-mode))) + (evil-leader/set-key "tg" 'spacemacs/toggle-golden-ratio)) :config (progn (setq golden-ratio-extra-commands From 8cd55cf43bb4408224fd650dd45cfaa541a16b62 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Fri, 31 Oct 2014 00:42:04 -0400 Subject: [PATCH 28/62] Update readme for guide-key --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6b3c24cd371f..2e04e8f306a5 100644 --- a/README.md +++ b/README.md @@ -275,8 +275,13 @@ You have to manually copy the `~/.emacs.d/.spacemacs.template` file to ### Key bindings -`Spacemacs` defines hundreds of key bindings, you can easily discover them -inside Emacs by pressing: +1) By default, [guide-key][] and [guide-key-tip][] are enabled. + +Whenever you press a prefix command (like ``) and wait for one second, +a tool tip (GUI) or buffer (terminal) appear listing the possible keys +following this prefix. + +2) You can also easily get a full list of all the key bindings by pressing: ? @@ -683,14 +688,14 @@ The minor mode area can be toggled on and off with: -------------|----------------------------------------------------------------- ⊞ | [golden-ratio][golden-ratio] mode Ⓐ | [auto-complete][auto-complete] mode -Ⓗ | [auto-highlight-symbol][auto-highlight] mode Ⓒ | [centered-cursor][centered-cursor] mode eⓅ | [e-project][e-project] mode Ⓕ | flycheck mode Ⓕ2 | flymake mode +Ⓖ | guide-key mode +(Ⓟ) | paredit mode Ⓢ | flyspell mode (Ⓢ) | [smartparens][sp] mode -(Ⓟ) | paredit mode Ⓨ | [yasnippet][yasnippet] mode **Note:** in terminal the regular indicators are used instead of the utf-8 @@ -1658,3 +1663,5 @@ Thank you to the whole Emacs community from core developers to elisp hackers! [tern-auto-complete]: https://github.com/marijnh/tern/blob/master/emacs/tern-auto-complete.el [tern]: http://ternjs.net/ [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 From db51aab56e520e45ab215e17c5324162c3aadf94 Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Sun, 26 Oct 2014 11:10:57 -0400 Subject: [PATCH 29/62] Add ranger control contrib module --- contrib/ranger-control/config.el | 2 ++ contrib/ranger-control/funcs.el | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 contrib/ranger-control/config.el create mode 100644 contrib/ranger-control/funcs.el diff --git a/contrib/ranger-control/config.el b/contrib/ranger-control/config.el new file mode 100644 index 000000000000..07291d281cd3 --- /dev/null +++ b/contrib/ranger-control/config.el @@ -0,0 +1,2 @@ +(evil-leader/set-key + "pc" 'ranger-control/projectile-cd) diff --git a/contrib/ranger-control/funcs.el b/contrib/ranger-control/funcs.el new file mode 100644 index 000000000000..0e618cfcbdc2 --- /dev/null +++ b/contrib/ranger-control/funcs.el @@ -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)))) From 5859be4a8e9090cf660ccbbc8dbd37091d2cb88b Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Sun, 26 Oct 2014 13:55:13 -0400 Subject: [PATCH 30/62] Add lua mode --- contrib/trishume/packages.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/trishume/packages.el b/contrib/trishume/packages.el index c1522a8d6ab8..f34af6b54daf 100644 --- a/contrib/trishume/packages.el +++ b/contrib/trishume/packages.el @@ -4,6 +4,7 @@ cdlatex smooth-scrolling helm-ag + lua-mode )) (defun trishume/init-auctex () @@ -32,3 +33,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)) From 38958ba04a4b4870ebb1ee9802659553dd3fd2c6 Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Wed, 29 Oct 2014 21:48:45 -0400 Subject: [PATCH 31/62] Better LaTeX --- contrib/trishume/packages.el | 46 +++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/contrib/trishume/packages.el b/contrib/trishume/packages.el index f34af6b54daf..fa019981d352 100644 --- a/contrib/trishume/packages.el +++ b/contrib/trishume/packages.el @@ -1,21 +1,49 @@ (defvar trishume-packages '( auctex - cdlatex smooth-scrolling 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 From e72175c9c91dd5e7a270d14fca33de563b01bfae Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Thu, 30 Oct 2014 19:18:00 -0400 Subject: [PATCH 32/62] Add more modes --- contrib/trishume/packages.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/contrib/trishume/packages.el b/contrib/trishume/packages.el index fa019981d352..a58697f96c01 100644 --- a/contrib/trishume/packages.el +++ b/contrib/trishume/packages.el @@ -2,6 +2,11 @@ '( auctex smooth-scrolling + idris-mode + arduino-mode + scad-mode + qml-mode + julia-mode helm-ag lua-mode )) @@ -52,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 From 204db28d42a3944d10016414c5cbb21302bdd251 Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Fri, 31 Oct 2014 08:43:09 -0400 Subject: [PATCH 33/62] Add readme --- contrib/ranger-control/Readme.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 contrib/ranger-control/Readme.md diff --git a/contrib/ranger-control/Readme.md b/contrib/ranger-control/Readme.md new file mode 100644 index 000000000000..051d8fcdf123 --- /dev/null +++ b/contrib/ranger-control/Readme.md @@ -0,0 +1,7 @@ +# Ranger Control + +This module hooks into the command server in MacRanger to add the command ` 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. From ed172e6f83e32e378111275338af6418493ef5fa Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Fri, 31 Oct 2014 15:19:07 -0400 Subject: [PATCH 34/62] Add readme --- contrib/trishume/Readme.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 contrib/trishume/Readme.md diff --git a/contrib/trishume/Readme.md b/contrib/trishume/Readme.md new file mode 100644 index 000000000000..0c1382cc34be --- /dev/null +++ b/contrib/trishume/Readme.md @@ -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. From 215fe2435af26edf632b2dd29fc6d66983bf1e3d Mon Sep 17 00:00:00 2001 From: Daniel Wu Date: Fri, 31 Oct 2014 21:56:44 -0400 Subject: [PATCH 35/62] bind neotree keys to neotree buffer --- spacemacs/packages.el | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index a759aa4bd526..50453f4ec83d 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1511,8 +1511,22 @@ DELETE-FUNC when calling CALLBACK. (setq neo-create-file-auto-open t neo-dont-be-alone t neo-banner-message "File Tree browser" - neo-smart-open t)) - (evil-leader/set-key "ft" 'neotree-toggle))) + neo-smart-open t) + (evil-leader/set-key "ft" 'neotree-toggle)) + :config + (add-hook 'neotree-mode-hook + (lambda () + (define-key evil-normal-state-local-map (kbd "TAB") 'neotree-enter) + (define-key evil-normal-state-local-map (kbd "RET") 'neotree-enter) + (define-key evil-normal-state-local-map (kbd "D") 'neotree-delete-node) + (define-key evil-normal-state-local-map (kbd "H") 'neotree-hidden-file-toggle) + (define-key evil-normal-state-local-map (kbd "a") 'neotree-stretch-toggle) + (define-key evil-normal-state-local-map (kbd "A") 'neotree-stretch-toggle) + (define-key evil-normal-state-local-map (kbd "g") 'neotree-refresh) + (define-key evil-normal-state-local-map (kbd "q") 'neotree-hide) + (define-key evil-normal-state-local-map (kbd "?") 'evil-search-backward) + (define-key evil-normal-state-local-map (kbd "Q") 'kill-this-buffer))) + )) (defun spacemacs/init-org () (use-package org From bf0fbbc925d665116277ea11f7b53d84f19df286 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Fri, 31 Oct 2014 23:45:22 -0400 Subject: [PATCH 36/62] Add a pull request guideline section in readme --- README.md | 142 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 95 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 2e04e8f306a5..cebf88997af4 100644 --- a/README.md +++ b/README.md @@ -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) @@ -367,45 +370,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. @@ -415,14 +390,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 @@ -433,11 +407,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 ` 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 @@ -448,7 +495,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. @@ -457,7 +504,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` @@ -1665,3 +1712,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 From 45935477ed2a4cdb4c3ac0d402d27c45ffb6eb8c Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Fri, 31 Oct 2014 23:52:15 -0400 Subject: [PATCH 37/62] Move back evil-nerd-commenter from extensions to packages The byte compile issue is now fixed upstream. --- .gitmodules | 3 --- spacemacs/extensions.el | 14 -------------- spacemacs/extensions/evil-nerd-commenter | 1 - spacemacs/packages.el | 14 ++++++++++++++ 4 files changed, 14 insertions(+), 18 deletions(-) delete mode 160000 spacemacs/extensions/evil-nerd-commenter diff --git a/.gitmodules b/.gitmodules index 04e895219e08..d74ae3056cec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/spacemacs/extensions.el b/spacemacs/extensions.el index a05ab4f18c81..4a2529e052bc 100644 --- a/spacemacs/extensions.el +++ b/spacemacs/extensions.el @@ -13,7 +13,6 @@ centered-cursor dos emoji-cheat-sheet - evil-nerd-commenter evil-org-mode evil-plugins helm-rcirc @@ -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 diff --git a/spacemacs/extensions/evil-nerd-commenter b/spacemacs/extensions/evil-nerd-commenter deleted file mode 160000 index c54cee2648f6..000000000000 --- a/spacemacs/extensions/evil-nerd-commenter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c54cee2648f6b2b2bbcf5856acebde3b4a20eddb diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 50453f4ec83d..7ddd7d674068 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -31,6 +31,7 @@ evil-exchange evil-leader evil-lisp-state + evil-nerd-commenter evil-surround evil-terminal-cursor-changer evil-visualstar @@ -903,6 +904,19 @@ DELETE-FUNC when calling CALLBACK. (define-key inferior-ess-mode-map (kbd "C-j") 'comint-next-input) (define-key inferior-ess-mode-map (kbd "C-k") 'comint-previous-input)))) +(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-exec-path-from-shell () (use-package exec-path-from-shell :init (when (memq window-system '(mac ns)) From 47a9deb42ab175ce35cc1ff4b38f2c6d568fc617 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 1 Nov 2014 00:06:37 -0400 Subject: [PATCH 38/62] Use guide-key buffer instead of tool tip Tool tip guide-key remains stuck sometimes which is irritating! ;-( --- README.md | 3 +-- spacemacs/packages.el | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cebf88997af4..1afc258ca681 100644 --- a/README.md +++ b/README.md @@ -281,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 ``) 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: diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 7ddd7d674068..9ba40ec2f206 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1220,7 +1220,10 @@ DELETE-FUNC when calling CALLBACK. guide-key/popup-window-position 'right guide-key/idle-delay 1 guide-key/text-scale-amount 0 - guide-key-tip/enabled (if window-system t)) + ;; use this in your ~/.spacemacs file to enable tool tip in a + ;; graphical envrionment + ;; guide-key-tip/enabled (if window-system t) + guide-key-tip/enabled nil) (guide-key-mode 1) (spacemacs//diminish guide-key-mode " Ⓖ")))) From b3e6d4f15035696f5e8a74a603102db7b9785701 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 1 Nov 2014 21:56:55 -0400 Subject: [PATCH 39/62] New popwin key bindings ` w p m` and ` w p p` To open messages buffer in a popup window and to close current popup window --- README.md | 3 ++- spacemacs/packages.el | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1afc258ca681..0208223035bd 100644 --- a/README.md +++ b/README.md @@ -1018,7 +1018,8 @@ Key Binding | Description ` w L` | move window to the right ` w m` | maximize/minimize a window ` w M` | maximize/minimize a window, when maximized the buffer is centered -` w p` | close the current sticky popup window +` w p m` | open messages buffer in a popup window +` w p p` | close the current sticky popup window ` w r` | rotate windows clockwise ` w R` | rotate windows counter-clockwise ` w u` | undo window layout (used to effectively undo a close window) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 9ba40ec2f206..6fc2d1124208 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1599,7 +1599,8 @@ DELETE-FUNC when calling CALLBACK. :init (progn (popwin-mode 1) - (evil-leader/set-key "wp" 'popwin:close-popup-window) + (evil-leader/set-key "wpm" 'popwin:messages) + (evil-leader/set-key "wpp" 'popwin:close-popup-window) (push '("*ert*" :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config) (push '("*grep*" :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config) (push '("*nosetests*" :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config) From 64adbf827a28203a6d51360000768aa974f37aa8 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 1 Nov 2014 21:58:43 -0400 Subject: [PATCH 40/62] Add `C-k` and `C-j` to select auto-complete candidate --- README.md | 13 +++++++++++++ spacemacs/packages.el | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 0208223035bd..d73b6b522f55 100644 --- a/README.md +++ b/README.md @@ -1127,6 +1127,19 @@ Line formatting commands start with `j`: Used together these key bindings are very powerful to quickly reformat the code. +### Auto-completion + +`Spacemacs` uses [auto-complete][] auto-completion engine. + + Key Binding | Description +------------------|------------------------------------------------------------ +`C-j` | select next candidate +`C-k` | select previous candidate +`TAB` | expand selection or select next candidate +`S-TAB` | select previous candidate +`return` | complete word, if word is already completed insert a carriage return + + ### Commenting Comments are handled by [evil-nerd-commenter][], it's bound to the following keys. diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 6fc2d1124208..43d93e371e95 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -272,6 +272,10 @@ DELETE-FUNC when calling CALLBACK. (if shadowed (call-interactively shadowed))))))) ;; easier toggle for emacs-state (evil-set-toggle-key "s-`") + ;; moves `evil-insert-digraph' to C-i in order to free up C-k for + ;; candidate selection in auto-complete. + (define-key evil-insert-state-map (kbd "C-k") nil) + (define-key evil-insert-state-map (kbd "C-i") 'evil-insert-digraph) ;; escape state with a better key sequence than ESC (let* ((seq spacemacs-normal-state-sequence) (key (char-to-string (car spacemacs-normal-state-sequence))) @@ -622,6 +626,9 @@ DELETE-FUNC when calling CALLBACK. (ac-config-default) (add-to-list 'completion-styles 'initials t) (evil-leader/set-key "ta" 'auto-complete-mode) + (define-key ac-mode-map (kbd "C-j") 'ac-next) + (define-key ac-mode-map (kbd "C-k") 'ac-previous) + (define-key ac-mode-map (kbd "") 'ac-previous) ;; customization (setq ac-auto-start 2 ac-delay 0. From b3d0982726c6962ff84a919d977545d2fba35e36 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 1 Nov 2014 21:59:40 -0400 Subject: [PATCH 41/62] Add function spacemacs/remove-popwin-display-config And add a tip to disable popwin for helm in readme --- README.md | 10 ++++++++-- spacemacs/packages.el | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d73b6b522f55..0a78774932c9 100644 --- a/README.md +++ b/README.md @@ -1642,11 +1642,17 @@ your `~/.spacemacs` the following snippet: ```elisp (defun dotspacemacs/config () - "This is were you can ultimately override default Spacemacs configuration. -This function is called at the very end of Spacemacs initialization." (add-hook 'emacs-lisp-mode-hook 'evil-lisp-state)) ``` +2) Do not use popwin for `helm` buffers: + +```elisp +(defun dotspacemacs/config () + (spacemacs/remove-popwin-display-config "helm") +``` + + ## TODO list - Add support for [multiple-cursors][multiple-cursors] mode. diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 43d93e371e95..d67b6c6de3a8 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1613,8 +1613,13 @@ DELETE-FUNC when calling CALLBACK. (push '("*nosetests*" :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config) (push '("^\*Flycheck.+\*$" :regexp t :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config) (push '("^\*WoMan.+\*$" :regexp t :position bottom ) popwin:special-display-config) - (push '("^\*helm.+\*$" :regexp t :position bottom ) popwin:special-display-config) - (push '("^\*helm-.+\*$" :regexp t :position bottom ) popwin:special-display-config)))) + (push '("^\*helm.*\*$" :regexp t :position bottom ) popwin:special-display-config) + (defun spacemacs/remove-popwin-display-config (str) + "Removes the popwin display configurations that matches the passed STR" + (setq popwin:special-display-config + (-remove (lambda (x) (if (and (listp x) (stringp (car x))) + (string-match str (car x)))) + popwin:special-display-config)))))) (defun spacemacs/init-powershell () (use-package powershell From fffbae8346dfc10b52d56e749e4520a620771871 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 1 Nov 2014 22:00:38 -0400 Subject: [PATCH 42/62] Update TOC of readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0a78774932c9..322e3bfa526a 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ _Jump to [Install](#install) for more info and - [Region selection](#region-selection) - [Region narrowing](#region-narrowing) - [Line formatting](#line-formatting) + - [Auto-completion](#auto-completion) - [Commenting](#commenting) - [Errors handling](#errors-handling) - [Project management](#project-management) From cba986de34b1789af0ad9901a1396337018f4bf9 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 1 Nov 2014 22:03:06 -0400 Subject: [PATCH 43/62] Fix broken links in readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 322e3bfa526a..53e535a7f2f1 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ git clone --recursive http://github.com/syl20bnr/spacemacs .emacs.d -_Jump to [Install](#install) for more info and -[here](#submitting-a-contribution-layer-upstream) for contribution guidelines_ +_Jump to [Install](#install) for more info and [here](#pull-request-guidelines) +for contribution guidelines_ **Table of Contents** @@ -394,7 +394,7 @@ 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]() +To submit your contribution layer follow the [guidelines](#pull-request-guidelines) for pull requests. _Note: by submitting a configuration layer you become the maintainer of it._ From 0f44bcc964bd6ed380d2aff97dcb143e6b50beb9 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sun, 2 Nov 2014 00:02:56 -0400 Subject: [PATCH 44/62] Default evil state is now motion in NeoTree --- spacemacs/packages.el | 1 + 1 file changed, 1 insertion(+) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index d67b6c6de3a8..c196cba842cb 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1532,6 +1532,7 @@ DELETE-FUNC when calling CALLBACK. :defer t :init (progn + (add-to-list 'evil-motion-state-modes 'neotree-mode) (setq neo-create-file-auto-open t neo-dont-be-alone t neo-banner-message "File Tree browser" From 434f216dfea9dd4a5c997add054e4f408844687e Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sun, 2 Nov 2014 00:03:32 -0400 Subject: [PATCH 45/62] Exclude NeoTree from golden-ratio --- spacemacs/packages.el | 1 + 1 file changed, 1 insertion(+) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index c196cba842cb..de13bfd70d44 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1188,6 +1188,7 @@ DELETE-FUNC when calling CALLBACK. (spacemacs/no-golden-ratio-for-buffers " *popwin-dummy*"))) (add-to-list 'golden-ratio-inhibit-functions 'spacemacs/no-golden-ratio-guide-key) + (add-to-list 'golden-ratio-exclude-buffer-names " *NeoTree*") (spacemacs//diminish golden-ratio-mode " ⊞")))) From 4aa93dfe69f21753dcba5344e472240d917d2387 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sun, 2 Nov 2014 00:04:29 -0400 Subject: [PATCH 46/62] `fd` can exit NeoTree --- spacemacs/packages.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index de13bfd70d44..19faa23c22a9 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -314,9 +314,11 @@ 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) - (let ((exit-func (if (eq 'help-mode major-mode) - 'quit-window - 'evil-normal-state))) + (let ((exit-func (cond ((eq 'help-mode major-mode) + 'quit-window) + ((eq 'neotree-mode major-mode) + 'neotree-hide) + (t '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 From 7d032b2cb41dbac38aaaadc21473467f9c4c03b3 Mon Sep 17 00:00:00 2001 From: Daniel Wu Date: Sun, 2 Nov 2014 08:05:32 -0500 Subject: [PATCH 47/62] updated settings to make helm buffer work with neotree buffer --- spacemacs/packages.el | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 19faa23c22a9..97b312046664 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1322,6 +1322,8 @@ DELETE-FUNC when calling CALLBACK. (use-package helm :defer t :init + (setq helm-split-window-in-side-p nil + helm-always-two-windows t) (evil-leader/set-key ":" 'helm-M-x "bs" 'helm-mini @@ -1539,21 +1541,24 @@ DELETE-FUNC when calling CALLBACK. (setq neo-create-file-auto-open t neo-dont-be-alone t neo-banner-message "File Tree browser" - neo-smart-open t) + neo-smart-open t + neo-persist-show nil) (evil-leader/set-key "ft" 'neotree-toggle)) :config (add-hook 'neotree-mode-hook (lambda () - (define-key evil-normal-state-local-map (kbd "TAB") 'neotree-enter) - (define-key evil-normal-state-local-map (kbd "RET") 'neotree-enter) - (define-key evil-normal-state-local-map (kbd "D") 'neotree-delete-node) - (define-key evil-normal-state-local-map (kbd "H") 'neotree-hidden-file-toggle) - (define-key evil-normal-state-local-map (kbd "a") 'neotree-stretch-toggle) - (define-key evil-normal-state-local-map (kbd "A") 'neotree-stretch-toggle) - (define-key evil-normal-state-local-map (kbd "g") 'neotree-refresh) - (define-key evil-normal-state-local-map (kbd "q") 'neotree-hide) - (define-key evil-normal-state-local-map (kbd "?") 'evil-search-backward) - (define-key evil-normal-state-local-map (kbd "Q") 'kill-this-buffer))) + (define-key evil-motion-state-local-map (kbd "TAB") 'neotree-enter) + (define-key evil-motion-state-local-map (kbd "RET") 'neotree-enter) + (define-key evil-motion-state-local-map (kbd "D") 'neotree-delete-node) + (define-key evil-motion-state-local-map (kbd "H") 'neotree-hidden-file-toggle) + (define-key evil-motion-state-local-map (kbd "a") 'neotree-stretch-toggle) + (define-key evil-motion-state-local-map (kbd "A") 'neotree-stretch-toggle) + (define-key evil-motion-state-local-map (kbd "R") 'neotree-rename-node) + (define-key evil-motion-state-local-map (kbd "C") 'neotree-create-node) + (define-key evil-motion-state-local-map (kbd "g") 'neotree-refresh) + (define-key evil-motion-state-local-map (kbd "q") 'neotree-hide) + (define-key evil-motion-state-local-map (kbd "?") 'evil-search-backward) + (define-key evil-motion-state-local-map (kbd "Q") 'kill-this-buffer))) )) (defun spacemacs/init-org () @@ -1617,7 +1622,6 @@ DELETE-FUNC when calling CALLBACK. (push '("*nosetests*" :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config) (push '("^\*Flycheck.+\*$" :regexp t :dedicated t :position bottom :stick t :noselect t) popwin:special-display-config) (push '("^\*WoMan.+\*$" :regexp t :position bottom ) popwin:special-display-config) - (push '("^\*helm.*\*$" :regexp t :position bottom ) popwin:special-display-config) (defun spacemacs/remove-popwin-display-config (str) "Removes the popwin display configurations that matches the passed STR" (setq popwin:special-display-config From 2040d6d4d55b5d9d44414df06394d58af118cf6a Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Fri, 31 Oct 2014 09:07:32 -0400 Subject: [PATCH 48/62] Fix ag --- contrib/trishume/packages.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/trishume/packages.el b/contrib/trishume/packages.el index a58697f96c01..a6aa640b4d28 100644 --- a/contrib/trishume/packages.el +++ b/contrib/trishume/packages.el @@ -9,6 +9,7 @@ julia-mode helm-ag lua-mode + ag )) (defun trishume/init-auctex () @@ -80,7 +81,7 @@ (interactive) (helm-ag (projectile-project-root))) (evil-leader/set-key - "pa" 'trishume-helm-ag)))) + "oa" 'trishume-helm-ag)))) (defun trishume/init-lua-mode () (use-package lua-mode From ba9b34a49451e7d1633076a5c8f7c174d731c03e Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sun, 2 Nov 2014 21:30:09 -0500 Subject: [PATCH 49/62] Fix readme TOC --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 53e535a7f2f1..d56abf46de6f 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ for contribution guidelines_ - [Extensions and Packages declaration and initialization](#extensions-and-packages-declaration-and-initialization) - [Packages synchronization (Vundle like feature)](#packages-synchronization-vundle-like-feature) - [Contribution layers](#contribution-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) - [Pull Request Guidelines](#pull-request-guidelines) @@ -376,7 +376,7 @@ It effectively makes `Spacemacs` to behave like [Vundle][vundle]. you to share your own layer with other `Spacemacs` users. This kind of layer is called `contribution layer`. -#### Adding a contribution layer +### 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 @@ -388,7 +388,7 @@ For instance if you just want to add packages then only the `packages.el` file is necessary (as it is the case for the [Themes Megapack][themes-megapack] layer). -#### Submitting a contribution layer upstream +### Submitting a contribution layer upstream 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 @@ -399,7 +399,7 @@ for pull requests. _Note: by submitting a configuration layer you become the maintainer of it._ -#### Themes Megapack example +### Themes Megapack example This is a simple contribution layer listing a bunch of themes, you can find it [here][themes-megapack]. From d0136923d7ccda953e54101f416e9c2aa3efc9e2 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sun, 2 Nov 2014 22:06:56 -0500 Subject: [PATCH 50/62] Update PR guidelines in readme --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d56abf46de6f..ab5a37702dce 100644 --- a/README.md +++ b/README.md @@ -415,18 +415,16 @@ 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). +- branch from develop for new features or fixes. +- branch from `master` for hot fixes. +- if you don't know if you must branch from `master` or `develop` then branch +from `develop`. - 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. +- it is recommended to rebase your pull request branch on top of `master` or +`develop` (depending on your base branch) before submitting. 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 From 21b6aa88327be3d28a480494a5b39a84f321693c Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Sun, 2 Nov 2014 10:00:41 -0500 Subject: [PATCH 51/62] Better smarparens behaviour for braces --- spacemacs/packages.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 97b312046664..274f1bd0f62f 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1828,6 +1828,19 @@ DELETE-FUNC when calling CALLBACK. (spacemacs//diminish smartparens-mode " (Ⓢ)")) :config (progn + (defun spacemacs/smartparens-pair-newline (id action context) + (save-excursion + (newline) + (indent-according-to-mode))) + + (defun spacemacs/smartparens-pair-newline-and-indent (id action context) + (spacemacs/smartparens-pair-newline id action context) + (indent-according-to-mode)) + + (sp-pair "{" nil :post-handlers + '(:add (spacemacs/smartparens-pair-newline-and-indent "RET"))) + (sp-pair "[" nil :post-handlers + '(:add (spacemacs/smartparens-pair-newline-and-indent "RET"))) (sp-local-pair 'emacs-lisp-mode "'" nil :actions nil)))) (defun spacemacs/init-smeargle () From 467c356f05bc1d2ef87924fcf044f6cc0be8c8f5 Mon Sep 17 00:00:00 2001 From: Tristan Hume Date: Sun, 2 Nov 2014 11:33:25 -0500 Subject: [PATCH 52/62] More modes and config --- contrib/ranger-control/config.el | 2 +- contrib/trishume/config.el | 8 ++++++++ contrib/trishume/packages.el | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 contrib/trishume/config.el diff --git a/contrib/ranger-control/config.el b/contrib/ranger-control/config.el index 07291d281cd3..8a9d9c7c454e 100644 --- a/contrib/ranger-control/config.el +++ b/contrib/ranger-control/config.el @@ -1,2 +1,2 @@ (evil-leader/set-key - "pc" 'ranger-control/projectile-cd) + "oc" 'ranger-control/projectile-cd) diff --git a/contrib/trishume/config.el b/contrib/trishume/config.el new file mode 100644 index 000000000000..5f26ce59dc3b --- /dev/null +++ b/contrib/trishume/config.el @@ -0,0 +1,8 @@ +(dolist (mode '(c++ + json + racket + elisp + LaTeX + yaml)) + (add-hook (intern (concat (symbol-name mode) "-mode-hook")) + 'flycheck-mode)) diff --git a/contrib/trishume/packages.el b/contrib/trishume/packages.el index a6aa640b4d28..c01ce21098af 100644 --- a/contrib/trishume/packages.el +++ b/contrib/trishume/packages.el @@ -9,6 +9,9 @@ julia-mode helm-ag lua-mode + racket-mode + go-mode + yaml-mode ag )) @@ -86,3 +89,19 @@ (defun trishume/init-lua-mode () (use-package lua-mode :defer t)) + +(defun trishume/init-go-mode () + (use-package go-mode + :defer t)) + +(defun trishume/init-yaml-mode () + (use-package yaml-mode + :defer t)) + +(defun trishume/init-racket-mode () + (use-package racket-mode + :defer t + :config + (add-hook 'racket-mode-hook + '(lambda () + (define-key racket-mode-map (kbd "H-r") 'racket-run))))) From 1e0ec2036099f5f040602c1add72940b9f4ffd5b Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Mon, 3 Nov 2014 21:31:54 -0500 Subject: [PATCH 53/62] Remove yasnippet snipets submodule --- .gitmodules | 4 ---- spacemacs/snippets | 1 - 2 files changed, 5 deletions(-) delete mode 160000 spacemacs/snippets diff --git a/.gitmodules b/.gitmodules index d74ae3056cec..6b819458b10c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,10 +20,6 @@ [submodule "spacemacs/extensions/nose"] path = spacemacs/extensions/nose url = http://github.com/syl20bnr/nose.el -[submodule "spacemacs/snippets"] - path = spacemacs/snippets - url = http://github.com/syl20bnr/yasnippet-snippets - ignore = dirty [submodule "spacemacs/extensions/use-package"] path = spacemacs/extensions/use-package url = http://github.com/jwiegley/use-package diff --git a/spacemacs/snippets b/spacemacs/snippets deleted file mode 160000 index 60dd937aa338..000000000000 --- a/spacemacs/snippets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 60dd937aa338e1669bbf3a00bcb028eee2c2a9d8 From 57e3616ea7827352e916f6ce419c457dc4f44578 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Mon, 3 Nov 2014 21:38:18 -0500 Subject: [PATCH 54/62] Add upstream yasnippet-snippets repo as a submodule In spacemacs/extensions/yasnippet-snippets --- .gitmodules | 3 +++ spacemacs/extensions/yasnippet-snippets | 1 + 2 files changed, 4 insertions(+) create mode 160000 spacemacs/extensions/yasnippet-snippets diff --git a/.gitmodules b/.gitmodules index 6b819458b10c..6a1fe27d6a05 100644 --- a/.gitmodules +++ b/.gitmodules @@ -38,3 +38,6 @@ [submodule "contrib/syl20bnr/extensions/o-blog"] path = contrib/syl20bnr/extensions/o-blog url = https://github.com/renard/o-blog.git +[submodule "spacemacs/extensions/yasnippet-snippets"] + path = spacemacs/extensions/yasnippet-snippets + url = http://github.com/AndreaCrotti/yasnippet-snippets.git diff --git a/spacemacs/extensions/yasnippet-snippets b/spacemacs/extensions/yasnippet-snippets new file mode 160000 index 000000000000..32bbd36d9a77 --- /dev/null +++ b/spacemacs/extensions/yasnippet-snippets @@ -0,0 +1 @@ +Subproject commit 32bbd36d9a774b9cab6207523ffb5b24179b6505 From 3849842fef6e78c1d7f56051425e5bddbf0a5835 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Mon, 3 Nov 2014 21:39:12 -0500 Subject: [PATCH 55/62] Update path to yasnippet-snippets submodule --- spacemacs/packages.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 274f1bd0f62f..8ccc00e88a2b 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1939,8 +1939,8 @@ DELETE-FUNC when calling CALLBACK. (defun spacemacs/load-yasnippet () (if (not (boundp 'yas-minor-mode)) (progn - (let* ((dir (contribsys/get-layer-property 'spacemacs :dir)) - (yas-dir (list (concat dir "snippets")))) + (let* ((dir (contribsys/get-layer-property 'spacemacs :ext-dir)) + (yas-dir (list (concat dir "yasnippet-snippets")))) (setq yas-snippet-dirs yas-dir) (yas-global-mode 1))))) (add-to-hooks 'spacemacs/load-yasnippet '(prog-mode-hook From 4ff0270504864c61f44bde8adb2e775ad861526c Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Mon, 3 Nov 2014 21:39:30 -0500 Subject: [PATCH 56/62] Change binding to insert snippet from "hy" to "is" "is" for Insert Snippet. Nice symmetry, much more quick to type than "hy" which is convenient for a text insertion command. --- spacemacs/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 8ccc00e88a2b..7693e63ae208 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1950,7 +1950,7 @@ DELETE-FUNC when calling CALLBACK. (progn (spacemacs//diminish yas-minor-mode " Ⓨ") (require 'helm-c-yasnippet) - (evil-leader/set-key "hy" 'helm-yas-complete) + (evil-leader/set-key "is" 'helm-yas-complete) (setq helm-c-yas-space-match-any-greedy t)))) (defun spacemacs/init-zenburn-theme () From 1d8fd589b5ec15733a2391767138966051e6394b Mon Sep 17 00:00:00 2001 From: Daniel Wu Date: Mon, 3 Nov 2014 21:33:54 -0500 Subject: [PATCH 57/62] fixed C-j/C-k in auto-completion --- spacemacs/packages.el | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 7693e63ae208..ca8bf24fad06 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -272,10 +272,6 @@ DELETE-FUNC when calling CALLBACK. (if shadowed (call-interactively shadowed))))))) ;; easier toggle for emacs-state (evil-set-toggle-key "s-`") - ;; moves `evil-insert-digraph' to C-i in order to free up C-k for - ;; candidate selection in auto-complete. - (define-key evil-insert-state-map (kbd "C-k") nil) - (define-key evil-insert-state-map (kbd "C-i") 'evil-insert-digraph) ;; escape state with a better key sequence than ESC (let* ((seq spacemacs-normal-state-sequence) (key (char-to-string (car spacemacs-normal-state-sequence))) @@ -628,9 +624,9 @@ DELETE-FUNC when calling CALLBACK. (ac-config-default) (add-to-list 'completion-styles 'initials t) (evil-leader/set-key "ta" 'auto-complete-mode) - (define-key ac-mode-map (kbd "C-j") 'ac-next) - (define-key ac-mode-map (kbd "C-k") 'ac-previous) - (define-key ac-mode-map (kbd "") 'ac-previous) + (define-key ac-completing-map (kbd "C-j") 'ac-next) + (define-key ac-completing-map (kbd "C-k") 'ac-previous) + (define-key ac-completing-map (kbd "") 'ac-previous) ;; customization (setq ac-auto-start 2 ac-delay 0. From 737d371d2781bb1769223154f02190c6179d4a3b Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Mon, 3 Nov 2014 21:56:35 -0500 Subject: [PATCH 58/62] CONTRIBUTE.md --- CONTRIBUTE.md | 43 +++++++++++++++++++++++++++++++++++++++++++ README.md | 42 +++++------------------------------------- 2 files changed, 48 insertions(+), 37 deletions(-) create mode 100644 CONTRIBUTE.md diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md new file mode 100644 index 000000000000..9dbd1b3cd4bb --- /dev/null +++ b/CONTRIBUTE.md @@ -0,0 +1,43 @@ +# Contribute to Spacemacs + + +**Table of Contents** + +- [Contribute to Spacemacs](#contribute-to-spacemacs) + - [Pull Request Guidelines](#pull-request-guidelines) + - [Submitting a contribution layer upstream](#submitting-a-contribution-layer-upstream) + + + +## 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. + +_PR = pull request_ + +**Guidelines:** +- 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 + +**Getting Help:** +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 to contribute! + +## Submitting a contribution layer upstream + +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 above +[guidelines](#pull-request-guidelines) for pull requests. + +**Note:** by submitting a configuration layer you become the maintainer of it. diff --git a/README.md b/README.md index ab5a37702dce..a121cc770eb2 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ git clone --recursive http://github.com/syl20bnr/spacemacs .emacs.d -_Jump to [Install](#install) for more info and [here](#pull-request-guidelines) +_Jump to [Install](#install) for more info and [here][CONTRIBUTE.md-PR] for contribution guidelines_ @@ -390,14 +390,7 @@ layer). ### Submitting a contribution layer upstream -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](#pull-request-guidelines) -for pull requests. - -_Note: by submitting a configuration layer you become the maintainer of it._ +See the [CONTRIBUTE.md-CL][] file. ### Themes Megapack example @@ -409,34 +402,7 @@ installed around 100 themes you are free to try with ` h t` (helm-themes). ## 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. -- branch from develop for new features or fixes. -- branch from `master` for hot fixes. -- if you don't know if you must branch from `master` or `develop` then branch -from `develop`. -- 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. -- it is recommended to rebase your pull request branch on top of `master` or -`develop` (depending on your base branch) before submitting. - -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. +See the [CONTRIBUTE.md-PR][] file. ## Dotfile Configuration @@ -1731,3 +1697,5 @@ Thank you to the whole Emacs community from core developers to elisp hackers! [guide-key]: https://github.com/kai2nenobu/guide-key [guide-key-tip]: https://github.com/aki2o/guide-key-tip [gitter]: https://gitter.im/syl20bnr/spacemacs +[CONTRIBUTE.md-PR]: https://github.com/syl20bnr/spacemacs/blob/master/CONTRIBUTE.md#pull-request-guidelines +[CONTRIBUTE.md-CL]: https://github.com/syl20bnr/spacemacs/blob/master/CONTRIBUTE.md#submitting-a-contribution-layer-upstream From 374de72040618cad89c4f3cbda0e851b845c70e8 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Mon, 3 Nov 2014 22:02:13 -0500 Subject: [PATCH 59/62] Remove tip to remove helm from popwin display config --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index a121cc770eb2..8977ed710033 100644 --- a/README.md +++ b/README.md @@ -1610,14 +1610,6 @@ your `~/.spacemacs` the following snippet: (add-hook 'emacs-lisp-mode-hook 'evil-lisp-state)) ``` -2) Do not use popwin for `helm` buffers: - -```elisp -(defun dotspacemacs/config () - (spacemacs/remove-popwin-display-config "helm") -``` - - ## TODO list - Add support for [multiple-cursors][multiple-cursors] mode. From 2b57269b3da978323fd34fd846f9b4ea4ad7de0f Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Mon, 3 Nov 2014 22:28:57 -0500 Subject: [PATCH 60/62] Simplify NeoTree bindings Use lower case bindings whenever it is possible --- spacemacs/packages.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index ca8bf24fad06..a89a06eb9b9b 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -1545,16 +1545,16 @@ DELETE-FUNC when calling CALLBACK. (lambda () (define-key evil-motion-state-local-map (kbd "TAB") 'neotree-enter) (define-key evil-motion-state-local-map (kbd "RET") 'neotree-enter) - (define-key evil-motion-state-local-map (kbd "D") 'neotree-delete-node) - (define-key evil-motion-state-local-map (kbd "H") 'neotree-hidden-file-toggle) + (define-key evil-motion-state-local-map (kbd "?") 'evil-search-backward) (define-key evil-motion-state-local-map (kbd "a") 'neotree-stretch-toggle) - (define-key evil-motion-state-local-map (kbd "A") 'neotree-stretch-toggle) - (define-key evil-motion-state-local-map (kbd "R") 'neotree-rename-node) - (define-key evil-motion-state-local-map (kbd "C") 'neotree-create-node) + (define-key evil-motion-state-local-map (kbd "c") 'neotree-create-node) + (define-key evil-motion-state-local-map (kbd "d") 'neotree-delete-node) (define-key evil-motion-state-local-map (kbd "g") 'neotree-refresh) + (define-key evil-motion-state-local-map (kbd "H") 'neotree-hidden-file-toggle) + (define-key evil-motion-state-local-map (kbd "K") 'kill-this-buffer) (define-key evil-motion-state-local-map (kbd "q") 'neotree-hide) - (define-key evil-motion-state-local-map (kbd "?") 'evil-search-backward) - (define-key evil-motion-state-local-map (kbd "Q") 'kill-this-buffer))) + (define-key evil-motion-state-local-map (kbd "r") 'neotree-rename-node) + )) )) (defun spacemacs/init-org () From f2054506a992918672aaffca035555ef9de90c43 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Mon, 3 Nov 2014 22:29:40 -0500 Subject: [PATCH 61/62] Add NeoTree section in readme --- README.md | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8977ed710033..44855b024115 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ for contribution guidelines_ - [Vim motions with ace-jump mode](#vim-motions-with-ace-jump-mode) - [Buffers and Files](#buffers-and-files) - [Ido](#ido) + - [NeoTree file tree](#neotree-file-tree) - [Bookmarks](#bookmarks) - [Symbols](#symbols) - [Listing symbols by semantic](#listing-symbols-by-semantic) @@ -729,6 +730,7 @@ They are both extended with various packages to build on their foundations. [evil-exchange][] | port of [vim-exchange][] [evil-surround][] | port of [vim-surround][] [evil-nerd-commenter][] | port of [nerdcommenter][] +[NeoTree][neotree] | mimic [NERD Tree][nerdtree] ### Helm extensions @@ -849,7 +851,7 @@ Key Binding | Description ` f i` | open your `init.el` file ` f s` | save a file ` f S` | save all files -` f t` | toggle file tree side bar using [neotree][neotree] +` f t` | toggle file tree side bar using [NeoTree][neotree] ` f y` | show current file absolute path in the minibuffer #### Ido @@ -870,6 +872,30 @@ Key Binding | Description `C-S-j` | go to next directory `C-S-k` | go to previous directory + +#### NeoTree file tree + +`Spacemacs` provides a quick and simple way to navigate in an unknown project +file tree with [NeoTree][neotree]. + +To toggle the `NeoTree` buffer press: + + f t + +In the `NeoTree` buffer: + +Key Binding | Description +---------------|---------------------------------------------------------------- +`TAB` or `RET` | expand/open +`a` | toggle stretch the buffer +`c` | create a node +`d` | delete a node +`g` | refresh +`H` | toggle hidden files +`K` | kill corresponding buffer +`q` or `fd` | hide `NeoTree` buffer +`r` | rename a node + #### Bookmarks Bookmarks can be set anywhere in a file. Bookmarks are persistent. They are very @@ -1675,7 +1701,6 @@ Thank you to the whole Emacs community from core developers to elisp hackers! [smeargle]: https://github.com/syohex/emacs-smeargle [git-timemachine]: https://github.com/pidu/git-timemachine [git-messenger]: https://github.com/syohex/emacs-git-messenger -[neotree]: http://www.emacswiki.org/emacs/NeoTree [evil-lisp-state]: https://github.com/syl20bnr/evil-lisp-state [ido-vertical-mode]: https://github.com/gempesaw/ido-vertical-mode.el [emacs_live]: https://github.com/overtone/emacs-live @@ -1691,3 +1716,5 @@ Thank you to the whole Emacs community from core developers to elisp hackers! [gitter]: https://gitter.im/syl20bnr/spacemacs [CONTRIBUTE.md-PR]: https://github.com/syl20bnr/spacemacs/blob/master/CONTRIBUTE.md#pull-request-guidelines [CONTRIBUTE.md-CL]: https://github.com/syl20bnr/spacemacs/blob/master/CONTRIBUTE.md#submitting-a-contribution-layer-upstream +[neotree]: https://github.com/jaypei/emacs-neotree +[nerdtree]: https://github.com/scrooloose/nerdtree From f4471a642f45fa3da6574056a706bb5757e96c13 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Mon, 3 Nov 2014 22:37:25 -0500 Subject: [PATCH 62/62] motion state for spacemacs-mode buffer Now it is possible to press `q` to quit the buffer --- core/spacemacs-mode.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/spacemacs-mode.el b/core/spacemacs-mode.el index e2f1fbaec26f..691f584b9e82 100644 --- a/core/spacemacs-mode.el +++ b/core/spacemacs-mode.el @@ -11,7 +11,10 @@ (setq truncate-lines t) (setq cursor-type nil) ;; no welcome buffer - (setq inhibit-startup-screen t)) + (setq inhibit-startup-screen t) + ;; motion state since this is a special mode + (eval-after-load 'evil + '(add-to-list 'evil-motion-state-modes 'spacemacs-mode))) (defun spacemacs/emacs-version-ok () (not (version< emacs-version spacemacs-min-version)))