From 56119e39b25f77a91cd5bbcb8660ffee34178824 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 6 Jul 2023 20:10:27 +1000 Subject: minor changes --- emacs/.emacs.d/init/ycp-complete.el | 17 +++++++++++++---- emacs/.emacs.d/init/ycp-prog.el | 2 ++ emacs/.emacs.d/lisp/my/my-consult.el | 5 +++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/emacs/.emacs.d/init/ycp-complete.el b/emacs/.emacs.d/init/ycp-complete.el index d803d95..3f2a72c 100644 --- a/emacs/.emacs.d/init/ycp-complete.el +++ b/emacs/.emacs.d/init/ycp-complete.el @@ -165,10 +165,19 @@ (:delay 5) (add-hook 'message-mode-hook #'company-mode) (setq company-idle-delay .1 - company-minimum-prefix-length 2 + company-minimum-prefix-length 3 company-selection-wrap-around t company-show-numbers t - company-require-match 'never)) + company-require-match 'never) + (my-keybind company-active-map + "\t" #'company-complete-selection + "" #'company-complete-selection + "" nil + "" nil + "C-j" #'company-complete-selection + "C-s" #'company-select-next + "C-r" #'company-select-previous + )) ;;; cape (my-package cape @@ -215,8 +224,8 @@ "M-F" #'consult-focus-lines ; same principle "M-s M-b" #'consult-buffer "M-s M-f" #'consult-find - "M-s M-G" #'consult-grep - "M-s M-g" #'my-consult-grep-default + "M-s M-G" #'consult-git-grep + "M-s M-g" #'my-consult-git-grep-default "M-s M-h" #'consult-history "M-s M-i" #'consult-imenu "M-s M-l" #'consult-line diff --git a/emacs/.emacs.d/init/ycp-prog.el b/emacs/.emacs.d/init/ycp-prog.el index 3426665..3f4369d 100644 --- a/emacs/.emacs.d/init/ycp-prog.el +++ b/emacs/.emacs.d/init/ycp-prog.el @@ -475,6 +475,8 @@ "C-c d s" 'my-gdb-maria-spider ) (define-key gud-mode-map (kbd "C-c C-z") 'my-gdb-mysql-parse-frame) + (add-to-list 'grep-files-aliases + '("mtr" . "*.inc *.test *.cnf *.result *.rdiff")) ) ;;; bison diff --git a/emacs/.emacs.d/lisp/my/my-consult.el b/emacs/.emacs.d/lisp/my/my-consult.el index bf3e385..706dae5 100644 --- a/emacs/.emacs.d/lisp/my/my-consult.el +++ b/emacs/.emacs.d/lisp/my/my-consult.el @@ -31,5 +31,10 @@ (interactive) (consult-grep default-directory nil)) +(defun my-consult-git-grep-default () + "Like `consult-grep', but grepping the default directory." + (interactive) + (consult-git-grep default-directory nil)) + (provide 'my-consult) ;;; my-consult.el ends here -- cgit v1.2.3