1.1 KiB
1.1 KiB
In Emacs Underscores should be part of words
My roommate Tor pointed out to me that Evil Mode doesn't always consider underscores are part of the word boundary so incantations like diw
don't behave the way we expect them. In programming modes, this should be safe:
(add-hook 'prog-mode-hook #'cce/underscore_word_boundaries)
(defun cce/underscore_word_boundaries ()
(modify-syntax-entry ?_ "w"))
(provide 'cce/underscores-syntax-table)
Note that this adds a hook rather than setting prog-mode-syntax-table
. I observed that modifying that syntax table didn't achieve what I was looking for in modes that inherit from it. So be it. Hook City, USA, baby.