[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-nerd-commenter 2c62dfcb80 139/235: updated documentat
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-nerd-commenter 2c62dfcb80 139/235: updated documentation |
Date: |
Thu, 6 Jan 2022 02:59:42 -0500 (EST) |
branch: elpa/evil-nerd-commenter
commit 2c62dfcb801030aef0048437dee542e5c6ce9411
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
updated documentation
---
README.org | 91 ++++++++++++++++++-----------------------
evil-nerd-commenter-operator.el | 2 +-
evil-nerd-commenter-pkg.el | 2 +-
evil-nerd-commenter.el | 9 ++--
pkg.sh | 2 +-
5 files changed, 49 insertions(+), 57 deletions(-)
diff --git a/README.org b/README.org
index b6ae13e100..0fc839a7e7 100644
--- a/README.org
+++ b/README.org
@@ -1,10 +1,10 @@
-* evil-nerd-commenter (v2.3.1)
+* evil-nerd-commenter (v2.3.2)
[[http://melpa.org/#/evil-nerd-commenter][file:http://melpa.org/packages/evil-nerd-commenter-badge.svg]]
[[http://stable.melpa.org/#/evil-nerd-commenter][file:http://stable.melpa.org/packages/evil-nerd-commenter-badge.svg]]
-This program can be used *independently WITHOUT
[[http://www.emacswiki.org/Evil][evil-mode]]!*
+This program can be used *WITHOUT*
[[http://www.emacswiki.org/Evil][evil-mode]]!
-A [[http://www.vim.org/scripts/script.php?script_id=1218][Nerd Commenter]]
emulation, help you comment code efficiently. For example, you can press key
`,,99j` or `99,ci` to comment out 99 lines.
+A [[http://www.vim.org/scripts/script.php?script_id=1218][Nerd Commenter]]
emulation, help you comment code efficiently. For example, you can press key
=,,99j= or =99,ci= to comment out 99 lines.
I recommend using it with Evil though Evil is optional.
@@ -12,25 +12,26 @@ Tested on Emacs 23.4, 24.3, 24.4, 24.5
* Why?
** A simple use case on the efficiency
-If you want to comment out nine lines. Instead pressing "C-space M-9 C-n M-;",
now you can press "M-9 M-;" or ",,9j" or "9,ci".
+If you want to comment out nine lines. Instead pressing =C-space M-9 C-n M-;=,
now you can press =M-9 M-;= or =,,9j= or =9,ci=.
The point is that you need *NOT* mark any text to comment line(s)!
-So you strike less keys than the original "M-x comment-dwim".
+So you strike less keys than the original =M-x comment-dwim=.
+
+demo:
-Live demo:
[[https://raw.github.com/redguardtoo/evil-nerd-commenter/master/evil-nerd-commenter-demo.gif]]
** It fixes Emacs bug for you
I'll provide long-term support for *ANY language* in the future. Here is an
example how I work around
[[https://github.com/redguardtoo/evil-nerd-commenter/issues/3][a bug in
autoconf.el]].
** Perfect integration with org-mode
The code snippet embedded in org file will automatically be detected and
*correct* comment syntax will be used!
-
* Install
evil-nerd-commenter is already uploaded to [[http://melpa.org]]. The best way
to install is Emacs package manager.
* Setup
-** Use default key bindings
-You need only one line into ~/.emacs,
+Please note NO key bindings are setup automatically. You need use following
ways to setup key bindings.
+** Use recommended key bindings
+Insert one line into =~/.emacs=,
#+BEGIN_SRC lisp
(evilnc-default-hotkeys)
#+END_SRC
@@ -38,7 +39,7 @@ You need only one line into ~/.emacs,
** Use evil-leader instead
Install [[https://github.com/cofi/evil-leader][evil-leader according to its
README]].
-Insert following code into you ~/.emacs,
+Insert following code into you =~/.emacs=,
#+BEGIN_SRC elisp
;; Emacs key bindings
(global-set-key (kbd "M-;") 'evilnc-comment-or-uncomment-lines)
@@ -57,6 +58,7 @@ Insert following code into you ~/.emacs,
"cp" 'evilnc-comment-or-uncomment-paragraphs
"cr" 'comment-or-uncomment-region
"cv" 'evilnc-toggle-invert-comment-line-by-line
+ "." 'evilnc-copy-and-comment-operator
"\\" 'evilnc-comment-operator ; if you prefer backslash key
)
#+END_SRC
@@ -73,26 +75,23 @@ Here is the minimum setup,
* Usage
** Available commands and hotkeys
Here are available commands which are NOT dependent on
[[http://emacswiki.org/emacs/Evil][evil-mode]]:
-
-If you use evil-leader, the =,= in all evil-mode hotkeys is replaced with =\=.
-
*** evilnc-comment-or-uncomment-lines (RECOMMENDED)
-comment/uncomment lines. This command supports negative arguments.
+Comment/uncomment lines. This command supports negative arguments.
-The hotkey is ",ci" in evil-mode and "M-;" in all modes. "M" means ALT key.
+The hotkey is ",cl" in evil-mode and "M-;" in all modes. "M" means ALT key.
If a region selected, the region is expand to make sure the region contain
whole lines. Then we comment/uncomment the expanded region. NUM is ignored.
-If the region is insided of ONE line, we comment/uncomment that region. In
this case, CORRECT comment syntax will be used for C++/Java/Javascript.
+If the region is inside of ONE line, we comment/uncomment that region. In this
case, CORRECT comment syntax will be used for C++/Java/Javascript.
This may be the *only command* you need to learn!
*** evilnc-quick-comment-or-uncomment-to-the-line
comment/uncomment from current line to the user-specified line. You can input
the rightest digit(s) to specify the line number if you want to type less.
-For example, say current line number is 497. "C-u 3 M-x
evilnc-quick-comment-or-uncomment-to-the-line" will comment to the line 503
because the rightest digit of "503" is 3.
+For example, say current line number is 497. =C-u 3 M-x
evilnc-quick-comment-or-uncomment-to-the-line= will comment to the line 503
because the rightest digit of "503" is 3.
-The hotkey is ",cl" or ",ll" in evil-mode and "C-c l" (C means Ctrl key) in
emacs normal mode.
+The hotkey is ",cl" or ",ll" in evil-mode and =C-c l= (C means Ctrl key) in
emacs normal mode.
*** evilnc-comment-or-uncomment-paragraphs
comment/uncomment paragraphs which separated by empty lines
@@ -100,16 +99,15 @@ comment/uncomment paragraphs which separated by empty lines
*** evilnc-copy-and-comment-lines
Copy and paste lines, then comment out original lines. This command supports
negative arguments.
-The hotkey is ",cc" in evil-mode and "C-c c" in emacs normal mode.
+The hotkey is ",cc" in evil-mode and =C-c c= in emacs normal mode.
*** evilnc-comment-and-kill-ring-save
Comment lines and insert original lines into =kill-ring=.
*** evilnc-comment-or-uncomment-to-the-line
-Comment to the specified line. evilnc-quick-comment-or-uncomment-to-the-line
may be better alternative.
+Comment to the specified line.
*** evilnc-toggle-comment-empty-lines
-toggle the flag to comment/uncomment empty lines.
+Toggle the flag to comment/uncomment empty lines.
The hotkey is ",cv" in evil-mode.
-
*** evilnc-copy-to-line
Copy from the current line to the user-specified line.
@@ -121,11 +119,10 @@ For example:
#+BEGIN_SRC elisp
(global-set-key (kbd "C-c C-t C-l") 'evilnc-copy-to-line)
#+END_SRC
-
*** evilnc-toggle-invert-comment-line-by-line
-Toggle flag evilnc-invert-comment-line-by-line.
+Toggle flag =evilnc-invert-comment-line-by-line=.
-When the flag is true, the command "evilnc-comment-or-uncomment-lines",
"evilnc-comment-or-uncomment-to-the-line", and
"evilnc-comment-or-uncomment-paragraphs" will be influenced. They will *invert*
each line's comment status instead comment the whole thing.
+When the flag is true, the command =evilnc-comment-or-uncomment-lines=,
=evilnc-comment-or-uncomment-to-the-line=, and
=evilnc-comment-or-uncomment-paragraphs= will be influenced. They will *invert*
each line's comment status instead comment the whole thing.
Please note this command may NOT work on complex evil text object.
*** evilnc-kill-to-line
@@ -139,27 +136,21 @@ For example:
#+BEGIN_SRC elisp
(global-set-key (kbd "C-c C-t C-l") 'evilnc-kill-to-line)
#+END_SRC
-
*** evilnc-comment-both-snippet-html
If a line is snippet wrapped HTML tags in HTML template, only the HTML syntax
is used to comment out the line by default.
-But if you `(setq evilnc-comment-both-snippet-html t)`, snippet will be
commented out with its own syntax at first. Then the wrapped html tag will be
comment out using HTML syntax. This flag has effect on all above commands.
[[http://web-mode.org/][Web-mode]] should be enabled to use this flag.
-
+But if you =(setq evilnc-comment-both-snippet-html t)=, snippet will be
commented out with its own syntax at first. Then the wrapped html tag will be
comment out using HTML syntax. This flag has effect on all above commands.
[[http://web-mode.org/][Web-mode]] should be enabled to use this flag.
** Examples
*** Comment lines
-"C-u NUM M-x evilnc-comment-or-uncomment-lines", comment/uncomment next NUM
lines.
-
+=C-u NUM M-x evilnc-comment-or-uncomment-lines=, comment/uncomment next NUM
lines.
*** Comment region
-Select a region and "M-x evilnc-comment-or-uncomment-lines". The region will
be *automatically expanded to contain whole lines*. Then we comment/uncomment
the region.
-
+Select a region and =M-x evilnc-comment-or-uncomment-lines=. The region will
be *automatically expanded to contain whole lines*. Then we comment/uncomment
the region.
*** Comment to the line number
-"C-u 56 M-x evilnc-comment-or-uncomment-to-the-line", comment/uncomment *from
current line* to line 56.
-
+=C-u 56 M-x evilnc-comment-or-uncomment-to-the-line=, comment/uncomment *from
current line* to line 56.
*** Copy and comment
-"C-u 2 M-x evilnc-copy-and-comment-lines", copy 2 lines and paste them below
the original line. Then comment out original lines. The focus will be moved to
the new lines.
-
+=C-u 2 M-x evilnc-copy-and-comment-lines=, copy 2 lines and paste them below
the original line. Then comment out original lines. The focus will be moved to
the new lines.
*** Comment paragraph
-"C-u 2 M-x evilnc-comment-or-uncomment-paragraphs", comment out two
paragraphs. This is useful if you have large hunk of data to be commented out
as below:
+=C-u 2 M-x evilnc-comment-or-uncomment-paragraphs=, comment out two
paragraphs. This is useful if you have large hunk of data to be commented out
as below:
#+BEGIN_SRC javascript
var myJson={
"key1":"v1",
@@ -167,7 +158,6 @@ var myJson={
"key3":"v3"
}
#+END_SRC
-
*** Invert comment
Say there are two lines of javascript code,
#+BEGIN_SRC javascript
@@ -176,12 +166,11 @@ if(flag==true){ doSomething(); }
#+END_SRC
The first line is production code. The second line is your debug code. You
want to invert the comment status of these two lines (for example, comment out
first line and uncomment the second line) for debug purpose.
-All you need to is "M-x evilnc-toggle-invert-comment-line-by-line" then "C-u 2
evilnc-comment-or-uncomment-lines". The first command turn on some flag, so the
behavior of (un)commenting is different.
-
+All you need to is =M-x evilnc-toggle-invert-comment-line-by-line= then =C-u 2
evilnc-comment-or-uncomment-lines=. The first command turn on some flag, so the
behavior of (un)commenting is different.
* Evil usage
-If you use [[http://emacswiki.org/emacs/Evil][Evil]], you can use
[[http://vimdoc.sourceforge.net/htmldoc/motion.html#text-objects][text objects
and motions]]. But if you only *deals with lines*, I suggest *using
evilnc-comment-or-uncomment-lines instead*.
-
-"evilnc-comment-operator" acts much like the delete/change operator. Takes a
motion or text object and comments it out, yanking its content in the process.
+If you use [[http://emacswiki.org/emacs/Evil][Evil]], you can use
[[http://vimdoc.sourceforge.net/htmldoc/motion.html#text-objects][text objects
and motions]]. But if you only *deals with lines*, I suggest using
=evilnc-comment-or-uncomment-lines= instead.
+** evilnc-comment-operator
+=evilnc-comment-operator= acts much like the delete/change operator. Takes a
motion or text object and comments it out, yanking its content in the process.
Example 1: ",,," to comment out the current line.
@@ -197,17 +186,16 @@ Example 6: ",,w" comment to the beginning of the next
word, ",,e" to the end of
Example 7: ",,it", comment the region inside html tags (all html major modes
are supported , *including [[http://web-mode.org/][web-mode]]*)
-"evilnc-copy-and-comment-operator" is another evil-mode operator. Instead of
commenting out the text in the operator-range, it inserts an copy of the text
in the range and comments out that copy.
+** evilnc-copy-and-comment-operator
+=evilnc-copy-and-comment-operator= is another evil-mode operator. Instead of
commenting out the text in the operator-range, it inserts an copy of the text
in the range and comments out that copy. Its hot key is ",.". For example,
",.," to comment out the current line.
* Tips
** Tip 1, Yank in evil-mode
-You can yank to line 99 using hotkey "y99G" or "y99gg". That's the feature
from evil-mode.
+You can yank to line 99 using hotkey =y99G= or =y99gg=. That's the feature
from evil-mode.
Please read vim manual on "text objects and motions".
** Tip 2, change comment style
-For example, use double slashes (//) instead of slash-stars (/* ... */) in
c-mode.
-
-Insert below code into your ~/.emacs:
+For example, if you prefer double slashes =//= instead of slash-stars =/* ...
*/= in =c-mode=, insert below code into your =~/.emacs=:
#+BEGIN_SRC elisp
(add-hook 'c-mode-common-hook
(lambda ()
@@ -216,11 +204,11 @@ Insert below code into your ~/.emacs:
comment-end "")))
#+END_SRC
-Thanks for Andrew Pennebaker (aka mcandre) providing this tip.
+Thanks for [[https://github.com/mcandre][Andrew Pennebaker (aka mcandre)]]
providing this tip.
** Tip 3, comment code snippet
-Please check my project
[[https://github.com/redguardtoo/evil-matchit][evil-matchit]]. You can press
"vi%" to select a region between tags and press "M-/" to comment the region.
+Please install [[https://github.com/redguardtoo/evil-matchit][evil-matchit]].
You can press =vi=%= to select a region between tags and press =M-;= to comment
the region.
-Most popular programming languages are supported;
+Most popular programming languages are supported.
** Tip 4, (un)comment Lisp code
- Make sure Evil installed
- Press ",,a("
@@ -228,5 +216,6 @@ Most popular programming languages are supported;
- [[https://github.com/lalopmak][Lally Oppenheimer (AKA lalopmak)]] added the
support for text-object in Evil
- [[https://github.com/ryuslash][Tom Willemse (AKA ryuslash)]] provided the
fix to make Emacs 24.4 work
- [[https://github.com/TheBB][Eivind Fonn (AKA TheBB)]] fixed the web-mode
issue #45
+- [[https://github.com/Dickby][Dickby]] provided
=evilnc-copy-and-comment-operator=
* Contact me
Report bug at [[https://github.com/redguardtoo/evil-nerd-commenter]].
diff --git a/evil-nerd-commenter-operator.el b/evil-nerd-commenter-operator.el
index d12a24c0f4..2cb416c661 100644
--- a/evil-nerd-commenter-operator.el
+++ b/evil-nerd-commenter-operator.el
@@ -4,7 +4,7 @@
;; Author: Chen Bin <chenbin.sh@gmail.com>
;; URL: http://github.com/redguardtoo/evil-nerd-commenter
-;; Version: 2.3.1
+;; Version: 2.3.2
;; Keywords: commenter vim line evil
;;
;; This file is not part of GNU Emacs.
diff --git a/evil-nerd-commenter-pkg.el b/evil-nerd-commenter-pkg.el
index 16ce2d1121..6639f4c3f9 100644
--- a/evil-nerd-commenter-pkg.el
+++ b/evil-nerd-commenter-pkg.el
@@ -1,2 +1,2 @@
-(define-package "evil-nerd-commenter" "2.3.1"
+(define-package "evil-nerd-commenter" "2.3.2"
"Comment/uncomment lines efficiently. Like Nerd Commenter in
Vim")
diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el
index 6e56c406bf..878aafa074 100644
--- a/evil-nerd-commenter.el
+++ b/evil-nerd-commenter.el
@@ -4,7 +4,7 @@
;; Author: Chen Bin <chenbin.sh@gmail.com>
;; URL: http://github.com/redguardtoo/evil-nerd-commenter
-;; Version: 2.3.1
+;; Version: 2.3.2
;; Keywords: commenter vim line evil
;;
;; This file is not part of GNU Emacs.
@@ -75,6 +75,7 @@
;; "cp" 'evilnc-comment-or-uncomment-paragraphs
;; "cr" 'comment-or-uncomment-region
;; "cv" 'evilnc-toggle-invert-comment-line-by-line
+;; "." 'evilnc-copy-and-comment-operator
;; "\\" 'evilnc-comment-operator)
;;
;; For certain major modes, you need manual setup to override its original
@@ -132,7 +133,7 @@ See
http://lists.gnu.org/archive/html/bug-gnu-emacs/2013-03/msg00891.html."
;; since comment-use-syntax is nil in autoconf.el, the comment-start-skip
need
;; make sure its first parenthesized expression match the string exactly
before
;; the "dnl", check the comment-start-skip in lisp-mode for sample.
- ;; See code in (defun comment-search-forward) from emacs 24.2.3.1:
+ ;; See code in (defun comment-search-forward) from emacs 24.2.3.2:
;; (if (not comment-use-syntax)
;; (if (re-search-forward comment-start-skip limit noerror)
;; (or (match-end 1) (match-beginning 0)))
@@ -650,7 +651,7 @@ Then we operate the expanded region. NUM is ignored."
(defun evilnc-version ()
"The version number."
(interactive)
- (message "2.3.1"))
+ (message "2.3.2"))
;;;###autoload
(defun evilnc-default-hotkeys ()
@@ -677,6 +678,8 @@ Then we operate the expanded region. NUM is ignored."
;; Install operator for evil text objects
(eval-after-load 'evil-nerd-commenter-operator
'(progn
+ (define-key evil-normal-state-map ",."
'evilnc-copy-and-comment-operator)
+ (define-key evil-visual-state-map ",."
'evilnc-copy-and-comment-operator)
(define-key evil-normal-state-map ",," 'evilnc-comment-operator)
(define-key evil-visual-state-map ",," 'evilnc-comment-operator))))
diff --git a/pkg.sh b/pkg.sh
index c4a8478fe5..781c7f2414 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-pkg=evil-nerd-commenter-2.3.1
+pkg=evil-nerd-commenter-2.3.2
mkdir $pkg
cp README.org $pkg
cp *.el $pkg
- [nongnu] elpa/evil-nerd-commenter 1848bc36a1 077/235: comment to the line is optimized v1.4.0, (continued)
- [nongnu] elpa/evil-nerd-commenter 1848bc36a1 077/235: comment to the line is optimized v1.4.0, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 487e1cdf2b 098/235: fixed: upgrade from melpa may fail v1.5.6, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 7c75a0e782 050/235: fixed: initialize error when set up hotkeys, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter b48da5411b 111/235: README updated, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 789a180160 100/235: FIXED: revert work on with-eval-after-load v1.5.8, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 7a1647cf6d 114/235: donot use comma as default hotkey, v 1.5.14, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 770981cffd 130/235: can comment/uncomment mixed code in web-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 8e126cda3d 133/235: workaround haml-mode comment issue, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter a0c21304e6 136/235: support react jsx, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter e1de1d759b 137/235: clean code, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 2c62dfcb80 139/235: updated documentation,
ELPA Syncer <=
- [nongnu] elpa/evil-nerd-commenter 11998038f3 143/235: default key bindings can define key bindings in non-evil mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 7c274dbb7e 147/235: remove extra spaces at end of comment object, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 8b5830a003 145/235: remove obsolete macro, Emacs v23.2 is not my concern, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 31db96711e 162/235: make check-doc happy, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 2d31dfba53 156/235: Merge pull request #77 from madand/do-not-compile-operator-file, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 34d411715e 169/235: fixed issue when stripping trailing comment delimiter characters, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 904d9ee2ed 179/235: comment operator should be compatible with evil-matchit, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 341f78551b 182/235: Fix regression for non-visual modes., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 36304a689b 184/235: tested in Emacs 24.4, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 65bb73ec49 171/235: Update README.org to reflect changes in c68ad3346f528d1cabaef76e3944748e2b8f68b2, ELPA Syncer, 2022/01/06