summaryrefslogtreecommitdiff
path: root/basic.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2021-01-17 21:38:38 +0800
committerJSDurand <mmemmew@gmail.com>2021-01-17 21:38:38 +0800
commit82d3a1fcc5c36a48b2a404536f89e1d80c48d999 (patch)
treeb8df471f662006b921a0d544bd8bc171f0c9c0d5 /basic.el
parent5f61771063f35f5cd6492708d89eb220e4067f6e (diff)
Tweak more things.
* basic.el (recenter-positions): In effect nothing changed. (prot-pulse-line): Puling the line. (pulse): Useful built-in library. (durand-pulse-pulse-line): My own tweak. (durand-pulse-recenter-top): Recenter and pulse. * init.el (prepare-in-hook-once): Make it interactive. (global-map): Add Org-mode bindings. ("durand-chercher-pdf"): Search PDFs quickly. * modeline.el (modeline-format-left): Remove the vertical bar. * org-conf.el (org-adapt-indentation) (org-modules) (org-hide-emphasis-markers) (org-hide-macro-markers) (org-hide-leading-stars): Steal some configurations from Protesilaos. (global-map) (org-mode-map): Add Org-mode bindings. (durand-pulse-pulse-line): (org-follow-link-hook): Pulse and recenter when following the link.
Diffstat (limited to 'basic.el')
-rw-r--r--basic.el50
1 files changed, 50 insertions, 0 deletions
diff --git a/basic.el b/basic.el
index fcc6ed1..97b5345 100644
--- a/basic.el
+++ b/basic.el
@@ -148,6 +148,56 @@ window, then also delete the selected window."
;;;###autoload
(setq set-mark-command-repeat-pop t)
+;;; I prefer going to the top first.
+
+;; But I don't really like always going to the top. I am still
+;; thinking about solutions.
+
+(setq recenter-positions (list 'middle 'top 'bottom))
+
+;;; Pulse the current line
+
+;;;###autoload
+(defface prot-pulse-line
+ '((default :extend t)
+ (((class color) (min-colors 88) (background light))
+ :background "#8eecf4")
+ (((class color) (min-colors 88) (background dark))
+ :background "#004065")
+ (t :inverse-video t))
+ "Default face for `durand-pulse-pulse-line'.
+I stole from Protesilaos' dotemacs.")
+
+(require 'pulse)
+
+;;;###autoload
+(defun durand-pulse-pulse-line (&optional face)
+ "Temporarily highlight the current line with optional FACE."
+ (interactive)
+ (let ((start (cond
+ ((= (point) (point-max))
+ (save-excursion
+ (forward-line -1)
+ (point)))
+ ((save-excursion
+ (forward-line 0)
+ (point)))))
+ (end (save-excursion
+ (forward-line 1)
+ (point)))
+ (pulse-delay .04)
+ (face (or face 'prot-pulse-line)))
+ (pulse-momentary-highlight-region start end face)))
+
+(define-key global-map (vector 's-escape) #'durand-pulse-pulse-line)
+
+;;;###autoload
+(defun durand-pulse-recenter-top ()
+ "Recenter to the top and pulse the line."
+ (interactive)
+ (recenter 0)
+ (durand-pulse-pulse-line))
+
;;; auto-fill for texts
(set 'adaptive-fill-mode t)