added org-present config + various fixes

This commit is contained in:
2025-01-23 11:07:14 +01:00
parent 771ef7e17d
commit 6a9a4068a0
6 changed files with 114 additions and 2 deletions

View File

@@ -130,6 +130,7 @@
(require 'init-orgagenda) (require 'init-orgagenda)
(require 'init-orgalist) (require 'init-orgalist)
(require 'init-orgtable) (require 'init-orgtable)
(require 'init-org-present)
(require 'init-outline) (require 'init-outline)
(require 'init-markdown) (require 'init-markdown)
(require 'init-editorconfig) (require 'init-editorconfig)

View File

@@ -193,7 +193,7 @@ files marked, always operate on current line in dired-mode"
(eval-after-load 'dired (eval-after-load 'dired
'(progn '(progn
;; dired vars ;; dired vars
(setq dired-listing-switches "-lt") (setq dired-listing-switches "-lh")
;; stay with 1 dired buffer per instance ;; stay with 1 dired buffer per instance
;; when changing directories ;; when changing directories

View File

@@ -25,6 +25,7 @@
(call-interactively 'magit-status))) (call-interactively 'magit-status)))
(setq magit-view-git-manual-method 'woman (setq magit-view-git-manual-method 'woman
magit-diff-refine-hunk t
magit-commit-show-diff nil) magit-commit-show-diff nil)
(defalias 'git 'magit-status) (defalias 'git 'magit-status)

View File

@@ -1,4 +1,7 @@
(use-package ement) (use-package ement
:custom
(ement-save-sessions t)
(ement-sessions-file "~/.emacs.d/cache/ement.el"))
(provide 'init-matrix) (provide 'init-matrix)
;;; init-matrix.el ends here ;;; init-matrix.el ends here

103
lisp/init-org-present.el Normal file
View File

@@ -0,0 +1,103 @@
(use-package org-present
:config
(defun tvd/org-present-prepare-slide (buffer-name heading)
;; Show only top-level headlines
(org-overview)
;; Unfold the current entry
(org-show-entry)
;; Show only direct subheadings of the slide but don't expand them
(org-show-children))
(defun tvd/org-present-start ()
;; Tweak font sizes
(setq-local face-remapping-alist '((default (:height 1.5) variable-pitch)
(header-line (:height 4.0) variable-pitch)
(org-document-title (:height 1.75) org-document-title)
(org-code (:height 1.55) org-code)
(org-verbatim (:height 1.55) org-verbatim)
(org-block (:height 1.25) org-block)
(org-block-begin-line (:height 0.7) org-block)))
;; Set a blank header line string to create blank space at the top
(setq header-line-format " ")
;; Display inline images automatically
(org-display-inline-images)
(org-present-read-only)
(setq word-wrap t
cursor-type nil
line-spacing 5)
(hide-mode-line-mode +1)
;; Center the presentation and wrap lines
;; (visual-fill-column-mode 1)
;; (visual-line-mode 1)
(set-fringe-mode 0)
(setq tvd/margin (/ (- (window-body-width) fill-column) 5))
(org-superstar-mode)
(set-window-margins nil tvd/margin tvd/margin))
(defun tvd/org-present-end ()
;; Reset font customizations
(setq-local face-remapping-alist '((default variable-pitch default)))
;; Clear the header line string so that it isn't displayed
(setq header-line-format nil)
;; Stop displaying inline images
(org-remove-inline-images)
(org-present-show-cursor)
(org-present-read-write)
(setq word-wrap nil
cursor-type t
line-spacing nil)
(hide-mode-line-mode -1)
;; Stop centering the document
;; (visual-fill-column-mode 0)
;; (visual-line-mode 0)
(set-fringe-mode 1)
(set-window-margins nil 0 0)
(org-superstar-mode))
;; Turn on variable pitch fonts in Org Mode buffers
(add-hook 'org-mode-hook 'variable-pitch-mode)
;; Register hooks with org-present
(add-hook 'org-present-mode-hook 'tvd/org-present-start)
(add-hook 'org-present-mode-quit-hook 'tvd/org-present-end)
(add-hook 'org-present-after-navigate-functions 'tvd/org-present-prepare-slide)
(define-key org-present-mode-keymap (kbd "q") 'org-present-quit)
(define-key org-present-mode-keymap (kbd "<home>") 'org-present-top)
(define-key org-present-mode-keymap (kbd "<end>") 'org-present-end))
(use-package visual-fill-column
:config
(setq visual-fill-column-width 110
visual-fill-column-center-text t)
)
(use-package hide-mode-line)
(use-package org-superstar)
(provide 'init-org-present)

View File

@@ -213,6 +213,10 @@ down and unfold it, otherwise jump paragraph as usual."
;; no more ... at the end of a heading ;; no more ... at the end of a heading
(setq org-ellipsis "") (setq org-ellipsis "")
;; use mono spaced font in src blocks
(set-face-attribute 'org-block nil :inherit 'fixed-pitch)
(setq org-activate-links '(plain radio tag date footnote))
;; my own keywords, must be set globally, not catched correctly inside hook ;; my own keywords, must be set globally, not catched correctly inside hook
(setq org-todo-keywords (setq org-todo-keywords
'((sequence "TODO" "START" "WAIT" "|" "DONE" "CANCEL" "FAIL"))) '((sequence "TODO" "START" "WAIT" "|" "DONE" "CANCEL" "FAIL")))