aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp/my
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2023-08-14 18:04:29 +1000
committerYuchen Pei <id@ypei.org>2023-08-14 18:04:29 +1000
commitc8e22f94fc0fbbb4568b382e6e3ce593a99ad914 (patch)
tree900c089642ab803b30d9a748ea30767f813dd273 /emacs/.emacs.d/lisp/my
parent237190c09919bc437ebe9a6f54d42bce207ee5c5 (diff)
[emacs] Some minor tweaks
Diffstat (limited to 'emacs/.emacs.d/lisp/my')
-rw-r--r--emacs/.emacs.d/lisp/my/my-consult.el2
-rw-r--r--emacs/.emacs.d/lisp/my/my-editing.el1
-rw-r--r--emacs/.emacs.d/lisp/my/my-org.el11
-rw-r--r--emacs/.emacs.d/lisp/my/my-prog.el3
4 files changed, 15 insertions, 2 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-consult.el b/emacs/.emacs.d/lisp/my/my-consult.el
index aa71ac6..885cdfc 100644
--- a/emacs/.emacs.d/lisp/my/my-consult.el
+++ b/emacs/.emacs.d/lisp/my/my-consult.el
@@ -31,7 +31,7 @@
...depending whether we are in the git repo."
(interactive)
- (if (vc-git-root (buffer-file-name))
+ (if (vc-git-root (or (buffer-file-name) default-directory))
(consult-git-grep default-directory nil)
(consult-grep default-directory nil)))
diff --git a/emacs/.emacs.d/lisp/my/my-editing.el b/emacs/.emacs.d/lisp/my/my-editing.el
index 1604e32..0b953b3 100644
--- a/emacs/.emacs.d/lisp/my/my-editing.el
+++ b/emacs/.emacs.d/lisp/my/my-editing.el
@@ -403,6 +403,7 @@ With an prefix-arg, copy the file name relative to project root."
(setq-local electric-pair-preserve-balance nil)
(turn-on-auto-fill)
(visual-line-mode)
+ (flyspell-mode)
)
(defun my-find-file-line-number (orig filename &rest args)
diff --git a/emacs/.emacs.d/lisp/my/my-org.el b/emacs/.emacs.d/lisp/my/my-org.el
index 0fb7d9e..63db9fa 100644
--- a/emacs/.emacs.d/lisp/my/my-org.el
+++ b/emacs/.emacs.d/lisp/my/my-org.el
@@ -113,6 +113,17 @@ With a prefix, insert inactive dates.
(my-kill-forward)
(org-kill-line)))
+(defun my-org-kill-line-backwards (&optional arg)
+ "Kill backwards in an org way, or `my-kill-backward' with a prefix arg."
+ (interactive "P")
+ (if arg
+ (my-kill-backward)
+ (if (bolp)
+ (delete-char -1)
+ (kill-region
+ (save-excursion (my-org-beginning-of-line-or-indent) (point))
+ (point)))))
+
(defun my-org-open-default-notes-file ()
(interactive)
(find-file org-default-notes-file))
diff --git a/emacs/.emacs.d/lisp/my/my-prog.el b/emacs/.emacs.d/lisp/my/my-prog.el
index 6309f70..2bb4745 100644
--- a/emacs/.emacs.d/lisp/my/my-prog.el
+++ b/emacs/.emacs.d/lisp/my/my-prog.el
@@ -392,7 +392,8 @@ left and the source buffer on the right.
(auto-fill-mode)
(display-line-numbers-mode)
(setq tab-width 2)
- (bug-reference-prog-mode))
+ (bug-reference-prog-mode)
+ (flyspell-prog-mode))
(provide 'my-prog)
;;; my-prog.el ends here