Skip to content

uncomment a comment block like gcgc in vim-commentary#20

Open
matzebond wants to merge 1 commit intolinktohack:masterfrom
matzebond:master
Open

uncomment a comment block like gcgc in vim-commentary#20
matzebond wants to merge 1 commit intolinktohack:masterfrom
matzebond:master

Conversation

@matzebond
Copy link
Copy Markdown

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

@linktohack
Copy link
Copy Markdown
Owner

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

@linktohack linktohack closed this Jan 8, 2018
@edkolev
Copy link
Copy Markdown

edkolev commented Feb 6, 2018

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 emacs-evil/evil-collection#70 (comment)

@linktohack
Copy link
Copy Markdown
Owner

Thanks @edkolev, want to give gcgc a try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants