diff options
author | dx <aryadevchavali1@gmail.com> | 2020-05-31 17:23:58 +0100 |
---|---|---|
committer | dx <aryadevchavali1@gmail.com> | 2020-05-31 17:23:58 +0100 |
commit | a396b216c25563f4e08c12a215bfe8c9ced52c0e (patch) | |
tree | b716c8a80f04792676ca650892efaedc1f779690 /Doom/.doom.d/modules | |
parent | d05d83e0be88a70da5ec4982e36166f68b9cdd2f (diff) | |
download | dotfiles-a396b216c25563f4e08c12a215bfe8c9ced52c0e.tar.gz dotfiles-a396b216c25563f4e08c12a215bfe8c9ced52c0e.tar.bz2 dotfiles-a396b216c25563f4e08c12a215bfe8c9ced52c0e.zip |
+visual-line segment
Diffstat (limited to 'Doom/.doom.d/modules')
-rw-r--r-- | Doom/.doom.d/modules/private/oreoline/config.el | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/Doom/.doom.d/modules/private/oreoline/config.el b/Doom/.doom.d/modules/private/oreoline/config.el index 7d34709..0bc3a41 100644 --- a/Doom/.doom.d/modules/private/oreoline/config.el +++ b/Doom/.doom.d/modules/private/oreoline/config.el @@ -38,24 +38,35 @@ (propertize "") (propertize ""))) - ;; LHS - (setq telephone-line-lhs - '((evil . (telephone-line-evil-tag-segment - telephone-line-buffer-modified-segment)) - (accent . (telephone-line-vc-segment - telephone-line-filesize-segment - telephone-line-buffer-name-segment - telephone-line-erc-modified-channels-segment - telephone-line-process-segment)) - (nil . ()))) - - ;; RHS - (setq telephone-line-rhs - '((nil . (telephone-line-misc-info-segment)) - (accent . (telephone-line-major-mode-segment - +oreoline-lsp-segment - telephone-line-flycheck-segment)) - (evil . (telephone-line-airline-position-segment)))) + ;; Visual line check + (telephone-line-defsegment +oreoline-visual-segment () + (if mark-active + (let ((lines (count-lines (region-beginning) (region-end))) + (chars (- (region-end) (region-beginning)))) + (if (< lines 2) + (propertize (format "%sC" chars)) + (propertize (format "%sL %sC" lines chars)))) + (propertize "~"))) + + (setq + ;; LHS + telephone-line-lhs + '((evil . (telephone-line-evil-tag-segment + telephone-line-buffer-modified-segment)) + (accent . (telephone-line-filesize-segment + telephone-line-buffer-name-segment + telephone-line-erc-modified-channels-segment + telephone-line-process-segment)) + (nil . ())) + ;; RHS + telephone-line-rhs + '((nil . (telephone-line-misc-info-segment)) + (accent . (telephone-line-vc-segment + +oreoline-lsp-segment + telephone-line-major-mode-segment + telephone-line-flycheck-segment)) + (modal . (+oreoline-visual-segment)) + (evil . (telephone-line-airline-position-segment)))) :config (size-indication-mode +1)) |