Skip to content

Commit

Permalink
✨ (init.el) Add char count to mode line
Browse files Browse the repository at this point in the history
  • Loading branch information
Comamoca committed Dec 3, 2024
1 parent 78cb417 commit c86823d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions emacs.d/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,15 @@
(add-hook 'git-commit-mode-hook (lambda ()
(setq-local completion-at-point-functions #'gitmoji-completion)))

;; Display character count in modeline
(defun update-buffer-char-count ()
(interactive)
(format "[%d 文字]" (buffer-size)))

(setq mode-line-format
(append mode-line-format
'((:eval (update-buffer-char-count)))))

;; ================ My configuratons ================

(electric-pair-mode 1)
Expand Down

0 comments on commit c86823d

Please sign in to comment.