[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-nerd-commenter 7a1647cf6d 114/235: donot use comma as
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-nerd-commenter 7a1647cf6d 114/235: donot use comma as default hotkey, v 1.5.14 |
Date: |
Thu, 6 Jan 2022 02:59:40 -0500 (EST) |
branch: elpa/evil-nerd-commenter
commit 7a1647cf6d6b56e7fe9ea226ac7c27ff73cc2157
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
donot use comma as default hotkey, v 1.5.14
---
README.org | 83 +++++++++++++++++------------------------
evil-nerd-commenter-operator.el | 7 +---
evil-nerd-commenter.el | 33 ++++++++--------
pkg.sh | 2 +-
4 files changed, 54 insertions(+), 71 deletions(-)
diff --git a/README.org b/README.org
index 5e5b2d4745..703dbe6418 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* evil-nerd-commenter (v1.5.13)
+* evil-nerd-commenter (v1.5.14)
This program can be used *independently WITHOUT
[[http://www.emacswiki.org/Evil][evil-mode]]!*
@@ -27,16 +27,44 @@ The code snippet embedded in org file will automatically be
detected and *correc
* Install
evil-nerd-commenter is already uploaded to [[http://melpa.org]]. The best way
to install is Emacs package manager.
* Set up
-** The easy way
-You need add one line into ~/.emacs to use default hotkeys,
+** Use default key bindings
+You need only one line into ~/.emacs,
#+BEGIN_SRC lisp
(evilnc-default-hotkeys)
#+END_SRC
-** The hard way
-Check "Tip 4" in "Tips" section.
+
+** Use evil-leader instead
+Install [[https://github.com/cofi/evil-leader][evil-leader according to its
README]].
+
+Insert following code into you ~/.emacs,
+#+BEGIN_SRC elisp
+;; Emacs key bindings
+(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)
+
+;; Vim key bindings
+(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 ; if you prefer backslash key
+)
+#+END_SRC
+
* Usage
** Available commands and hotkeys
Here are available commands. They 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.
@@ -130,14 +158,7 @@ All you need to is "M-x
evilnc-toggle-invert-comment-line-by-line" then "C-u 2 e
* 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]].
-"evilnc-hotkey-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.
-
-By default we assign the hotkey ",," to evilnc-hotkey-comment-operator. If you
prefer backslash key, check the "Tip 4" in "Tips" section.
-
-Here is sample elisp code:
-#+BEGIN_SRC elisp
-(setq evilnc-hotkey-comment-operator ",,")
-#+END_SRC
+"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.
@@ -175,43 +196,9 @@ Thanks for Andrew Pennebaker (aka mcandre) providing this
tip.
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.
Most popular programming languages are supported;
-** Tip 4, use evil-leader if you use the *backslash* as the leader key in
evil-mode
-- Install [[https://github.com/cofi/evil-leader][evil-leader according to its
README]].
-- Remove line "(evilnc-default-hotkeys)" from your ~/.emacs.
-- Insert below code into you ~/.emacs,
-#+BEGIN_SRC elisp
-;; Emacs key bindings
-(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)
-
-;; Vim key bindings
-(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 ; if you prefer backslash key
-)
-#+END_SRC
-
-** Tip 5, (un)comment Lisp code
+** Tip 4, (un)comment Lisp code
- Make sure Evil installed
- Press ",,a("
-** Tip 6, work around Emacs 24.4 issue
-At first, latest version (after 2014-10-30) of this program is OK.
-
-If you still got some problem, run below command in shell,
-#+begin_src sh
-find ~/.emacs.d -type f -iwholename '*/evil-nerd-commenter*.elc' | xargs rm
-#+end_src
-
* Credits
- [[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
diff --git a/evil-nerd-commenter-operator.el b/evil-nerd-commenter-operator.el
index 0c05fdcd6a..8c412eb4b7 100644
--- a/evil-nerd-commenter-operator.el
+++ b/evil-nerd-commenter-operator.el
@@ -1,10 +1,10 @@
;;; evil-nerd-commenter-operator --- Provides an evil operator for
evil-nerd-commenter
-;; Copyright (C) 2013 Chen Bin
+;; Copyright (C) 2013-2015, Chen Bin
;; Author: Chen Bin <chenbin.sh@gmail.com>
;; URL: http://github.com/redguardtoo/evil-nerd-commenter
-;; Version: 1.5.12
+;; Version: 1.5.14
;; Keywords: commenter vim line evil
;;
;; This file is not part of GNU Emacs.
@@ -69,9 +69,6 @@ Save in REGISTER or in the kill-ring with YANK-HANDLER."
(eq type 'line))
(evil-first-non-blank)))
-(define-key evil-normal-state-map evilnc-hotkey-comment-operator
'evilnc-comment-operator)
-(define-key evil-visual-state-map evilnc-hotkey-comment-operator
'evilnc-comment-operator)
-
(provide 'evil-nerd-commenter-operator)
;;; evil-nerd-commenter-operator.el ends here
diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el
index 8d078bb0bb..a050135eaa 100644
--- a/evil-nerd-commenter.el
+++ b/evil-nerd-commenter.el
@@ -1,6 +1,6 @@
;;; evil-nerd-commenter --- Comment/uncomment lines efficiently. Like Nerd
Commenter in Vim
-;; Copyright (C) 2013 Chen Bin
+;; Copyright (C) 2013-2015, Chen Bin
;; Author: Chen Bin <chenbin.sh@gmail.com>
;; URL: http://github.com/redguardtoo/evil-nerd-commenter
@@ -31,14 +31,8 @@
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-;;; WARNING:
-
-;; Emacs v24.4 has some issue if and only if you install evil-nerd-commenter
from package manager (elpa/melpa/...).
-;;
-;; This can be *easily resolved* by running below command line in shell,
-;; find ~/.emacs.d -type f -iwholename '*/evil-nerd-commenter*.elc' | xargs rm
-
;;; Commentary:
+
;;
;; This program emulates nerd-commenter.vim by Marty Grenfell.
;;
@@ -90,14 +84,8 @@
;;; Code:
-;; Example, press ",,a{" will change C code:
-;; {printf("hello");} => /* {printf("hello");}*/
-;; google "vim text object for more syntax"
-(defcustom evilnc-hotkey-comment-operator ",," "The hot key for
evilnc-comment-operator to (un)comment text object"
- :type 'string
- :group 'evil-nerd-commenter)
-
-(defvar evilnc-invert-comment-line-by-line nil "if t then invert region
comment status line by line")
+(defvar evilnc-invert-comment-line-by-line nil
+ "if t then invert region comment status line by line")
;; shamelessly copied from goto-line
(defun evilnc--goto-line (line)
@@ -532,10 +520,14 @@ or 'C-u 3 M-x
evilnc-quick-comment-or-uncomment-to-the-line' to comment to the l
(defun evilnc-default-hotkeys ()
"Set the hotkeys of evil-nerd-comment"
(interactive)
+
+ ;; Install hotkeys for Emacs mode
(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)
+
+ ;; Install key bindings for evil
(eval-after-load 'evil
'(progn
(define-key evil-normal-state-map ",ci"
'evilnc-comment-or-uncomment-lines)
@@ -544,7 +536,14 @@ or 'C-u 3 M-x
evilnc-quick-comment-or-uncomment-to-the-line' to comment to the l
(define-key evil-normal-state-map ",cc" 'evilnc-copy-and-comment-lines)
(define-key evil-normal-state-map ",cp"
'evilnc-comment-or-uncomment-paragraphs)
(define-key evil-normal-state-map ",cr" 'comment-or-uncomment-region)
- (define-key evil-normal-state-map ",cv"
'evilnc-toggle-invert-comment-line-by-line))))
+ (define-key evil-normal-state-map ",cv"
'evilnc-toggle-invert-comment-line-by-line)))
+
+ ;; Install operator for evil text objects
+ (eval-after-load 'evil-nerd-commenter-operator
+ '(progn
+ (define-key evil-normal-state-map ",," 'evilnc-comment-operator)
+ (define-key evil-visual-state-map ",," 'evilnc-comment-operator)))
+ )
;; Attempt to define the operator on first load.
;; Will only work if evil has been loaded
diff --git a/pkg.sh b/pkg.sh
index 5707a77170..245d08623b 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-pkg=evil-nerd-commenter-1.5.13
+pkg=evil-nerd-commenter-1.5.14
mkdir $pkg
cp README.org $pkg
cp *.el $pkg
- [nongnu] elpa/evil-nerd-commenter 0a33fee751 026/235: (un)comment paragraph, (continued)
- [nongnu] elpa/evil-nerd-commenter 0a33fee751 026/235: (un)comment paragraph, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 3c3fb92e67 029/235: minor typo in README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 2491e83868 030/235: hotkey to comment region, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter f8de9b168d 058/235: clean code a bit, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter ccb31ba534 061/235: finalize doc v1.2.7, ELPA Syncer, 2022/01/06
- [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 <=
- [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, 2022/01/06
- [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