Add advice to kill lines and join
This commit is contained in:
parent
71d2664f23
commit
b51bf89f7a
15
init.el
15
init.el
|
@ -247,13 +247,24 @@
|
|||
(tooltip-mode -1)
|
||||
(winner-mode +1)
|
||||
|
||||
;; Bindings
|
||||
;;; Bindings
|
||||
(:global "M-SPC" cycle-spacing
|
||||
"M-/" hippie-expand
|
||||
"M-=" count-words
|
||||
"C-x C-b" ibuffer
|
||||
"C-c i" acdw/find-emacs-dotfiles
|
||||
"C-x k" acdw/kill-a-buffer))
|
||||
"C-x k" acdw/kill-a-buffer)
|
||||
|
||||
;;; Advice
|
||||
;; `acdw/kill-line-and-join-advice' cribs from `crux-kill-and-join-forward'.
|
||||
;; I can't simply advise `kill-line' with an override from crux because crux
|
||||
;; itself calls `kill-line', leading to a infinite nesting situation.
|
||||
(advice-add 'kill-line :around
|
||||
(defun acdw/kill-line-and-join-advice (orig &rest args)
|
||||
"If at end of line, join with following; otherwise kill line."
|
||||
(if (and (eolp) (not (bolp)))
|
||||
(delete-indentation 1)
|
||||
(apply orig args)))))
|
||||
|
||||
;; Regular modes (`text-mode', `prog-mode', etc.)
|
||||
(defun acdw/setup-regular-modes ()
|
||||
|
|
Loading…
Reference in New Issue