Merge pull request #39 from Wolfy87/feature/nerd-commenter

Feature/nerd commenter (replace evil-operator-comment)
This commit is contained in:
Sylvain Benner 2014-10-25 20:35:41 -04:00
commit 6bad84c17c
3 changed files with 49 additions and 21 deletions

View File

@ -70,6 +70,7 @@ _Jump to [Install](#install) for more info_
- [Region selection](#region-selection)
- [Region narrowing](#region-narrowing)
- [Line formatting](#line-formatting)
- [Commenting](#commenting)
- [Errors handling](#errors-handling)
- [Project management](#project-management)
- [Working with Git](#working-with-git)
@ -602,12 +603,12 @@ They are both extended with various packages to build on their foundations.
Mode | Description
----------------------------------------|--------------------------------------
[evil-leader][evil-leader] | vim leader that bring a new layer of keys in normal mode
[evil-little-word][evil-plugin01] | port of [camelcasemotion.vim][vim-plugin01]
[evil-operator-comment][evil-plugin01] | comment/uncomment with `CC`
[evil-visualstar][evil-plugin03] | search for current selection with `*`
[evil-exchange][evil-plugin05] | port of [vim-exchange][vim-plugin04]
[evil-surround][evil-plugin04] | port of [surround.vim][vim-plugin03]
[evil-leader][] | vim leader that bring a new layer of keys in normal mode
[evil-little-word][] | port of [camelcasemotion.vim][]
[evil-visualstar][] | search for current selection with `*`
[evil-exchange][] | port of [vim-exchange][]
[evil-surround][] | port of [vim-surround][]
[evil-nerd-commenter][] | port of [nerdcommenter][]
### Helm extensions
@ -983,6 +984,21 @@ Line formatting commands start with `j`:
Used together these key bindings are very powerful to quickly reformat the code.
### Commenting
Comments are handled by [evil-nerd-commenter][], it's bound to the following keys.
Key Binding | Description
------------------|------------------------------------------------------------
`<SPC> n c l` | comment lines
`<SPC> n c t` | comment to line
`<SPC> n c y` | comment and yank
`<SPC> n c p` | comment paragraphs
`<SPC> n c r` | comment region
`<SPC> n c i` | comment invert
`<SPC> n c c` | comment operator
### Errors handling
`Spacemacs` uses [Flycheck][flycheck] to gives error feedback on the fly.
@ -1504,15 +1520,15 @@ Thank you to the whole Emacs community from core developers to elisp hackers!
[projectile]: https://github.com/bbatsov/projectile
[hdescbinds]: https://github.com/emacs-helm/helm-descbinds
[hflyspell]: https://gist.github.com/cofi/3013327
[evil-plugin01]: https://github.com/tarao/evil-plugins
[evil-plugin02]: https://github.com/redguardtoo/evil-matchit
[evil-plugin03]: https://github.com/bling/evil-visualstar
[evil-plugin04]: https://github.com/timcharper/evil-surround
[evil-plugin05]: https://github.com/Dewdrops/evil-exchange
[vim-plugin01]: http://www.vim.org/scripts/script.php?script_id=1905
[vim-plugin02]: http://www.vim.org/scripts/script.php?script_id=39
[vim-plugin03]: http://www.vim.org/scripts/script.php?script_id=1697
[vim-plugin04]: https://github.com/tommcdo/vim-exchange
[evil-little-word]: https://github.com/tarao/evil-plugins#evil-little-wordel
[evil-visualstar]: https://github.com/bling/evil-visualstar
[evil-exchange]: https://github.com/Dewdrops/evil-exchange
[evil-surround]: https://github.com/timcharper/evil-surround
[camelcasemotion.vim]: http://www.vim.org/scripts/script.php?script_id=1905
[vim-exchange]: https://github.com/tommcdo/vim-exchange
[vim-surround]: https://github.com/tpope/vim-surround
[evil-nerd-commenter]: https://github.com/redguardtoo/evil-nerd-commenter
[nerdcommenter]: https://github.com/scrooloose/nerdcommenter
[evil-org-mode]: https://github.com/edwtjo/evil-org-mode
[nose]: https://github.com/nose-devs/nose/
[nose.el]: https://github.com/syl20bnr/nose.el

View File

@ -33,7 +33,7 @@
:init
(evil-leader/set-key "zz" 'global-centered-cursor-mode)
:config
(progn
(progn
(custom-set-variables
'(ccm-recenter-at-end-of-file t)
'(ccm-ignored-commands (quote (mouse-drag-region
@ -57,10 +57,7 @@
:init (add-hook 'org-mode-hook 'evil-org-mode)))
(defun spacemacs/init-evil-plugins ()
(use-package evil-little-word)
(use-package evil-operator-comment
:init
(global-evil-operator-comment-mode 1)))
(use-package evil-little-word))
(defun spacemacs/init-helm-rcirc ()
(use-package helm-rcirc

View File

@ -34,6 +34,7 @@
evil-surround
evil-terminal-cursor-changer
evil-visualstar
evil-nerd-commenter
exec-path-from-shell
expand-region
fill-column-indicator
@ -348,6 +349,20 @@ of 2 characters. If INSERT? is not nil then the first key pressed is inserted
;; load surround
(use-package evil-surround
:init (global-evil-surround-mode 1))
;; load nerd-commenter
(use-package evil-nerd-commenter
:init
(progn
(global-evil-leader-mode)
(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))
@ -1821,7 +1836,7 @@ of 2 characters. If INSERT? is not nil then the first key pressed is inserted
org-mode-hook
erlang-mode-hook)))
:config
(progn
(progn
(spacemacs//diminish yas-minor-mode "")
(require 'helm-c-yasnippet)
(evil-leader/set-key "hy" 'helm-yas-complete)