Automatically replace specific text string as they are entered in emacs

There was a small nuance that listened to me for a while, namely, that I often type #incluedinstead #include. If this was not obvious, I program a lot of C and C ++. This typo destroyed countless builds and consumed time that would have been better spent drinking coffee or surfing. Of course, emacs can help and fix my errors as I type (only in cc-mode, of course). But how?

A googling search and a stackoverflow search returned no answers.

+3
source share
5 answers

abbrev-mode: , #inclued, C-x a i g include RET, , type #inclued, #include. , , C-x a i l C-x a i g. , M-x edit-abbrevs.

+8

, abbrevs ( , ) flymake ( emacs).

http://flymake.sourceforge.net/

Flymake , . , ( : , gcc ).

gcc , . , 2 , gcc . , -.

+3

- , , YAsnippet, - #in, TAB, ... .

+1

flymake - , . .

0

I was about to suggest that this might be a bit of a weird app for flyspell, but danlei's answer looks better.

0
source

Source: https://habr.com/ru/post/1753771/


All Articles