Commit 6cd7ded7 authored by Tim van Deurzen's avatar Tim van Deurzen

Add initial custom emacs configuration.

parent 96632aab
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
target = "~/.config/nvim/" target = "~/.config/nvim/"
type = "symbolic" type = "symbolic"
[emacs.files.emacs]
target = "~/.config/emacs/"
type = "symbolic"
[dunst.files.dunst] [dunst.files.dunst]
target = "~/.config/dunst/" target = "~/.config/dunst/"
type = "symbolic" type = "symbolic"
......
(setq user-emacs-directory "~/.dotfiles/emacs/")
(customize-set-value 'custom-theme-directory user-emacs-directory)
(setq warning-levels
:error)
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(use-package no-littering
:straight t)
(setq auto-save-file-name-transforms
`((".*" ,(no-littering-expand-var-file-name "auto-save/") t)))
(use-package which-key
:straight t
:init (which-key-mode)
:diminish which-key-mode
:config
(setq which-key-idle-delay 0.1))
(use-package doom-themes
:straight t :init (load-theme 'doom-one t))
(use-package gruvbox-theme
:straight t)
;; UI
(setq inhibit-startup-message t)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(tooltip-mode -1)
(menu-bar-mode -1)
(column-number-mode)
(dolist (mode '(term-mode-hook
shell-mode-hook
treemacs-mode-hook
eshell-mode-hook
org-agenda-mode))
(add-hook mode (lambda () (nlinum-mode 0))))
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(set-face-attribute 'default nil :font "consolas" :height 115)
;; Set the fixed pitch face
(set-face-attribute 'fixed-pitch nil :font "consolas" :height 115)
(use-package general
:straight t
:init
(general-evil-setup)
:config
(general-create-definer tvd/leader-key
:keymaps 'override
:states '(normal visual)
:prefix "SPC")
(general-create-definer tvd/local-leader-key
:keymaps 'override
:states '(normal visual)
:prefix "SPC m")
(tvd/leader-key
"f" '(:ignore t :which-key "file prefix")
"ff" '(counsel-find-file :which-key "find file")
"b" '(:ignore t :which-key "buffer prefix")
"bb" '(counsel-switch-buffer :which-key "switch buffer")
;; "zm" '(zen-mode :which-key "zen mode")
"/" '(swiper :which-key "search")))
(use-package evil
:straight t
:init
(setq evil-want-integration t
evil-want-keybinding nil
evil-want-C-u-scroll t
evil-want-C-i-jump nil
evil-undo-system 'undo-redo)
:config
(evil-mode 1)
(define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
(define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join)
(evil-global-set-key 'motion "j" 'evil-next-visual-line)
(evil-global-set-key 'motion "k" 'evil-previous-visual-line)
(evil-set-initial-state 'messages-buffer-mode 'normal))
(use-package evil-collection
:straight t
:after evil
:config
(evil-collection-init))
(use-package evil-colemak-basics
:straight t
:config
(global-evil-colemak-basics-mode))
(use-package all-the-icons
:straight t)
(use-package doom-modeline
:straight t
:init (doom-modeline-mode 1)
:custom ((doom-modeline-height 15)))
(use-package ivy
:straight t
:diminish
;; :bind
;; (("C-s" . swiper)
;; :map ivy-minibuffer-map
;; ("TAB" . ivy-alt-done)
;; ("C-l" . ivy-alt-done)
;; ("C-j" . ivy-next-line)
;; ("C-k" . ivy-previous-line)
;; :map ivy-switch-buffer-map
;; ("C-k" . ivy-previous-line)
;; ("C-l" . ivy-done)
;; ("C-d" . ivy-switch-buffer-kill)
;; :map ivy-reverse-i-search-map
;; ("C-k" . ivy-previous-line)
;; ("C-d" . ivy-reverse-i-search-kill))
:config
(ivy-mode 1))
(use-package counsel
:straight t
:bind
(("C-M-j" . 'counsel-switch-buffer)
:map minibuffer-local-map
("C-r" . 'counsel-minibuffer-history))
:config
(counsel-mode 1)
:custom
(counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only))
(use-package ivy-rich
:straight t
:init
(ivy-rich-mode 1))
(use-package ivy-prescient
:straight t
:after counsel
:config
(ivy-prescient-mode 1)
:custom
(ivy-prescient-enable-filtering nil))
(use-package helpful
:straight t
:custom
(counsel-describe-function-function #'helpful-callable)
(counsel-describe-variable-function #'helpful-variable)
:bind
([remap describe-function] . counsel-describe-function)
([remap describe-command] . helpful-command)
([remap describe-variable] . counsel-describe-variable)
([remap describe-key] . helpful-key))
(use-package projectile
:straight t
:diminish projectile-mode
:config (projectile-mode)
:custom ((projectile-completion-system 'ivy))
;; :bind-keymap
;; ()
:init
(when (file-directory-p "~/src")
(setq projectile-project-search-path '("~/src")))
(setq projectile-switch-project-action #'projectile-dired))
(use-package counsel-projectile
:straight t
:config (counsel-projectile-mode))
(use-package magit
:straight t
:custom
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
(use-package evil-nerd-commenter
:straight t
:bind ("M-/" . evilnc-comment-or-uncomment-lines))
(use-package rainbow-delimiters
:straight t
:hook (prog-mode . rainbow-delimiters-mode))
(use-package zen-mode
:straight (zen-mode :type git :host github :repo "aki237/zen-mode"))
(use-package lsp-mode
:straight t
:commands (lsp lsp-deferred)
;;:hook (lsp-mode . efs/lsp-mode-setup)
:init
(setq lsp-keymap-prefix "SPC m") ;; Or 'C-l', 's-l'
:config
(lsp-enable-which-key-integration t))
(use-package lsp-ui
:straight t
:hook (lsp-mode . lsp-ui-mode)
:custom
(lsp-ui-doc-position 'bottom))
(use-package lsp-ivy
:straight t)
(use-package company
:straight t
:after prog-mode
:hook (prog-mode . company-mode)
:bind
(:map lsp-mode-map
("<tab>" . company-indent-or-complete-common))
:custom
(company-minimum-prefix-length 1)
(company-idle-delay 0.0))
(use-package company-box
:straight t
:hook (company-mode . company-box-mode))
(defun tvd/org-mode-setup ()
(org-indent-mode)
(visual-line-mode 1))
(use-package org
:straight t
;; :pin org
:hook (org-mode . tvd/org-mode-setup)
:custom
(org-agenda-files '(
"~/org/planning/2021-week-02.org"
"~/org/planning/2021-week-01.org"
"~/org/planning/2020-week-53.org"
"~/org/planning/2020-week-52.org"
"~/org/planning/2020-week-51.org"
"~/org/planning/2020-week-50.org"
"~/org/planning/2020-week-49.org"
"~/org/planning/2020-week-48.org"
"~/house/vve/bestuur/org/main.org"
"~/org/personal.org"
"~/work/eolas/org/main.org"
"~/finances/org/main.org"
"~/work/copperspice/org/main.org"
"~/work/bux/org/main.org"
"~/org/main.org"
"~/org/agendas/google.org"))
:config
(setq org-ellipsis " ▾")
(setq org-agenda-start-with-log-mode t)
(setq org-log-done 'time)
(setq org-log-into-drawer t)
(setq org-todo-keywords
'((sequence "TODO(t)" "NEXT(n!)" "|" "DONE(d!)")
(sequence "WAITING(w@/!)" "MAYBE(m)" "SOMEDAY(s)" "|" "CANCELED(c@)")))
(setq org-clock-rounding-minutes 5)
(setq org-clock-persist t)
(setq org-hide-emphasis-markers t)
(setq org-clock-in-resume t)
(setq org-clock-persist-query-resume nil)
(setq org-clock-into-drawer t)
(setq org-clock-out-remove-zero-time-clocks t)
(setq org-clock-report-include-clocking-task t)
(setq org-log-into-drawer t)
(setq org-enforce-todo-dependencies t)
(setq org-enforce-todo-checkbox-dependencies t)
(setq alert-default-style 'libnotify)
(setq org-refile-use-outline-path 'full-file-path)
(setq org-outline-path-complete-in-steps nil)
(setq org-refile-allow-creating-parent-nodes 'confirm)
(setq org-habit-show-habits t)
(setq org-habit-following-days 7)
(setq org-habit-preceding-days 21)
(setq org-habit-show-habits-only-for-today t)
(setq org-startup-folded 'fold)
(setq org-agenda-skip-deadline-if-done t
org-agenda-skip-scheduled-if-done t)
(setq org-capture-templates
`(
("d" "Day planning" entry
(file+headline (lambda() (format-time-string "~/org/planning/%Y-week-%V.org")) "Day planning")
(file "~/org/templates/day-planning.org"))
("w" "Week planning" entry
(file (lambda() (format-time-string "~/org/planning/%Y-week-%V.org")))
(file "~/org/templates/week-planning.org"))
("t" "Task" entry
(file+headline "~/org/inbox.org" "Tasks")
"* TODO %? %^G"
)
))
(setq org-refile-targets
'((nil :maxlevel . 3)
(org-agenda-files :maxlevel . 3)))
;(setq org-clocktable-defaults '(:step day))
(setq org-pretty-entities t)
(setq org-time-clocksum-format (quote (:hours "%d" :require-hours t :minutes ":%02d" :require-minutes t)))
(setq org-duration-format (quote h:mm))
(setq org-roam-directory "~/org/roam/")
(setq deft-directory "~/org/roam")
(setq deft-extensions '("org"))
(setq org-noter-default-notes-file-names '("notes.org"))
(setq org-noter-notes-search-path '("~/org/roam/noter/" "~/org/roam"))
(setq org-roam-server-host "127.0.0.1"
org-roam-server-port 9090
org-roam-server-authenticate nil
org-roam-server-export-inline-images t
org-roam-server-serve-files nil
org-roam-server-served-file-extensions '("pdf")
org-roam-server-network-poll t
org-roam-server-network-arrows nil
org-roam-server-network-label-truncate t
org-roam-server-network-label-truncate-length 60
org-roam-server-network-label-wrap-length 20)
;; (setq-default auto-fill-function 'do-auto-fill)
(setq org-gcal-client-id "363943479757-e67275ue1tshm2ihnq4pbbp71i17u560.apps.googleusercontent.com"
org-gcal-client-secret "6AQ7_vtvqLTeL-ltDcwrIvao"
org-gcal-file-alist '(("tim.vandeurzen@gmail.com" . "~/org/agendas/google.org")))
(setq org-agenda-format-date (lambda (date) (concat "\n"
(make-string (window-width) 9472)
"\n"
(org-agenda-format-date-aligned date))))
)
(use-package org-super-agenda
:straight t
:config
(setq org-agenda-custom-commands
'(("z" "Custom Day"
((agenda "" ((org-agenda-span 'day)
(org-super-agenda-groups
'((:log t)
(:name "Schedule"
:time-grid t)
(:habit t)
(:name "Scheduled future"
:scheduled future)
(:name "Scheduled past"
:scheduled past)
(:name "Due today"
:deadline today)
(:name "Overdue"
:deadline past)
(:name "Due soon"
:deadline future)
(:name "Waiting"
:todo "WAITING"
:order 10)
))))))
("w" "Custom Week"
((agenda "" ((org-agenda-span 'week)
(org-super-agenda-groups
'((:log t)
(:name "Schedule"
:time-grid t)
(:name "Planning"
:scheduled t)
(:name "Due"
:deadline t)
(:name "Overdue"
:deadline past)
))))))
))
(org-super-agenda-mode))
(use-package org-bullets
:straight t
:after org
:hook (org-mode . org-bullets-mode))
(defun tvd/org-mode-visual-fill ()
(setq visual-fill-column-width 100
visual-fill-column-center-text t))
(use-package visual-fill-column
:straight t
:hook (org-mode . tvd/org-mode-visual-fill))
(defun tvd/nlinum-constant-width ()
(when global-nlinum-mode
(setq-local nlinum-format
(concat " %" (number-to-string
;; Guesstimate number of buffer lines.
(ceiling (log (max 1 (/ (buffer-size) 80)) 10)))
"d \u2502"))))
(use-package nlinum
:straight t
:hook (nlinum-mode-hook . tvd/nlinum-constant-width)
:init (global-nlinum-mode))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment