Skip to content

Latest commit

 

History

History
310 lines (292 loc) · 11.8 KB

config.org

File metadata and controls

310 lines (292 loc) · 11.8 KB

Doom Emacs Config

File options

turn on lexical binding

;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-

Linenum

(setq display-line-numbers-type 't)

Org

Org Bullets

(require 'org-bullets)
(use-package org-bullets
  :hook (org-mode . org-bullets-mode))

Org Folder

(setq org-directory "~/org/")

Org to Latex

(setq org-use-sub-superscripts nil)
(setq org-latex-to-pdf-process
  '("xelatex -interaction nonstopmode %f"
     "xelatex -interaction nonstopmode %f")) ;; for multiple passes
(setq org-latex-pdf-process (list
   "latexmk -pdflatex='lualatex -shell-escape -interaction nonstopmode' -pdf -f  %f"))
(require 'org-make-toc)

PDF viewer

(setq +latex-viewers '(okular pdf-tools))
(add-to-list 'org-file-apps '("\\.pdf" . "okular %s"))
(after! tex
  (add-to-list 'TeX-view-program-list '("Okular" "evince %o"))
  (add-to-list 'TeX-view-program-selection '(output-pdf "Okular")))

Latex

Compile

(setq TeX-save-query nil
      TeX-show-compilation t
      TeX-command-extra-options "-shell-escape")
(after! latex
  (add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil t)))

Appearance

Font

;; 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 "monospace" :size 12 :weight 'semi-light)
;;       doom-variable-pitch-font (font-spec :family "sans" :size 13))
(setq doom-font (font-spec :family "Iosevka SS13 Medium Extended" :size 18)
      doom-big-font (font-spec :family "Iosevka SS13 Medium Extended" :size 28)
      doom-variable-pitch-font (font-spec :family "Hack" :size 16)
      doom-serif-font (font-spec :family "IBM Plex Mono" :weight 'light)
      )

Theme

;; 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-vibrant)

Fullscreen

(add-to-list 'default-frame-alist '(fullscreen . maximized))

Beacon

(require 'beacon)
(setq beacon-mode 1)

Evil Mode

(require 'evil-multiedit)
;; Highlights all matches of the selection in the buffer.
(define-key evil-visual-state-map "R" 'evil-multiedit-match-all)

;; Match the word under cursor (i.e. make it an edit region). Consecutive presses will
;; incrementally add the next unmatched match.
(define-key evil-normal-state-map (kbd "M-d") 'evil-multiedit-match-and-next)
;; Match selected region.
(define-key evil-visual-state-map (kbd "M-d") 'evil-multiedit-match-and-next)
;; Insert marker at point
(define-key evil-insert-state-map (kbd "M-d") 'evil-multiedit-toggle-marker-here)

;; Same as M-d but in reverse.
(define-key evil-normal-state-map (kbd "M-D") 'evil-multiedit-match-and-prev)
(define-key evil-visual-state-map (kbd "M-D") 'evil-multiedit-match-and-prev)

;; OPTIONAL: If you prefer to grab symbols rather than words, use
;; `evil-multiedit-match-symbol-and-next` (or prev).

;; Restore the last group of multiedit regions.
(define-key evil-visual-state-map (kbd "C-M-D") 'evil-multiedit-restore)

;; RET will toggle the region under the cursor
(define-key evil-multiedit-state-map (kbd "RET") 'evil-multiedit-toggle-or-restrict-region)

;; ...and in visual mode, RET will disable all fields outside the selected region
(define-key evil-motion-state-map (kbd "RET") 'evil-multiedit-toggle-or-restrict-region)

;; For moving between edit regions
(define-key evil-multiedit-state-map (kbd "C-n") 'evil-multiedit-next)
(define-key evil-multiedit-state-map (kbd "C-p") 'evil-multiedit-prev)
(define-key evil-multiedit-insert-state-map (kbd "C-n") 'evil-multiedit-next)
(define-key evil-multiedit-insert-state-map (kbd "C-p") 'evil-multiedit-prev)

;; Ex command that allows you to invoke evil-multiedit with a regular expression, e.g.
(evil-ex-define-cmd "ie[dit]" 'evil-multiedit-ex-match)

;; Hotkeys for multiple edit
;; D: clear the region
;; C: clear to end-of-region and go into insert mode
;; A: go into insert mode at end-of-region
;; I: go into insert mode at start-of-region
;; V: select the region
;; $: go to end-of-region
;; 0/^: go to start-of-region
;; gg/G: go to the first/last region

Custom Keys

Eshell

(global-set-key (kbd "C-x t") 'eshell)

Lsp

(global-set-key (kbd "C-c e") 'lsp-find-definition)
(global-set-key (kbd "C-c r") 'lsp-find-references)
(global-set-key (kbd "C-c d") 'lsp-find-declaration)
(global-set-key (kbd "C-c t") 'lsp-find-implementation)
(global-set-key (kbd "C-c f") 'lsp-find-type-definition)

Diary

;; Diary configs
(setq appt-active 1)
(setq diary-number-of-entries 6)
(setq org-agenda-include-diary t)
(setq appt-message-warning-time 12)
(setq appt-display-interval 4)
(setq appt-audible 1)

Flyspell

(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'org-mode-hook  'flyspell-mode)

LSP