add org-roam stuff, add email
This commit is contained in:
parent
8c45a40b39
commit
b09b6ab15e
38
custom.el
38
custom.el
|
@ -131,14 +131,48 @@
|
|||
(sleep-for 1)
|
||||
(sly-connect "localhost" 4005))
|
||||
|
||||
(defmacro fez/save-buffer-excursion (&rest body)
|
||||
(declare (indent defun))
|
||||
(let ((original-buffer (gensym)))
|
||||
`(let ((,original-buffer (current-buffer)))
|
||||
,@body
|
||||
(switch-to-buffer ,original-buffer))))
|
||||
|
||||
(defun fez/goto-first-occurrence (str)
|
||||
(goto-char (point-min))
|
||||
(search-forward-regexp str)
|
||||
(beginning-of-thing 'symbol))
|
||||
|
||||
;; https://emacs.stackexchange.com/a/33709
|
||||
(defmacro with-keybinding (map key command &rest body)
|
||||
`(let* ((map ,map)
|
||||
(key ,key)
|
||||
(newcommand ,command)
|
||||
(prevbinding (lookup-key map key)))
|
||||
(unwind-protect
|
||||
(progn
|
||||
(define-key map key newcommand)
|
||||
,@body)
|
||||
(define-key map key prevbinding))))
|
||||
|
||||
(defun fez/org-roam-new-note ()
|
||||
"Creates a new org-roam note, and adds an entry to that note in my index.org file."
|
||||
(interactive)
|
||||
(let ((category (read-string "Category: ")))
|
||||
(find-file (concat org-roam-directory "/index.org"))
|
||||
(fez/goto-first-occurrence (concat "^\* " category))
|
||||
(end-of-line)
|
||||
(newline)
|
||||
(org-cycle)
|
||||
(with-keybinding selectrum-minibuffer-map (kbd "SPC") (lambda () (interactive (insert-char ?-)))
|
||||
(org-roam-insert))))
|
||||
|
||||
;; Eshell convinience commands.
|
||||
(defalias 'open 'find-file-other-window)
|
||||
(defalias 'clean 'eshell/clear-scrollback)
|
||||
|
||||
;;; Keybinds
|
||||
|
||||
|
||||
|
||||
;; C-x C-z and C-z are normally mapped to suspend-frame, an absolutely useless function.
|
||||
;; Unbind them before making the keybind useful.
|
||||
(global-unset-key (kbd "C-x C-z"))
|
||||
|
|
17
init.el
17
init.el
|
@ -45,6 +45,23 @@
|
|||
(?\" . ?\")))
|
||||
(electric-pair-mode t)
|
||||
|
||||
(setq-default rmail-display-summary t)
|
||||
|
||||
(setq
|
||||
send-mail-function 'smtpmail-send-it
|
||||
rmail-preserve-inbox 1
|
||||
rmail-delete-after-output 1
|
||||
rmail-mail-new-frame 1
|
||||
rmail-mime-prefer-html nil
|
||||
rmail-file-name "~/mail/inbox"
|
||||
rmail-primary-inbox-list '("~/mail/inboxes/disroot")
|
||||
rmail-default-file "~/mbox/archive"
|
||||
rmail-secondary-file-directory "~/mail"
|
||||
message-default-headers "Fcc: ~/mail/sent"
|
||||
user-full-name "opfez"
|
||||
user-mail-address "opfez@disroot.org"
|
||||
message-signature "")
|
||||
|
||||
;; C configuration
|
||||
(setq c-default-style "linux"
|
||||
c-basic-offset 4)
|
||||
|
|
10
packages.el
10
packages.el
|
@ -169,7 +169,8 @@
|
|||
:ensure t
|
||||
:bind
|
||||
("C-c o i" . org-roam-jump-to-index)
|
||||
:config
|
||||
("C-c o n" . fez/org-roam-new-note)
|
||||
:init
|
||||
(setq org-roam-directory "~/Documents/org-roam"))
|
||||
|
||||
;; better shell-command
|
||||
|
@ -178,6 +179,13 @@
|
|||
:config
|
||||
(global-set-key (kbd "M-!") 'shell-command+))
|
||||
|
||||
;; Jump to definitions without tags
|
||||
(use-package dumb-jump
|
||||
:ensure t
|
||||
:init
|
||||
(add-hook 'xref-backend-functions 'dumb-jump-xref-activate)
|
||||
(setq xref-show-definitions-function 'xref-show-definitions-completing-read))
|
||||
|
||||
;; Snippets
|
||||
(use-package yasnippet
|
||||
:ensure t
|
||||
|
|
Loading…
Reference in New Issue