branch: elpa/evil-nerd-commenter
commit f9bdfa9a70a40e7ee0df1128d0931c33ccb1edb3
Author: Chen Bin <[email protected]>
Commit: Chen Bin <[email protected]>
sample setup for evil-leader users v1.5.5
---
README.org | 14 +++++---------
evil-nerd-commenter-pkg.el | 2 +-
evil-nerd-commenter.el | 37 +++++++++++++++++++++++++++++++------
pkg.sh | 2 +-
4 files changed, 38 insertions(+), 17 deletions(-)
diff --git a/README.org b/README.org
index 62fb15c14d..c47d493124 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* evil-nerd-commenter (v1.5.4)
+* evil-nerd-commenter (v1.5.5)
*This program could be used independently WITHOUT evil-mode!*
@@ -80,19 +80,14 @@ If you don't use emacs package manager please insert below
code into your ~/.ema
;; ",," is the default value of evilnc-hotkey-comment-operator,
;; so below line is NOT needed.
;; But please put it *ABOVE* the (require 'evil-nerd-commenter)!!!
+;; Please note if you use evil-leader, (setq evilnc-hotkey-comment-operator
"\\\\")
+;; does NOT work! You need set up the hot key for command
"evilnc-comment-operator" directly.
+;; Check the end of README for sample setup
(setq evilnc-hotkey-comment-operator ",,")
(require 'evil-nerd-commenter)
(evilnc-default-hotkeys)
#+END_SRC
-** Use back slash as the leader key in evil-mode
-Remove line "(evilnc-default-hotkeys)" from your ~/.emacs and re-assign hot
key manually.
-
-Besides, ",," is used for commenting text object. So you need re-define that
hot key. Insert below code into ~/.emacs:
-#+BEGIN_SRC elisp
-(setq evilnc-hotkey-comment-operator "\\")
-#+END_SRC
-
* Usage
** Available commands and hot keys
Here are available commands. They are not dependent on
[[http://emacswiki.org/emacs/Evil][evil-mode]]:
@@ -255,6 +250,7 @@ Most popular programming languages are supported;
"cp" 'evilnc-comment-or-uncomment-paragraphs
"cr" 'comment-or-uncomment-region
"cv" 'evilnc-toggle-invert-comment-line-by-line
+ "\\" 'evilnc-comment-operator
)
#+END_SRC
diff --git a/evil-nerd-commenter-pkg.el b/evil-nerd-commenter-pkg.el
index 5fc79e2d69..ba6171c151 100644
--- a/evil-nerd-commenter-pkg.el
+++ b/evil-nerd-commenter-pkg.el
@@ -1,2 +1,2 @@
-(define-package "evil-nerd-commenter" "1.5.4"
+(define-package "evil-nerd-commenter" "1.5.5"
"Comment/uncomment lines efficiently. Like Nerd Commenter in
Vim")
diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el
index c8539f19d7..d0472c1362 100644
--- a/evil-nerd-commenter.el
+++ b/evil-nerd-commenter.el
@@ -4,7 +4,7 @@
;; Author: Chen Bin <[email protected]>
;; URL: http://github.com/redguardtoo/evil-nerd-commenter
-;; Version: 1.5.4
+;; Version: 1.5.5
;; Keywords: commenter vim line evil
;;
;; This file is not part of GNU Emacs.
@@ -42,14 +42,39 @@
;; For example, `C-u 9 evilnc-quick-comment-or-uncomment-to-the-line` will
comment code from
;; current line to line 99 if you current line is 91.
;;
-;; Check README for more use cases.
-;;
;; Though this program could be used *independently*, I highly recommend you
use it with
;; evil (http://gitorious.org/evil)
;;
;; Evil makes you take advantage of power of Vi to comment lines in shocking
speed.
;; For example, you can press key `99,ci` to comment out 99 lines.
-
+;;
+;; Setup:
+;;
+;; Check https://github.com/redguardtoo/evil-nerd-commenter for more use cases.
+;;
+;; Use case 1, If you use comma as leader key, as most Vim users do, setup is
just one liner,
+;; (evilnc-default-hotkeys)
+;;
+;; Use case 2, If you are using evil-leader and didn't change the whose
default leader key,
+;; insert below setup into your ~/.emacs instead,
+;;
+;; (global-set-key (kbd "M-;") 'evilnc-comment-or-uncomment-lines)
+;; (global-set-key (kbd "C-c l")
'evilnc-quick-comment-or-uncomment-to-the-line)
+;; (global-set-key (kbd "C-c c") 'evilnc-copy-and-comment-lines)
+;; (global-set-key (kbd "C-c p") 'evilnc-comment-or-uncomment-paragraphs)
+;;
+;; (require 'evil-leader)
+;; (global-evil-leader-mode)
+;; (evil-leader/set-key
+;; "ci" 'evilnc-comment-or-uncomment-lines
+;; "cl" 'evilnc-quick-comment-or-uncomment-to-the-line
+;; "ll" 'evilnc-quick-comment-or-uncomment-to-the-line
+;; "cc" 'evilnc-copy-and-comment-lines
+;; "cp" 'evilnc-comment-or-uncomment-paragraphs
+;; "cr" 'comment-or-uncomment-region
+;; "cv" 'evilnc-toggle-invert-comment-line-by-line
+;; "\\" 'evilnc-comment-operator
+;; )
;;; Code:
@@ -68,7 +93,7 @@
(widen)
(goto-char (point-min))
(if (eq selective-display t)
- (re-search-forward "[\n\C-m]" nil 'end (1- line))
+ (re-search-forward "[\n\C-m]" nil 'end (1- line))
(forward-line (1- line))))
)
@@ -476,7 +501,7 @@ or 'C-u 3 M-x
evilnc-quick-comment-or-uncomment-to-the-line' to comment to the l
;;;###autoload
(defun evilnc-version ()
(interactive)
- (message "1.5.4"))
+ (message "1.5.5"))
;;;###autoload
(defun evilnc-default-hotkeys ()
diff --git a/pkg.sh b/pkg.sh
index 7278ee0319..b19fc02abe 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-pkg=evil-nerd-commenter-1.5.4
+pkg=evil-nerd-commenter-1.5.5
mkdir $pkg
cp README.org $pkg
cp *.el $pkg