[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-nerd-commenter da42daecb7 055/235: new: copy and kill
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-nerd-commenter da42daecb7 055/235: new: copy and kill to specific line for non-evil users, v 1.2.5 |
Date: |
Thu, 6 Jan 2022 02:59:34 -0500 (EST) |
branch: elpa/evil-nerd-commenter
commit da42daecb7eabad9aa78d0738fa040782f1de3e3
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
new: copy and kill to specific line for non-evil users, v 1.2.5
---
README.org | 6 ++++--
evil-nerd-commenter-pkg.el | 2 +-
evil-nerd-commenter.el | 41 ++++++++++++++++++++++++++++++++++++++++-
pkg.sh | 2 +-
4 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/README.org b/README.org
index daec79d8ba..dc8fe0f80b 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* evil-nerd-commenter (current version 1.2.4)
+* evil-nerd-commenter (current version 1.2.5)
*Please note this program could be used independently without evil-mode!*
@@ -92,6 +92,8 @@ Here are available commands. They are not dependent on
[[http://emacswiki.org/em
- evilnc-copy-and-comment-lines :: copy and paste lines, then comment out
original lines
- evilnc-comment-or-uncomment-paragraphs :: comment/uncomment paragraphs which
separated by empty lines
- evilnc-toggle-comment-empty-lines :: toggle the flag to comment/uncomment
empty lines
+- evilnc-copy-to-line :: Copy from the current line to the user specified
line, *for non-evil user only, you need set hot key for it*
+- evilnc-kill-to-line :: Kill from the current line to the user specified
line, *for non-evil user only, you need set hot key for it*
Example 1:
"C-u NUM M-x evilnc-comment-or-uncomment-lines", comment/uncomment next NUM
lines.
@@ -106,7 +108,7 @@ Example 4:
"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.
Example 5:
-"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:
+"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",
diff --git a/evil-nerd-commenter-pkg.el b/evil-nerd-commenter-pkg.el
index 8cfd88824d..d85ec5dd06 100644
--- a/evil-nerd-commenter-pkg.el
+++ b/evil-nerd-commenter-pkg.el
@@ -1,2 +1,2 @@
-(define-package "evil-nerd-commenter" "1.2.4"
+(define-package "evil-nerd-commenter" "1.2.5"
"Comment/uncomment lines efficiently. Like Nerd Commenter in
Vim")
diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el
index bcc13126db..4e0ae52335 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: 1.2.4
+;; Version: 1.2.5
;; Keywords: commenter vim line evil
;;
;; This file is not part of GNU Emacs.
@@ -299,6 +299,45 @@ Paragraphs are separated by empty lines."
NUM)
)
+;; {{ for non-evil user only
+;;;###autoload
+(defun evilnc-copy-to-line (&optional LINENUM)
+ "Copy from the current line to the LINENUM line, for non-evil user only"
+ (interactive "p")
+ (if (not (region-active-p))
+ (let ((b (line-beginning-position))
+ (e (line-end-position)))
+ (save-excursion
+ (evilnc--goto-line LINENUM)
+ (if (< (line-beginning-position) b)
+ (setq b (line-beginning-position)))
+ (if (> (line-end-position) e)
+ (setq e (line-end-position)))
+ (kill-new (buffer-substring-no-properties b e))
+ )
+ )
+ ))
+
+;;;###autoload
+(defun evilnc-kill-to-line (&optional LINENUM)
+ "Kill from the current line to the LINENUM line, for non-evil user only"
+ (interactive "p")
+ (if (not (region-active-p))
+ (let ((b (line-beginning-position))
+ (e (line-end-position)))
+ (save-excursio;; n
+ (evilnc--goto-line LINENUM)
+ (if (< (line-beginning-position) b)
+ (setq b (line-beginning-position)))
+ (if (> (line-end-position) e)
+ (setq e (line-end-position)))
+ (kill-region b (+ 1 e)) ; +1 because we need remove the CR
+ )
+ )
+ ))
+
+;; }}
+
;;;###autoload
(defun evilnc-default-hotkeys ()
"Set the hotkeys of evil-nerd-comment"
diff --git a/pkg.sh b/pkg.sh
index 0e27324165..0eb793b5e3 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-pkg=evil-nerd-commenter-1.2.4
+pkg=evil-nerd-commenter-1.2.5
mkdir $pkg
cp README.org $pkg
cp *.el $pkg
- [nongnu] elpa/evil-nerd-commenter 6e560d6956 024/235: no evil-leader, upgraded to 0.0.9, (continued)
- [nongnu] elpa/evil-nerd-commenter 6e560d6956 024/235: no evil-leader, upgraded to 0.0.9, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 8a3b13ed0b 018/235: updated README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 59586d7e0b 027/235: updated doc on comment paragraphs, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter d279beb83d 035/235: Updated description, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter c9d325bb3f 037/235: Moved operator to evil section, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 223d99372d 039/235: Added check for comment operator being bound, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 229ed115d2 041/235: Streamlined evil section, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter c05e0ff2a4 045/235: Added "comment to line" evil example, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 96093a934d 049/235: fixed: eval-expression hotkey occupied, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter dcaf985835 051/235: fixed: v1.2.2 and v1.2.1 cannot be installed, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter da42daecb7 055/235: new: copy and kill to specific line for non-evil users, v 1.2.5,
ELPA Syncer <=
- [nongnu] elpa/evil-nerd-commenter 9f15aec3ce 056/235: support negative argument v1.2.6, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 2ac5d14f34 060/235: Merge pull request #21 from mswift42/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter cc31b0a602 059/235: Fixed type in save-excursion., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter adb8ba60de 062/235: minor wording update, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 9450c91c71 063/235: Bufgix in evilnc--in-comment-p, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter d03db1baef 066/235: update doc on comment style, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 277ea53931 067/235: Fixed uncommenting line "spilling" to next line, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 5f09387d60 069/235: doc updated v1.2.9, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter c156331ed2 075/235: better comment to the line, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter a5ec49a54e 079/235: ad for evil-matchit, ELPA Syncer, 2022/01/06