wolray / symbol-overlay

Highlight symbols with keymap-enabled overlays
346 stars 42 forks source link

Transient for symbol-overlay #59

Closed hmelman closed 4 years ago

hmelman commented 4 years ago

For what it's worth, I've been very happily using this transient for symbol-overlay for a while. It could be bound to any key but I have a super- key configured and am binding this to s-. which I find nicely parallels M-..

(define-transient-command symbol-overlay-transient ()
  "Symbol Overlay transient"
  ["Symbol Overlay"
   ["Overlays"
    ("." "Add/Remove at point" symbol-overlay-put)
    ("k" "Remove All" symbol-overlay-remove-all)
    ]
   ["Move to Symbol"
    ("n" "Next" symbol-overlay-switch-forward)
    ("p" "Previous" symbol-overlay-switch-backward)
    ]
   ["Other"
    ("m" "Highlight symbol-at-point" symbol-overlay-mode)
    ]
   ]
  )
(global-set-key (kbd "s-.") 'symbol-overlay-transient)
purcell commented 4 years ago

Great - thanks for sharing! It's out of scope to add a depenency on transient to the library itself, but I'm sure others will stumble across this and find it helpful! I might link to this snippet from the README...

Cons-Cat commented 3 years ago

With Transient now added in the master branch of Emacs 28, is it possible this might be revisited in the future?

hmelman commented 3 months ago

Yeah -command became -prefix. I'm still using the transient I had. I find the commands on the symbol-overlay-map overlay are way more convenient wouldn't want to lose them. I just use the transient to add/remove overlays and to navigate to an overlay when I'm not on one. Otherwise the overlay map is faster, you don't have to type the transient prefix for first/last/rename/etc.