Markdown headers and 'toggle' bindings.

This commit is contained in:
Derek Taylor
2025-09-19 11:40:08 -05:00
parent 194b5da8fd
commit c64cd7ffd2
2 changed files with 131 additions and 107 deletions

View File

@@ -1,36 +1,47 @@
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets. It is optional.
;; (setq user-full-name "John Doe"
;; user-mail-address "john@doe.com")
;; Doom exposes five (optional) variables for controlling fonts in Doom:
;;
;; - `doom-font' -- the primary font to use
;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable)
;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;; - `doom-symbol-font' -- for symbols
;; - `doom-serif-font' -- for the `fixed-pitch-serif' face
;;
;; See 'C-h v doom-font' for documentation and more examples of what they
;; accept. For example:
;;
;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)
;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
;;
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
;; refresh your font settings. If Emacs still can't find your font, it likely
;; wasn't installed correctly. Font issues are rarely Doom issues!
(setq doom-theme 'doom-one)
(setq doom-font (font-spec :family "JetBrains Mono" :size 15))
(map! :leader
:desc "Comment line" "-" #'comment-line)
(map! :leader
(:prefix ("t" . "toggle")
:desc "Toggle line numbers" "l" #'doom/toggle-line-numbers
:desc "Toggle eshell split" "e" #'+eshell/toggle
:desc "Toggle line highlight in frame" "h" #'hl-line-mode
:desc "Toggle line highlight globally" "H" #'global-hl-line-mode
:desc "Toggle markdown-view-mode" "m" #'dt/toggle-markdown-view-mode
:desc "Toggle truncate lines" "t" #'toggle-truncate-lines
:desc "Toggle treemacs" "T" #'+treemacs/toggle
:desc "Toggle vterm split" "v" #'+vterm/toggle))
(setq display-line-numbers-type t)
(map! :leader
(:prefix ("T" . "toggle here")
:desc "Toggle eshell split" "e" #'+eshell/here
:desc "Toggle vterm split" "v" #'+vterm/here))
(custom-set-faces
'(markdown-header-face ((t (:inherit font-lock-function-name-face :weight bold :family "variable-pitch"))))
'(markdown-header-face-1 ((t (:inherit markdown-header-face :height 1.6))))
'(markdown-header-face-2 ((t (:inherit markdown-header-face :height 1.5))))
'(markdown-header-face-3 ((t (:inherit markdown-header-face :height 1.4))))
'(markdown-header-face-4 ((t (:inherit markdown-header-face :height 1.3))))
'(markdown-header-face-5 ((t (:inherit markdown-header-face :height 1.2))))
'(markdown-header-face-6 ((t (:inherit markdown-header-face :height 1.1)))))
(defun dt/toggle-markdown-view-mode ()
"Toggle between `markdown-mode' and `markdown-view-mode'."
(interactive)
(if (eq major-mode 'markdown-view-mode)
(markdown-mode)
(markdown-view-mode)))
(setq org-directory "~/nc/Org/")
(setq org-modern-table-vertical 1)
(setq org-modern-table t)
(add-hook 'org-mode-hook #'hl-todo-mode)
(custom-theme-set-faces!
'doom-one
'(org-level-8 :inherit outline-3 :height 1.0)
@@ -43,59 +54,6 @@
'(org-level-1 :inherit outline-1 :height 1.6)
'(org-document-title :height 1.8 :bold t :underline nil))
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'doom-one)
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type t)
(map! :leader
:desc "Comment line" "-" #'comment-line)
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/nc/Org/")
(setq org-modern-table-vertical 1)
(setq org-modern-table t)
(add-hook 'org-mode-hook #'hl-todo-mode)
;; Whenever you reconfigure a package, make sure to wrap your config in an
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
;;
;; (after! PACKAGE
;; (setq x y))
;;
;; The exceptions to this rule:
;;
;; - Setting file/directory variables (like `org-directory')
;; - Setting variables which explicitly tell you to set them before their
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
;; - Setting doom variables (which start with 'doom-' or '+').
;;
;; Here are some additional functions/macros that will help you configure Doom.
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
;; etc).
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.
(setq confirm-kill-emacs nil)
(setq initial-buffer-choice 'eshell)
(setq display-line-numbers-type t) ;; Turn line numbers on
(setq confirm-kill-emacs nil) ;; Don't confirm on exit
(setq initial-buffer-choice 'eshell) ;; Eshell is initial buffer