From acf8229674bb1ba6be0f136ca8bbf51f47aeeb52 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 12 Aug 2021 14:22:52 -0500 Subject: Change my word-count stuff to use wc-mode More efficient (well, it doesn't block anyway) --- init.el | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 0883a38..3475aa9 100644 --- a/init.el +++ b/init.el @@ -1391,7 +1391,8 @@ if ripgrep is installed, otherwise `consult-grep'." acdw-modeline/position) (simple-modeline-segment-misc-info acdw-modeline/erc - acdw-modeline/word-count + ;; acdw-modeline/word-count + acdw-modeline/wc acdw-modeline/text-scale simple-modeline-segment-process acdw-modeline/god-mode-indicator @@ -1479,7 +1480,21 @@ if ripgrep is installed, otherwise `consult-grep'." cand)) (advice-add #'vertico--format-candidate :around #'vertico-format@add-arrow)) +(setup (:straight wc-mode) ; TODO: move some of this stuff around + + (:option wc-modeline-format "[%tww]" + wc-idle-wait 1) + (:hook-into text-mode) + + (add-hook 'org-mode-hook + (defun org-mode@wc-stupid () + (setq-local wc-count-words-function + #'acdw-org/count-words-stupidly))) + + (defun acdw-modeline/wc () + "Display current `wc-buffer-stats'." + (or wc-buffer-stats "[w]"))) (setup (:straight web-mode) (:option css-level-offset 2 -- cgit 1.4.1-21-gabe81