Skip to content

Instantly share code, notes, and snippets.

@pr00thmatic
Created January 27, 2015 22:10
Show Gist options
  • Select an option

  • Save pr00thmatic/f36a78c29214b5c51cb0 to your computer and use it in GitHub Desktop.

Select an option

Save pr00thmatic/f36a78c29214b5c51cb0 to your computer and use it in GitHub Desktop.
.emacs for global keystrokes C-c C-c comment-region and C-c C-u uncomment-region
(defun comment-marked-region ()
"comments the marked region, just like M-x comment-region"
(interactive)
(comment-region (mark) (point)))
(defun uncomment-marked-region ()
"uncoments the marked region, just like M-x uncomment-region"
(interactive)
(uncomment-region-default (mark) (point)))
(global-set-key "\C-c\C-c" 'comment-marked-region)
(global-set-key "\C-c\C-u" 'uncomment-marked-region)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment