diff --git a/README.md b/README.md index 1afc258ca681..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** @@ -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) @@ -393,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._ @@ -1018,7 +1019,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) @@ -1126,6 +1128,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. @@ -1628,11 +1643,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 9ba40ec2f206..d67b6c6de3a8 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. @@ -1599,14 +1606,20 @@ 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) (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