update doom config
This commit is contained in:
parent
eb64f1966f
commit
4eafbae825
10 changed files with 114 additions and 205 deletions
|
@ -1,169 +1,44 @@
|
|||
;;; ~/.doom.d/config.el -*- lexical-binding: t; -*-
|
||||
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(load-theme 'doom-solarized-dark-high-contrast t)
|
||||
(setq doom-solarized-dark-high-contrast-brighter-comments t)
|
||||
;; Place your private configuration here! Remember, you do not need to run 'doom
|
||||
;; sync' after modifying this file!
|
||||
|
||||
;; Set to 2 spaces
|
||||
(setq default-tab-width 2)
|
||||
(setq tab-width 2)
|
||||
(setq web-mode-markup-indent-offset 2)
|
||||
(setq web-mode-css-indent-offset 2)
|
||||
(setq web-mode-code-indent-offset 2)
|
||||
(setq js2-mode-hook
|
||||
'(lambda () (progn
|
||||
(set-variable 'js2-basic-offset 2))))
|
||||
(setq css-mode-hook
|
||||
'(lambda () (progn
|
||||
(set-variable 'css-indent-offset 2))))
|
||||
(setq typescript-mode-hook
|
||||
'(lambda () (progn
|
||||
(set-variable 'typescript-indent-level 2))))
|
||||
|
||||
;; Maximize the window upon startup
|
||||
;; Some functionality uses this to identify you, e.g. GPG configuration, email
|
||||
;; clients, file templates and snippets. It is optional.
|
||||
(setq user-full-name "mokou"
|
||||
user-mail-address "mokou@fastmail.com")
|
||||
|
||||
;; Maximize the window after startup
|
||||
(add-to-list 'default-frame-alist '(fullscreen . maximized))
|
||||
|
||||
(setq doom-font (font-spec :family "Fantasque Sans Mono" :size 17))
|
||||
(setq doom-font (font-spec :family "JetBrains Mono" :size 14))
|
||||
|
||||
(when (memq window-system '(mac ns x))
|
||||
(exec-path-from-shell-initialize))
|
||||
;; 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 'tango)
|
||||
|
||||
;; Configure some lsp-mode stuff
|
||||
(after! lsp-mode
|
||||
(setq lsp-ui-sideline-show-code-actions nil))
|
||||
;; 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)
|
||||
|
||||
;; Enable prettier in RJSX-mode
|
||||
(add-hook 'rjsx-mode-hook 'prettier-js-mode)
|
||||
(add-hook 'typescript-mode-hook 'prettier-js-mode)
|
||||
(add-hook 'typescript-tsx-mode-hook 'prettier-js-mode)
|
||||
;; 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 "~/Org/")
|
||||
|
||||
;; Add prolog support for .dl files
|
||||
(add-to-list 'auto-mode-alist '("\\.dl\\'" . prolog-mode))
|
||||
;; Set default tab width to 2
|
||||
(setq tab-width 2)
|
||||
|
||||
;; Enable Mercurial support for git-gutter
|
||||
(setq git-gutter:handled-backends '(git hg))
|
||||
;; Set a custom splash screen
|
||||
(setq fancy-splash-image "~/.local/share/chezmoi/misc/emacs-splash.png")
|
||||
|
||||
;; Load auth keys from .authinfo
|
||||
(setq auth-sources '("~/.authinfo"))
|
||||
|
||||
;; Enable editorconfig
|
||||
(editorconfig-mode 1)
|
||||
|
||||
;; mu4e config
|
||||
(set-email-account! "posteo"
|
||||
'((mu4e-sent-folder . "/Sent")
|
||||
(mu4e-drafts-folder . "/Drafts")
|
||||
(mu4e-trash-folder . "/Trash")
|
||||
(mu4e-refile-folder . "/INBOX")
|
||||
(smtpmail-smtp-user . "mokou@posteo.net")
|
||||
(user-mail-address . "mokou@posteo.de"))
|
||||
;; Configure email account
|
||||
(set-email-account! "fastmail.com"
|
||||
'((mu4e-sent-folder . "/fastmail/Sent")
|
||||
(mu4e-drafts-folder . "/fastmail/Drafts")
|
||||
(mu4e-trash-folder . "/fastmail/Trash")
|
||||
(mu4e-refile-folder . "/fastmail/Archive")
|
||||
(smtpmail-smtp-user . "mokou@fastmail.com")
|
||||
(user-mail-address . "mokou@fastmail.com"))
|
||||
t)
|
||||
(map! :map global-map :leader "M" 'mu4e)
|
||||
;; use https://github.com/grobian/html2text
|
||||
(setq mu4e-html2text-command "html2text")
|
||||
|
||||
(setq rustic-lsp-server 'rls)
|
||||
|
||||
;; Org configuration
|
||||
(after! org
|
||||
(add-to-list 'org-modules 'org-habit)
|
||||
(setq-default org-directory "~/code/personal/org")
|
||||
(setq-default org-default-notes-file "~/code/personal/org/inbox.org")
|
||||
(setq-default org-todo-keywords
|
||||
(quote ((sequence "TODO(t)" "DONE(d)" "WAITING(w@/!)"))))
|
||||
(setq-default org-todo-keyword-faces
|
||||
(quote (("TODO" :foreground "tomato" :weight bold)
|
||||
("DONE" :foreground "forest green" :weight bold)
|
||||
("WAITING" :foreground "chocolate" :weight bold))))
|
||||
(setq org-capture-templates
|
||||
(quote (("t" "todo" entry (file "~/code/personal/org/inbox.org")
|
||||
"* TODO %?\n%U\n" :clock-in t :clock-resume t)
|
||||
("n" "note" entry (file "~/code/personal/org/inbox.org")
|
||||
"* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t))))
|
||||
(setq org-refile-targets '((nil :maxlevel . 9)
|
||||
(org-agenda-files :maxlevel . 9)))
|
||||
(org-clock-persistence-insinuate)
|
||||
(setq org-clock-in-switch-to-state 'cf/clock-in-to-next)
|
||||
(setq org-clock-into-drawer t)
|
||||
(setq org-clock-out-remove-zero-time-clocks t)
|
||||
(setq org-clock-out-when-done t)
|
||||
(setq org-clock-persist t)
|
||||
(setq org-clock-auto-clock-resolution (quote when-no-clock-is-running))
|
||||
(setq org-clock-report-include-clocking-task t)
|
||||
(setq org-agenda-dim-blocked-tasks nil)
|
||||
(setq org-agenda-compact-blocks t)
|
||||
(setq org-archive-location "~/code/personal/org/_archive.org::")
|
||||
(setq org-agenda-custom-commands
|
||||
(quote ((" " "Agenda"
|
||||
((agenda "" nil)
|
||||
(tags "REFILE"
|
||||
((org-agenda-overriding-header "Tasks to Refile")
|
||||
(org-tags-match-list-sublevels nil)))
|
||||
(tags-todo "-CANCELLED+WAITING|HOLD/!"
|
||||
((org-agenda-overriding-header (concat "Waiting Tasks"))
|
||||
(org-agenda-skip-function 'cf/skip-non-tasks)
|
||||
(org-tags-match-list-sublevels nil)
|
||||
(org-agenda-todo-ignore-scheduled cf/hide-scheduled-and-waiting-next-tasks)
|
||||
(org-agenda-todo-ignore-deadlines cf/hide-scheduled-and-waiting-next-tasks))))
|
||||
nil)))))
|
||||
|
||||
(map! :map global-map :leader "a" 'org-agenda)
|
||||
(map! :map org-mode-map :leader "m c p" 'org-pomodoro)
|
||||
|
||||
(defvar cf/hide-scheduled-and-waiting-next-tasks t)
|
||||
|
||||
(defun cf/clock-in-to-next (kw)
|
||||
(when (not (and (boundp 'org-capture-mode) org-capture-mode))
|
||||
(cond
|
||||
((and (member (org-get-todo-state) (list "WAITING"))
|
||||
(cf/is-task-p))
|
||||
"TODO"))))
|
||||
|
||||
(defun cf/find-project-task ()
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let ((parent-task (save-excursion (org-back-to-heading 'invisible-ok) (point))))
|
||||
(while (org-up-heading-safe)
|
||||
(when (member (nth 2 (org-heading-components)) org-todo-keywords-1)
|
||||
(setq parent-task (point))))
|
||||
(goto-char parent-task)
|
||||
parent-task)))
|
||||
|
||||
(defun cf/is-project-p ()
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let ((has-subtask)
|
||||
(subtree-end (save-excursion (org-end-of-subtree t)))
|
||||
(is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1)))
|
||||
(save-excursion
|
||||
(forward-line 1)
|
||||
(while (and (not has-subtask)
|
||||
(< (point) subtree-end)
|
||||
(re-search-forward "^\*+ " subtree-end t))
|
||||
(when (member (org-get-todo-state) org-todo-keywords-1)
|
||||
(setq has-subtask t))))
|
||||
(and is-a-task has-subtask))))
|
||||
|
||||
(defun cf/is-task-p ()
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let ((has-subtask)
|
||||
(subtree-end (save-excursion (org-end-of-subtree t)))
|
||||
(is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1)))
|
||||
(save-excursion
|
||||
(forward-line 1)
|
||||
(while (and (not has-subtask)
|
||||
(< (point) subtree-end)
|
||||
(re-search-forward "^\*+ " subtree-end t))
|
||||
(when (member (org-get-todo-state) org-todo-keywords-1)
|
||||
(setq has-subtask t))))
|
||||
(and is-a-task (not has-subtask)))))
|
||||
|
||||
(defun cf/skip-non-tasks ()
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let ((next-headline (save-excursion (or (outline-next-heading) (point-max)))))
|
||||
(cond
|
||||
((cf/is-task-p)
|
||||
nil)
|
||||
(t
|
||||
next-headline)))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue