From 1f79ce374f344b5dde13d076839a406feca99251 Mon Sep 17 00:00:00 2001 From: Willem van den Ende Date: Mon, 6 Feb 2023 10:55:50 +0000 Subject: [PATCH] Fix end of line behaviour --- config.el | 28 +++++++++++++++---- custom.el | 6 ++++ .../jekyll call to action - training | 5 ++-- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/config.el b/config.el index 52c5343..a4c60ed 100644 --- a/config.el +++ b/config.el @@ -205,11 +205,9 @@ (magit) (remove-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)) - ;; from hlissner https://github.com/hlissner/.doom.d/blob/2529bcd46c5aad0cbe796793e5c08e1faf5ba272/config.el#L59-L65 ;; disable auto-complete -(after! company - (setq company-idle-delay nil)) +(after! company (setq company-idle-delay nil)) ;; HACK show small snippets for backlinks preview in roam-buffer ;; there is currently a problem in org-mode that shows an error ;; org-element--cache: Unregistered buffer modifications detected. Resetting. but this also happens without this function, it appears to be an interaction between org-roam and changes in orgmode. @@ -222,8 +220,13 @@ (org-element-property :begin parent) (org-element-property :end parent))))) (setq org-roam-preview-function #'qwan/brief-preview) +;; evil mode settings for frictionless editing ;; cursor moved back to ?beginning of line? too often +;; https://evil.readthedocs.io/en/latest/settings.html under 'cursor movement' +;; Not setting these two leads to missing space when adding links with org-roam. +;; white-space at EOL is removed automatically by something else so does not bother us here. (setq evil-move-cursor-back nil) +(setq evil-move-cursor-beyond-eol t) ;; to enable multiple org-roam dirs ;; https://github.com/org-roam/org-roam/issues/1527 (setq-default enable-local-variables t) @@ -302,6 +305,16 @@ the description. This may destroy existing links, or change their targets so use (qwan/relative-path-to-attachments buffer-file-name)))) (kill-new markdown-link) (message "Copied %s" markdown-link))) + +(defun qwan/copy-filename () + "Push the file name of the currently visited buffer to the kill ring." + (interactive) + (unless buffer-file-name + (error "The current buffer doesn't visit a file")) + + (kill-new buffer-file-name) + (message "Copied %s" buffer-file-name)) + (defun qwan/relative-path-to-attachments (full-path) (substring full-path (string-search "/attachments" full-path 0))) (require 'ert) @@ -390,6 +403,9 @@ the description. This may destroy existing links, or change their targets so use (require 'my-org-roam) ;; org-roam v1 port to v2, insert node without opening buffer - (map! :leader - :desc "Insert node immediate, don't open buffer on new node" - "n r I" #'org-roam-node-insert-immediate) +(map! + :leader + :desc + "Insert node immediate, don't open buffer on new node" + "n r I" + #'org-roam-node-insert-immediate) diff --git a/custom.el b/custom.el index 8d0e18a..0fbb26c 100644 --- a/custom.el +++ b/custom.el @@ -14,6 +14,12 @@ . 0) (("#2b3d48" "#46D9FF" "brightcyan") . 20))) + '(ignored-local-variable-values + '((eval setq-local org-roam-db-location + (expand-file-name "org-roam.db" org-roam-directory)) + (eval setq-local org-roam-directory + (expand-file-name + (locate-dominating-file default-directory ".dir-locals.el"))))) '(jdee-db-active-breakpoint-face-colors (cons "#1B2229" "#51afef")) '(jdee-db-requested-breakpoint-face-colors (cons "#1B2229" "#98be65")) '(jdee-db-spec-breakpoint-face-colors (cons "#1B2229" "#3f444a")) diff --git a/snippets/markdown-mode/jekyll call to action - training b/snippets/markdown-mode/jekyll call to action - training index eed766f..0cfd320 100644 --- a/snippets/markdown-mode/jekyll call to action - training +++ b/snippets/markdown-mode/jekyll call to action - training @@ -5,7 +5,8 @@