mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-22 11:00:27 +10:00
Markdown headers and 'toggle' bindings.
This commit is contained in:
@@ -1,36 +1,47 @@
|
|||||||
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
(setq doom-theme 'doom-one)
|
||||||
|
|
||||||
;; 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-font (font-spec :family "JetBrains Mono" :size 15))
|
(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!
|
(custom-theme-set-faces!
|
||||||
'doom-one
|
'doom-one
|
||||||
'(org-level-8 :inherit outline-3 :height 1.0)
|
'(org-level-8 :inherit outline-3 :height 1.0)
|
||||||
@@ -43,59 +54,6 @@
|
|||||||
'(org-level-1 :inherit outline-1 :height 1.6)
|
'(org-level-1 :inherit outline-1 :height 1.6)
|
||||||
'(org-document-title :height 1.8 :bold t :underline nil))
|
'(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
|
(setq display-line-numbers-type t) ;; Turn line numbers on
|
||||||
;; available. You can either set `doom-theme' or manually load a theme with the
|
(setq confirm-kill-emacs nil) ;; Don't confirm on exit
|
||||||
;; `load-theme' function. This is the default:
|
(setq initial-buffer-choice 'eshell) ;; Eshell is initial buffer
|
||||||
(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)
|
|
||||||
|
|||||||
@@ -2,8 +2,16 @@
|
|||||||
|
|
||||||
* Table of Contents :toc:
|
* Table of Contents :toc:
|
||||||
- [[#doom-settings][Doom Settings]]
|
- [[#doom-settings][Doom Settings]]
|
||||||
|
- [[#keybindings][Keybindings]]
|
||||||
|
- [[#comment-line][Comment Line]]
|
||||||
|
- [[#toggle-bindings][Toggle bindings]]
|
||||||
|
- [[#markdown][Markdown]]
|
||||||
|
- [[#headers][Headers]]
|
||||||
|
- [[#toggle-markdown-view][Toggle Markdown View]]
|
||||||
- [[#org][Org]]
|
- [[#org][Org]]
|
||||||
- [[#other-stuff][Other Stuff]]
|
- [[#basic-settings][Basic Settings]]
|
||||||
|
- [[#headers-1][Headers]]
|
||||||
|
- [[#sensible-defaults][Sensible Defaults]]
|
||||||
|
|
||||||
* Doom Settings
|
* Doom Settings
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
@@ -12,7 +20,80 @@
|
|||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
* Keybindings
|
||||||
|
|
||||||
|
** Comment Line
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(map! :leader
|
||||||
|
:desc "Comment line" "-" #'comment-line)
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Toggle bindings
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(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))
|
||||||
|
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* Markdown
|
||||||
|
This sets the font size for each markdown header level. Having variable font sizes in a markdown outline makes it visually appealing and more readable.
|
||||||
|
|
||||||
|
|
||||||
|
** Headers
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(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)))))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Toggle Markdown View
|
||||||
|
A custom function to toggle between standard 'markdown-mode' and 'markdown-view-mode'. Custom functions in Emacs should be named as "prefix/name-of-function" to make it clear that the function is custom and not a standard Emacs function. In my case, I begin all my custom functions with 'dt'.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(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)))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
* Org
|
* Org
|
||||||
|
** Basic Settings
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
|
(setq org-directory "~/nc/Org/")
|
||||||
|
(setq org-modern-table-vertical 1)
|
||||||
|
(setq org-modern-table t)
|
||||||
|
(add-hook 'org-mode-hook #'hl-todo-mode)
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Headers
|
||||||
|
This sets the font size for each Org header level. Having variable font sizes in an Org outline makes it visually appealing and more readable.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(custom-theme-set-faces!
|
(custom-theme-set-faces!
|
||||||
'doom-one
|
'doom-one
|
||||||
@@ -26,27 +107,12 @@
|
|||||||
'(org-level-1 :inherit outline-1 :height 1.6)
|
'(org-level-1 :inherit outline-1 :height 1.6)
|
||||||
'(org-document-title :height 1.8 :bold t :underline nil))
|
'(org-document-title :height 1.8 :bold t :underline nil))
|
||||||
|
|
||||||
(setq org-directory "~/nc/Org/")
|
|
||||||
(setq org-modern-table-vertical 1)
|
|
||||||
(setq org-modern-table t)
|
|
||||||
(add-hook 'org-mode-hook #'hl-todo-mode)
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Other Stuff
|
* Sensible Defaults
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq display-line-numbers-type t)
|
(setq display-line-numbers-type t) ;; Turn line numbers on
|
||||||
|
(setq confirm-kill-emacs nil) ;; Don't confirm on exit
|
||||||
(map! :leader
|
(setq initial-buffer-choice 'eshell) ;; Eshell is initial buffer
|
||||||
: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 confirm-kill-emacs nil)
|
|
||||||
|
|
||||||
(setq initial-buffer-choice 'eshell)
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|||||||
Reference in New Issue
Block a user