From ea1e815c3dc1781aa5cb6d401e233c73fa8a108b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 26 Jun 2023 15:17:20 +1000 Subject: Adapted more configs from other emacs configs Including wasamasa and jwiegley --- emacs/.emacs.d/lisp/my/my-editing.el | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'emacs/.emacs.d/lisp/my/my-editing.el') diff --git a/emacs/.emacs.d/lisp/my/my-editing.el b/emacs/.emacs.d/lisp/my/my-editing.el index 47e33a3..940a338 100644 --- a/emacs/.emacs.d/lisp/my/my-editing.el +++ b/emacs/.emacs.d/lisp/my/my-editing.el @@ -3,9 +3,6 @@ ;; Copyright (C) 2023 Free Software Foundation. ;; Author: Yuchen Pei -;; Protesilaos Stavrou -;; Stefan Monnier -;; Maintainer: Yuchen Pei ;; Package-Requires: ((emacs "28.2")) ;; This file is part of dotfiles. @@ -336,6 +333,13 @@ Basically move the line up (goto-line line) (forward-char col))) +(defun my-kill-line (&optional arg) + "Calls `my-kill-forward' or `kill-line' in case of prefix arg." + (interactive "P") + (if prefix-arg + (kill-line) + (my-kill-forward))) + (defun my-kill-forward () "Kill towards end of line, but not out of sexp." (interactive) @@ -354,6 +358,13 @@ Basically move the line up (setq end (point))) (kill-region (point) end)))) +(defun my-kill-line-backward (&optional arg) + "Calls `my-kill-backward' or `kill-line' with 0 in case of prefix arg." + (interactive "P") + (if prefix-arg + (kill-line 0) + (my-kill-backward))) + (defun my-kill-backward () "Kill towards beginning of line, but not out of sexp." (interactive) @@ -385,5 +396,10 @@ With an prefix-arg, copy the file name relative to project root." (kill-new to-kill) (message "Copied %s" to-kill))) +(defun my-non-special-modes-setup () + (setq indicate-empty-lines t) + (setq show-trailing-whitespace t) + ) + (provide 'my-editing) ;;; my-editing.el ends here -- cgit v1.2.3