Skip to content

Instantly share code, notes, and snippets.

@jamescherti
Created August 13, 2024 13:09
Show Gist options
  • Select an option

  • Save jamescherti/2aa95dc674ba024114d25824ddef8d7b to your computer and use it in GitHub Desktop.

Select an option

Save jamescherti/2aa95dc674ba024114d25824ddef8d7b to your computer and use it in GitHub Desktop.
Emacs Evil: Comment or uncomment line or visual selection
;; Description: Emacs Evil: Comment or uncomment line or visual selection
;; Gits URL: https://gist.github.com/jamescherti/2aa95dc674ba024114d25824ddef8d7b
;; License: MIT
(with-eval-after-load "evil"
(evil-define-operator my-evil-comment-or-uncomment (beg end)
"Toggle comment for the region between BEG and END."
(interactive "<r>")
(comment-or-uncomment-region beg end))
(evil-define-key 'normal 'global (kbd "gc") 'my-evil-comment-or-uncomment))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment