evil-commentary
evil-commentary copied to clipboard
uncomment a comment block like `gcgc` in vim-commentary
I had to modify the regexp your code in #9. But now it works for me.
Thanks @matzebond! I'd like to keep evil-commentary
simple however. I'll consider merge this PR if there are more people interested.
I would appreciate this feature. I'm more used to the gcu
binding though, gcau
doesn't seem like a good mapping to me personally. This is how I bind gcu
:
(defun evgeni-commentary-uncomment-adjacent ()
(interactive)
(when (and (eq evil-this-operator 'evil-commentary))
(setq evil-inhibit-operator t)
(let ((beg (evil-commentary/ensure-in-comment-block (point) (point) nil))
(end (evil-commentary/ensure-in-comment-block (point) (point) t)))
(evil-commentary (car beg) (cadr end)))))
(define-key evil-operator-state-map "u" 'evgeni-commentary-uncomment-adjacent)
However, it might be a better idea to bind u
with menu-item
, as described here https://github.com/jojojames/evil-collection/issues/70#issuecomment-356039629
Thanks @edkolev, want to give gcgc a try?