Emacs: Add and bind my/toggle-truncate-lines().

This commit is contained in:
tastytea 2020-05-18 16:09:26 +02:00
parent 79f61ba47b
commit 93332104db
2 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,6 @@
;;; common.el --- Common settings for text files. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-05-17T19:23:12+0200>
;; Time-stamp: <2020-05-18T16:08:49+0200>
;;; Commentary:
@ -13,11 +13,18 @@
:custom ((require-final-newline t) ; Always add newline at end of file.
(fill-column 80) ; Documents are 80 chars wide by default.
(word-wrap t)) ; Wrap at word for continuation lines.
:config (defun my/toggle-truncate-lines ()
"Toggle `truncate-lines'."
(interactive)
(if truncate-lines
(setq truncate-lines nil)
(setq truncate-lines t)))
:bind (("C-r" . jump-to-register) ; Move point to location in register.
("C-S-r" . point-to-register); Store location of point in register.
("M-W" . copy-to-register) ; Store text in register.
("C-S-y" . insert-register) ; Insert text from register.
("M-<f7>" . list-registers)) ; List all registers.
("M-<f7>" . list-registers) ; List all registers.
("C-c t" . my/toggle-truncate-lines))
:hook (text-mode . auto-fill-mode)) ; Enable word-wrapping at fill-column.
;; Quickly jump to next/previous register.

View File

@ -1,2 +1,2 @@
127.0.0.1:51313 880
127.0.0.1:51313 6149
phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh