[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/crux 3b377b4 054/112: Add smart kill line function
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/crux 3b377b4 054/112: Add smart kill line function |
Date: |
Wed, 11 Aug 2021 09:57:52 -0400 (EDT) |
branch: elpa/crux
commit 3b377b4fdd23df35f72bcb1021800d41fdccf863
Author: Adam Hess <adamhess1991@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Add smart kill line function
---
README.md | 1 +
crux.el | 13 +++++++++++++
2 files changed, 14 insertions(+)
diff --git a/README.md b/README.md
index 0f45a6f..e763da5 100644
--- a/README.md
+++ b/README.md
@@ -43,6 +43,7 @@ individual commands to whatever keybindings you prefer.
Command | Suggested Keybinding(s)
| Description
----------------------------------------------------|---------------------------------|------------------------
`crux-open-with` | <kbd>C-c o</kbd> |
Open the currently visited file with an external program.
+`crux-smart-kill-line` | <kbd>C-k</kbd> or
<kbd>Super-k</kbd> | First kill to end of line, then kill the whole line.
`crux-smart-open-line-above` | <kbd>C-S-RET</kbd> or
<kbd>Super-o</kbd> | Insert an empty line above the current line and indent it
properly.
`crux-smart-open-line` | <kbd>S-RET</kbd> or
<kbd>M-o</kbd> | Insert an empty line and indent it properly (as in most IDEs).
`crux-cleanup-buffer-or-region` | <kbd>C-c n</kbd> | Fix
indentation in buffer and strip whitespace.
diff --git a/crux.el b/crux.el
index 3ed126d..8050cdf 100644
--- a/crux.el
+++ b/crux.el
@@ -180,6 +180,19 @@ With a prefix ARG open line above the current line."
(move-end-of-line nil)
(newline-and-indent))))
+(defun crux-smart-kill-line (arg)
+ "Kill to the end of the line and kill whole line on the next call"
+ (interactive "P")
+ (let ((orig-point (point)))
+ (move-end-of-line 1)
+ (if (= orig-point (point))
+ (crux-kill-whole-line)
+ (progn
+ (goto-char orig-point)
+ (kill-line))
+ )))
+
+
(defun crux-top-join-line ()
"Join the current line with the line beneath it."
(interactive)
- [nongnu] elpa/crux 2be95ea 040/112: Use read-from-minibuffer for the new file name, (continued)
- [nongnu] elpa/crux 2be95ea 040/112: Use read-from-minibuffer for the new file name, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux e2124c8 023/112: Merge pull request #6 from verdammelt/patch-1, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 3c14b4a 024/112: Merge pull request #13 from jiegec/master, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 79e500e 030/112: Add multiple choice with completion for shell init files., ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux e6c7421 035/112: Remove crux-swap-windows and alias it to crux-transpose-windows, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 5938c84 036/112: Merge pull request #21 from dgtized/transpose-windows, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 6d11d2e 039/112: When opening a line above, don't reindent the current line, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 1967a75 041/112: Allow users to create directories with crux-rename-file-and-buffer, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 582a68d 046/112: Fix the version header, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux bcbfdec 048/112: Don't assume ido when offering files from recentf (#33), ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 3b377b4 054/112: Add smart kill line function,
ELPA Syncer <=
- [nongnu] elpa/crux 1c2c179 061/112: Improve a docstring, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 2b6ddf0 060/112: Add missing space, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 5a7201a 062/112: Fix a docstring, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 32baf6a 064/112: Bump the development version, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux a71669e 033/112: Merge pull request #17 from jiegec/master, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux cf547b7 037/112: Typo Fix: Missed an s in transpose, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux a6e0a52 043/112: Define a minor mode for crux-reopen-as-root (#28), ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 2cdf266 069/112: Insert literal s-exp instead of printing in crux-eval-and-replace (#50), ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 2b4bf62 074/112: Give crux group to crux-reopen-as-root-mode, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 772123a 081/112: Support using any shell creating function with crux-visit-term-buffer, ELPA Syncer, 2021/08/11