From 43d36c52d8382852d2dc648b4389f90f76ee3753 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 18 Sep 2021 11:04:35 +0100 Subject: Add export with broken links --- doom/config.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doom/config.el') diff --git a/doom/config.el b/doom/config.el index 38ad78d..9ce5089 100644 --- a/doom/config.el +++ b/doom/config.el @@ -347,6 +347,8 @@ (content "article" "content") (postamble "footer" "postamble"))) + (setq org-export-with-broken-links t) + (require 'calendar) (setq calendar-mark-diary-entries-flag t) (setq calendar-mark-holidays-flag t) -- cgit From 3d818e0635b9d121615ed4853271eaef77b957fc Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 18 Sep 2021 11:36:00 +0100 Subject: Remove counsel from configuration --- doom/config.el | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'doom/config.el') diff --git a/doom/config.el b/doom/config.el index a56220c..ea2df57 100644 --- a/doom/config.el +++ b/doom/config.el @@ -496,12 +496,6 @@ (set-register ?p (cons 'file "~/Dropbox/org/projects.org")) (set-register ?c (cons 'file (format-time-string "~/Dropbox/org/%Y-%m.org"))) -(use-package counsel - :config - (setq counsel-rg-base-command - '("rg" "-M" "240" "--max-columns-preview" "--with-filename" - "--no-heading" "--line-number" "--color" "never" "%s"))) - ;; Bibtex stuff (use-package! ebib :bind (("C-c y b" . ebib)) @@ -671,10 +665,10 @@ (org-zettelkasten-create-next) (org-zettelkasten-create-branch)))) -(defun org-zettelkasten-search-current-id () - (interactive) - (let ((current-id (org-entry-get nil "CUSTOM_ID"))) - (counsel-rg (concat "#" current-id) "~/Dropbox/zk" "-g *.org" "ID: "))) +;;(defun org-zettelkasten-search-current-id () +;; (interactive) +;; (let ((current-id (org-entry-get nil "CUSTOM_ID"))) +;; (counsel-rg (concat "#" current-id) "~/Dropbox/zk" "-g *.org" "ID: "))) (define-key org-mode-map (kbd "C-c y n") #'org-zettelkasten-create-dwim) (define-key org-mode-map (kbd "C-c y s") #'org-zettelkasten-search-current-id) -- cgit From 7361700a83590ae0293e9d346c809d3af9f9575a Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 18 Sep 2021 12:17:17 +0100 Subject: Setup different completion framework --- doom/config.el | 192 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 159 insertions(+), 33 deletions(-) (limited to 'doom/config.el') diff --git a/doom/config.el b/doom/config.el index ea2df57..5612237 100644 --- a/doom/config.el +++ b/doom/config.el @@ -1,35 +1,11 @@ -;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- - -;; Some functionality uses this to identify you, e.g. GPG configuration, email -;; clients, file templates and snippets. -(setq user-full-name "Yann Herklotz" - user-mail-address "yann@yannherklotz.com") - -;; Doom exposes five (optional) variables for controlling fonts in Doom. Here -;; are the three important ones: -;; -;; + `doom-font' -;; + `doom-variable-pitch-font' -;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for -;; presentations or streaming. -;; -;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd -;; font string. You generally only need these two: -(setq doom-font (font-spec :family "Iosevka" :size 16) -;; doom-variable-pitch-font (font-spec :family "Alegreya" :size 12) -;; doom-serif-font (font-spec :family "Alegreya" :size 12)) -) -;; 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-font (font-spec :family "Iosevka" :size 16)) +(setq doom-variable-pitch-font (font-spec :family "Alegreya" :size 12)) +(setq doom-serif-font (font-spec :family "Alegreya" :size 12)) + (setq doom-theme 'modus-operandi) -;; 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 "~/Dropbox/org/") -;; 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 nil) ;; Disable stuff @@ -835,8 +811,158 @@ https://yannherklotz.com") '(("yann@yannherklotz.com" . "mailbox/Sent -inbox +sent -unread +mailbox -new") ("yann.herklotz15@imperial.ac.uk" . "\"imperial/Sent Items\" -inbox +sent -unread +imperial -new")))) -;;(use-package! ox-ssh -;; :after org -;; :config -;; (when (eq system-type 'darwin) -;; (setq org-ssh-header "XAuthLocation /opt/X11/bin/xauth"))) +(use-package! orderless + :custom (completion-styles '(substring orderless))) + +(use-package! vertico + :init + (vertico-mode)) + +(use-package! savehist + :init + (savehist-mode)) + +;; Enable richer annotations using the Marginalia package +(use-package! marginalia + ;; Either bind `marginalia-cycle` globally or only in the minibuffer + :bind (("M-A" . marginalia-cycle) + :map minibuffer-local-map + ("M-A" . marginalia-cycle)) + + ;; The :init configuration is always executed (Not lazy!) + :init + + ;; Must be in the :init section of use-package such that the mode gets + ;; enabled right away. Note that this forces loading the package. + (marginalia-mode)) + + +(use-package! embark + :bind + (("C-." . embark-act) ;; pick some comfortable binding + ("C-;" . embark-dwim) ;; good alternative: M-. + ("C-h B" . embark-bindings)) ;; alternative for `describe-bindings' + :init + ;; Optionally replace the key help with a completing-read interface + (setq prefix-help-command #'embark-prefix-help-command) + :config + (add-to-list 'display-buffer-alist + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none))))) + +(use-package! embark-consult + :after (embark consult) + :demand t ; only necessary if you have the hook below + ;; if you want to have consult previews as you move around an + ;; auto-updating embark collect buffer + :hook + (embark-collect-mode . consult-preview-at-point-mode)) + +;; Example configuration for Consult +(use-package! consult + ;; Replace bindings. Lazily loaded due by `use-package'. + :bind (;; C-c bindings (mode-specific-map) + ("C-c h" . consult-history) + ("C-c m" . consult-mode-command) + ("C-c b" . consult-bookmark) + ("C-c k" . consult-kmacro) + ;; C-x bindings (ctl-x-map) + ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command + ("C-x b" . consult-buffer) ;; orig. switch-to-buffer + ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window + ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame + ;; Custom M-# bindings for fast register access + ("M-#" . consult-register-load) + ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) + ("C-M-#" . consult-register) + ;; Other custom bindings + ("M-y" . consult-yank-pop) ;; orig. yank-pop + (" a" . consult-apropos) ;; orig. apropos-command + ;; M-g bindings (goto-map) + ("M-g e" . consult-compile-error) + ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck + ("M-g g" . consult-goto-line) ;; orig. goto-line + ("M-g M-g" . consult-goto-line) ;; orig. goto-line + ("M-g o" . consult-outline) ;; Alternative: consult-org-heading + ("M-g m" . consult-mark) + ("M-g k" . consult-global-mark) + ("M-g i" . consult-imenu) + ("M-g I" . consult-imenu-multi) + ;; M-s bindings (search-map) + ("M-s f" . consult-find) + ("M-s F" . consult-locate) + ("M-s g" . consult-grep) + ("M-s G" . consult-git-grep) + ("M-s r" . consult-ripgrep) + ("M-s l" . consult-line) + ("M-s L" . consult-line-multi) + ("M-s m" . consult-multi-occur) + ("M-s k" . consult-keep-lines) + ("M-s u" . consult-focus-lines) + ;; Isearch integration + ("M-s e" . consult-isearch) + :map isearch-mode-map + ("M-e" . consult-isearch) ;; orig. isearch-edit-string + ("M-s e" . consult-isearch) ;; orig. isearch-edit-string + ("M-s l" . consult-line) ;; needed by consult-line to detect isearch + ("M-s L" . consult-line-multi)) ;; needed by consult-line to detect isearch + + ;; Enable automatic preview at point in the *Completions* buffer. + ;; This is relevant when you use the default completion UI, + ;; and not necessary for Vertico, Selectrum, etc. + :hook (completion-list-mode . consult-preview-at-point-mode) + + ;; The :init configuration is always executed (Not lazy) + :init + + (setq register-preview-delay 0 + register-preview-function #'consult-register-format) + + (advice-add #'register-preview :override #'consult-register-window) + + ;; Optionally replace `completing-read-multiple' with an enhanced version. + (advice-add #'completing-read-multiple :override #'consult-completing-read-multiple) + + ;; Use Consult to select xref locations with preview + (setq xref-show-xrefs-function #'consult-xref + xref-show-definitions-function #'consult-xref) + :config + + (consult-customize + consult-theme + :preview-key '(:debounce 0.2 any) + consult-ripgrep consult-git-grep consult-grep + consult-bookmark consult-recent-file consult-xref + consult--source-file consult--source-project-file consult--source-bookmark + :preview-key (kbd "M-.")) + + ;; Optionally configure the narrowing key. + ;; Both < and C-+ work reasonably well. + (setq consult-narrow-key "<") ;; (kbd "C-+") + + (setq consult-project-root-function + (lambda () + (when-let (project (project-current)) + (car (project-roots project)))))) + +(use-package! emacs + :init + ;; Add prompt indicator to `completing-read-multiple'. + ;; Alternatively try `consult-completing-read-multiple'. + (defun crm-indicator (args) + (cons (concat "[CRM] " (car args)) (cdr args))) + (advice-add #'completing-read-multiple :filter-args #'crm-indicator) + + ;; Do not allow the cursor in the minibuffer prompt + (setq minibuffer-prompt-properties + '(read-only t cursor-intangible t face minibuffer-prompt)) + (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) + + ;; Emacs 28: Hide commands in M-x which do not work in the current mode. + ;; Vertico commands are hidden in normal buffers. + (setq read-extended-command-predicate + #'command-completion-default-include-p) + + ;; Enable recursive minibuffers + (setq enable-recursive-minibuffers t)) -- cgit