#evilmode kebab-case, snake_case 처리 친화적으로 - '_' 문자나 '-' 문자를 word 취급

(add-hook 'emacs-lisp-mode-hook
          #'(lambda ()
              (modify-syntax-entry ?_ "w")
              (modify-syntax-entry ?- "w")))

kebab-casesnake_case를 사용할 때, dw 명령을 실행하면 - 문자나 _ 문자 이전까지만 지운다. word 취급을 안 해서 생긴 문제. syntax table을 수정하면 된다.

진작에 할 걸. dt( 같은 명령으로 지우곤 했는데.

An underscore “_” is a word character in Vim. This means that word-motions like w skip over underlines in a sequence of letters as if it was a letter itself. In contrast, in Evil the underscore is often a non-word character like operators, e.g. +.

[.] The syntax-class usually depends on the major-mode of this buffer. [.]

- README - github.com/emacs-evil

minor 모드의 설움이다. syntax table은 major mode에서 수정한다. 그래서 vim과 다르게 동작했던 것.

C-x C-s C-x C-c


크리에이티브 커먼즈 라이선스


Published: December 16 2017


Feedback plz <3 @ohyecloudy, ohyecloudy@gmail.com