143 lines
3.2 KiB
Org Mode
143 lines
3.2 KiB
Org Mode
* Table of Contents :TOC:
|
|
- [[#misc][Misc]]
|
|
- [[#appearance][Appearance]]
|
|
- [[#font][Font]]
|
|
- [[#theme][Theme]]
|
|
- [[#line-numbers][Line numbers]]
|
|
- [[#programming][Programming]]
|
|
- [[#lsp][LSP]]
|
|
- [[#rust][Rust]]
|
|
- [[#cc][C/C++]]
|
|
- [[#org-mode][Org mode]]
|
|
- [[#agenda-setup][Agenda setup]]
|
|
- [[#journal][Journal]]
|
|
- [[#doom-specific][Doom specific]]
|
|
|
|
* Misc
|
|
|
|
Enable lexical binding, of course...
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
;;; -*- lexical-binding: t; -*-
|
|
#+END_SRC
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(setq enable-dir-local-variables nil)
|
|
#+END_SRC
|
|
|
|
* 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:
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(setq doom-font (font-spec :family "Fira Mono Medium" :size 12))
|
|
#+END_SRC
|
|
|
|
** Theme
|
|
|
|
A list of all doom themes can be found here:
|
|
|
|
https://github.com/hlissner/emacs-doom-themes
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(setq doom-theme 'doom-one)
|
|
#+END_SRC
|
|
|
|
** Line numbers
|
|
|
|
Possible values of =display-line-numbers-type= are =nil=, =t=, and ='relative=.
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(setq display-line-numbers-type 'relative)
|
|
#+END_SRC
|
|
|
|
* Programming
|
|
|
|
** LSP
|
|
|
|
Doom disables documentation display in child frames by default; I like those, so
|
|
re-enable them, and reset [[https://github.com/emacs-lsp/lsp-ui/blob/242dfe859c3497c456eaacfd84942e12419529fe/lsp-ui-doc.el#L84][the defaults]].
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(after! lsp-ui
|
|
(setq lsp-ui-doc-max-width 150)
|
|
(setq lsp-ui-doc-max-height 30)
|
|
(setq lsp-ui-doc-enable t))
|
|
#+END_SRC
|
|
|
|
** Rust
|
|
|
|
By default =rustic-mode= uses =rls=, I want to use =rust-analyzer= instead.
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(setq rustic-lsp-server 'rust-analyzer)
|
|
#+END_SRC
|
|
|
|
I don't want to enable format-on-save globally in Doom, but having it in rust is
|
|
nice.
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(after! rustic
|
|
(setq rustic-format-trigger 'on-save))
|
|
#+END_SRC
|
|
|
|
** C/C++
|
|
|
|
Setup the default format for C/C++ editing.
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(setq c-default-style "gnu")
|
|
(setq c-basic-offset 2)
|
|
#+END_SRC
|
|
|
|
Flycheck never works well for C / C++ without configuration or a CMake build
|
|
system. Let's disable it.
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(after! flycheck
|
|
(setq flycheck-global-modes '(not c-mode c++-mode)))
|
|
#+END_SRC
|
|
|
|
* Org mode
|
|
|
|
** Agenda setup
|
|
|
|
I want the default agenda view to be a daily view, with a log of what I've done
|
|
during the day.
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(after! org
|
|
(setq org-agenda-span 'day)
|
|
(setq org-agenda-start-with-log-mode t))
|
|
#+END_SRC
|
|
|
|
** Journal
|
|
|
|
For [[https://github.com/bastibe/org-journal][org-journal]] I want weekly entries (the default is ='daily=).
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(after! org-journal
|
|
(setq org-journal-file-type 'weekly))
|
|
#+END_SRC
|
|
|
|
** Doom specific
|
|
|
|
Doom replaces the default tab behavior on headings, this restores the default
|
|
one. Taken from [[https://github.com/hlissner/doom-emacs/tree/develop/modules/lang/org#hacks][here]].
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(after! evil-org
|
|
(remove-hook 'org-tab-first-hook #'+org-cycle-only-current-subtree-h))
|
|
#+END_SRC
|