evil-commentary icon indicating copy to clipboard operation
evil-commentary copied to clipboard

uncomment a comment block like `gcgc` in vim-commentary

Open matzebond opened this issue 7 years ago • 3 comments

I had to modify the regexp your code in #9. But now it works for me.

matzebond avatar Oct 30 '17 20:10 matzebond

Thanks @matzebond! I'd like to keep evil-commentary simple however. I'll consider merge this PR if there are more people interested.

linktohack avatar Nov 01 '17 15:11 linktohack

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

edkolev avatar Feb 06 '18 14:02 edkolev

Thanks @edkolev, want to give gcgc a try?

linktohack avatar Feb 06 '18 14:02 linktohack