ctrlf icon indicating copy to clipboard operation
ctrlf copied to clipboard

Perform multiple searches in parallel when multiple-cursors is active

Open jmorag opened this issue 4 years ago • 1 comments

Currently, I'm using phi-search for its integration with multiple-cursors. Is there an easy way to extend ctrlf to also support multiple cursors? For now, I've employed this hack:

(defmacro ctrlf-or-phi (key phi-version ctrlf-version)
  "Call ctrlf unless multiple cursors are active, in which case call phi"
  `(global-set-key (kbd ,key)
                   #'(lambda () (interactive)
                       (if multiple-cursors-mode
                           (,phi-version) (,ctrlf-version)))))
(ctrlf-or-phi "C-s" phi-search ctrlf-forward)
(ctrlf-or-phi "C-r" phi-search-backward ctrlf-backward)

jmorag avatar Mar 25 '20 20:03 jmorag

There's not an easy way; that sounds like quite a complex feature. If somebody were to make CTRLF extensible in a clean way so that the feature could be implemented, I would accept a pull request. However, I do not anticipate working on it anytime soon.

raxod502 avatar Mar 26 '20 16:03 raxod502