From 64313d159b88c7e1b123149ccf10bcc4995983c9 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 1 Nov 2014 21:56:55 -0400 Subject: [PATCH 1/5] 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 a0b73580b9a3c48e06a3c5a89d07ea0fced6c0a3 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 1 Nov 2014 21:58:43 -0400 Subject: [PATCH 2/5] 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 4ddcdb4fe209a1824b54c308ede9c74da38aae70 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 1 Nov 2014 21:59:40 -0400 Subject: [PATCH 3/5] 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 22f49acd8805f49f28b67362717bc564d4e398ef Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 1 Nov 2014 22:00:38 -0400 Subject: [PATCH 4/5] 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 6d6dee8a464d334f7d7bf78b9e882dc9b89e63c1 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Sat, 1 Nov 2014 22:03:06 -0400 Subject: [PATCH 5/5] 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._