Gist for more intuitive commenting in Emacs
This commit is contained in:
parent
6a5340a789
commit
c8849e217a
21
gists.org
21
gists.org
|
@ -146,6 +146,27 @@ My vertico-repeat setup.
|
|||
:END:
|
||||
#+end_src
|
||||
|
||||
* Emacs commenting: do what I actually mean :emacs:
|
||||
|
||||
#+begin_src elisp :tangle gists/emacs-comments-do-what-i-actually-mean.el
|
||||
;; Replace comment-dwim (M-;) with a modified version of
|
||||
;; comment-or-uncomment-region. The modification is done by the crux
|
||||
;; package, which acts on a region if active otherwise on the current
|
||||
;; line.
|
||||
;;
|
||||
;; My personal preference goes to using straight.el-powered
|
||||
;; use-package forms, even for built-in modules.
|
||||
|
||||
(use-package newcomment
|
||||
:straight (:type built-in)
|
||||
:bind
|
||||
([remap comment-dwim] . #'comment-or-uncomment-region))
|
||||
|
||||
(use-package crux
|
||||
:config
|
||||
(crux-with-region-or-line comment-or-uncomment-region))
|
||||
#+end_src
|
||||
|
||||
* Meta
|
||||
** License
|
||||
|
||||
|
|
16
gists/emacs-comments-do-what-i-actually-mean.el
Normal file
16
gists/emacs-comments-do-what-i-actually-mean.el
Normal file
|
@ -0,0 +1,16 @@
|
|||
;; Replace comment-dwim (M-;) with a modified version of
|
||||
;; comment-or-uncomment-region. The modification is done by the crux
|
||||
;; package, which acts on a region if active otherwise on the current
|
||||
;; line.
|
||||
;;
|
||||
;; My personal preference goes to using straight.el-powered
|
||||
;; use-package forms, even for built-in modules.
|
||||
|
||||
(use-package newcomment
|
||||
:straight (:type built-in)
|
||||
:bind
|
||||
([remap comment-dwim] . #'comment-or-uncomment-region))
|
||||
|
||||
(use-package crux
|
||||
:config
|
||||
(crux-with-region-or-line comment-or-uncomment-region))
|
Loading…
Reference in a new issue