1 ;;; -*- lexical-binding: t -*-
3 (defun my/copy-line (arg)
4 "Copy the current line into the kill ring. With ARG copies that many lines."
6 (kill-ring-save (line-beginning-position 1)
7 (line-beginning-position (+ 1 arg)))
8 (message "Copied %d lines" arg))
10 (defun my/open-line-above (arg)
11 "Open a new line above point with indentation. With ARG insert that many lines."
15 (forward-line (- arg))
16 (indent-for-tab-command))
18 (defun my/open-line-below (arg)
19 "Open a new line below point with indentation. With ARG insert that many lines."
23 (indent-for-tab-command))
25 (defun my/substitute-line (arg)
26 "Kill the current line and leave point at correct indentation level. With ARG kill that many lines first."
29 (if (not (and (null arg) (equal (line-beginning-position) (line-end-position))))
31 (if (not (string-equal major-mode "fundamental-mode"))
32 (indent-for-tab-command)))
34 (provide 'my-line-editing)