diff options
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/init/ycp-complete.el | 4 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-consult.el | 18 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-wikipedia.el | 1 |
3 files changed, 15 insertions, 8 deletions
diff --git a/emacs/.emacs.d/init/ycp-complete.el b/emacs/.emacs.d/init/ycp-complete.el index 3f2a72c..29bdaf7 100644 --- a/emacs/.emacs.d/init/ycp-complete.el +++ b/emacs/.emacs.d/init/ycp-complete.el @@ -224,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-git-grep - "M-s M-g" #'my-consult-git-grep-default + "M-s M-G" #'my-consult-grep + "M-s M-g" #'my-consult-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/lisp/my/my-consult.el b/emacs/.emacs.d/lisp/my/my-consult.el index 706dae5..aa71ac6 100644 --- a/emacs/.emacs.d/lisp/my/my-consult.el +++ b/emacs/.emacs.d/lisp/my/my-consult.el @@ -27,14 +27,22 @@ ;;; Code: (defun my-consult-grep-default () - "Like `consult-grep', but grepping the default directory." + "Call `consult-git-grep' or `consult-grep' on default directory. + +...depending whether we are in the git repo." (interactive) - (consult-grep default-directory nil)) + (if (vc-git-root (buffer-file-name)) + (consult-git-grep default-directory nil) + (consult-grep default-directory nil))) + +(defun my-consult-grep () + "Call `consult-git-grep' or `consult-grep'. -(defun my-consult-git-grep-default () - "Like `consult-grep', but grepping the default directory." +...depending whether we are in the git repo." (interactive) - (consult-git-grep default-directory nil)) + (if (vc-git-root (buffer-file-name)) + (consult-git-grep) + (consult-grep))) (provide 'my-consult) ;;; my-consult.el ends here diff --git a/emacs/.emacs.d/lisp/my/my-wikipedia.el b/emacs/.emacs.d/lisp/my/my-wikipedia.el index af954bf..45d00e2 100644 --- a/emacs/.emacs.d/lisp/my/my-wikipedia.el +++ b/emacs/.emacs.d/lisp/my/my-wikipedia.el @@ -30,7 +30,6 @@ (require 'my-utils) (require 'my-markup) (require 'my-net) -(require 'my-mediawiki) (require 'wiki) ;; TODO: much of these can be generalised to any mediawiki site |