Skip to content

Commit

Permalink
tweak(nov): remove unneeded UI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Oct 28, 2023
1 parent 5e6a410 commit 4e3fd06
Showing 1 changed file with 8 additions and 61 deletions.
69 changes: 8 additions & 61 deletions modules/me-docs.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,71 +25,18 @@
(nov-save-place-file (concat minemacs-local-dir "nov/save-place.el"))
:config
(+nmap! :keymaps 'nov-mode-map
"RET" #'nov-scroll-up)
(defun doom-modeline-segment--nov-info ()
(concat " " (propertize (cdr (assoc 'creator nov-metadata))
'face 'doom-modeline-project-parent-dir)
" " (cdr (assoc 'title nov-metadata))
" " (propertize (format "%d/%d" (1+ nov-documents-index)
(length nov-documents))
'face 'doom-modeline-info)))

(advice-add 'nov-render-title :override #'ignore)

(defun +nov-mode-setup ()
(face-remap-add-relative 'variable-pitch
:family "Merriweather"
:height 1.4
:width 'semi-expanded)
(face-remap-add-relative 'default :height 1.3)
(setq-local line-spacing 0.2
next-screen-context-lines 4
shr-use-colors nil)
(require 'visual-fill-column nil t)
(setq-local visual-fill-column-center-text t
visual-fill-column-width 80
nov-text-width 80)
(visual-fill-column-mode 1)
(hl-line-mode -1)

(setq-local
mode-line-format
`((:eval
(doom-modeline-segment--workspace-name))
(:eval
(doom-modeline-segment--window-number))
(:eval
(doom-modeline-segment--nov-info))
,(propertize
" %P "
'face 'doom-modeline-buffer-minor-mode)
,(propertize
" "
'face (if (doom-modeline--active) 'mode-line 'mode-line-inactive)
'display `((space
:align-to
(- (+ right right-fringe right-margin)
,(* (let ((width (doom-modeline--font-width)))
(or (and (= width 1) 1)
(/ width (frame-char-width) 1.0)))
(string-width
(format-mode-line
(cons ""
'(:eval (doom-modeline-segment--major-mode))))))))))
(:eval (doom-modeline-segment--major-mode))))))

(defconst +tuntox-available-p (executable-find "tuntox"))
(defconst +stunnel-available-p (executable-find "stunnel"))
"RET" #'nov-scroll-up))

(defconst +tuntox-available-p (and (executable-find "tuntox") t))
(defconst +stunnel-available-p (and (executable-find "stunnel") t))

(use-package crdt
:straight t
:when (or +tuntox-available-p +stunnel-available-p)
:init
(cond (+tuntox-available-p
(setq crdt-use-tuntox t
crdt-tuntox-password-in-url t))
(+stunnel-available-p
(setq crdt-use-stunnel t))))
:custom
(crdt-tuntox-password-in-url t)
(crdt-use-tuntox +tuntox-available-p)
(crdt-use-stunnel +stunnel-available-p))

(defconst +easydraw-available-p (+emacs-features-p 'rsvg 'zlib 'libxml2))

Expand Down

0 comments on commit 4e3fd06

Please sign in to comment.