aboutsummaryrefslogtreecommitdiffstats
path: root/oni-php
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-03-26 14:27:15 -0700
committerGravatar Tom Willemse2026-03-26 14:28:23 -0700
commit417662edb8ccb7d546e74aa24a6facd9d7d85658 (patch)
tree14bec54ea258c43b4cbad5f3fa333d1ef8785686 /oni-php
parentda080d6940bb993f3e6fc9a4ea347de88b4de541 (diff)
downloademacs-config-417662edb8ccb7d546e74aa24a6facd9d7d85658.tar.gz
emacs-config-417662edb8ccb7d546e74aa24a6facd9d7d85658.zip
oni-php: Add command to search for symbol at point, add keybindings
Diffstat (limited to 'oni-php')
-rw-r--r--oni-php/oni-php.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el
index e5b50e4..d93e40f 100644
--- a/oni-php/oni-php.el
+++ b/oni-php/oni-php.el
@@ -250,6 +250,16 @@ Do the insert N times."
(defun oni-php-in-static-call-context-p ()
(looking-back "::\\w+" (- (point) (line-beginning-position))))
+(defun oni-php-grep-symbol (symbol)
+ (interactive (list (thing-at-point 'symbol)))
+ (rgrep (rx (literal symbol))
+ (map-elt grep-files-aliases "php")
+ (project-root (project-current))))
+
+(define-key php-ts-mode-map (kbd "C-c .") nil t)
+(define-key php-ts-mode-map (kbd "C-c . g") '("Search for symbol at point" . oni-php-grep-symbol))
+(define-key php-ts-mode-map (kbd "C-c . a") '("Import symbol at point" . oni-php-add-use))
+
;;;###autoload
(when (and (functionp 'treesit-available-p)
(treesit-available-p)