From ead39a3de2d06b8578e3163dd794c59966d7c366 Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 1 Sep 2019 19:49:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020190524=20Spell=20Checki?= =?UTF-8?q?ng=20Comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20190524 Spell Checking Comments.md --- .../tech/20190524 Spell Checking Comments.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 sources/tech/20190524 Spell Checking Comments.md diff --git a/sources/tech/20190524 Spell Checking Comments.md b/sources/tech/20190524 Spell Checking Comments.md new file mode 100644 index 0000000000..d6c34af73b --- /dev/null +++ b/sources/tech/20190524 Spell Checking Comments.md @@ -0,0 +1,39 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Spell Checking Comments) +[#]: via: (https://emacsredux.com/blog/2019/05/24/spell-checking-comments/) +[#]: author: (Bozhidar Batsov https://emacsredux.com) + +Spell Checking Comments +====== +I’m notorious for all the typos I make. Thankfully Emacs features an awesome built-in mode named `flyspell` to help poor typists like me. Flyspell highlights misspelled words as you type (a.k.a. on the fly) and has useful keybindings to quickly fix them. + +Most people typically enable `flyspell` only for major modes derived from `text-mode` (e.g. `markdown-mode`, `adoc-mode`), but it can really help programmers as well by pointing out typos they make in comments. All you need to do is enable `flyspell-prog-mode`. I typically enable it for all programming modes like this: + +``` +(add-hook 'prog-mode-hook #'flyspell-prog-mode) +``` + +Now you’ll get instant feedback when you make some typo in a comment. To fix a word just press `C-c $` (`M-x flyspell-correct-word-before-point`), while your cursor is behind it. + +![flyspell_prog_mode.gif][1] + +That’s all I have for you today! Keep fixing those nasty typos! + +-------------------------------------------------------------------------------- + +via: https://emacsredux.com/blog/2019/05/24/spell-checking-comments/ + +作者:[Bozhidar Batsov;Emacs Redux][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://emacsredux.com +[b]: https://github.com/lujun9972 +[1]: https://emacsredux.com/assets/images/flyspell_prog_mode.gif