- spacemacsには
Flyspell-modeがある(スペルチェックできる) -
dotspacemacs-configuration-layersでspell-checkingを設定している場合にError enabling Flyspell mode: (Searching for program No such file or directory ispell)と出てスペルチェックされなかったアレ(辞書の設定とかすれば使える) - Windows10で素直にやろうとするとハマる
まず Hunspell推奨
- スペルチェッカー
Ispell、どうやるのかわからない😇(win32版はあるらしい => http://hp.vector.co.jp/authors/VA028080/ispell.html) -
Ispellの後継としてAspellもあるが、Windows10ではrelease 0.60 or greater is requiredエラーが出てツムツム => https://emacs.stackexchange.com/questions/41892/aspell-with-emacs-26-1-on-ms-windows
(まあEmacsバージョンによりそうだけども) -
Hunspellが主流らしいので、そっちを入れた
spacemacsで Hunspellを利用する
Hunspellインストール
参考 => https://texwiki.texjp.org/?Hunspell#y7b755eb
- Windows10に
MSYS2をインストール => - MSYS2コンソール上で
Hunspellインストール => https://uep.media.hosei.ac.jp/windows-emacs-hunspell/
(pacmanコマンドを使う)
環境変数の設定
- Windows10環境変数名に
DICTIONARY追加(名前:DICTIONARY値:en_US) -
.spacemacs.envにもDICTIONARY=en_USを追加(自動でも手動でも良い)
.spacemacsの設定
- spacemacsの設定ファイル
.spacemacs(Space f e dで開ける)のdotspacemacs-configuration-layersにspell-checkingを追記(もうされてるかも?)
dotspacemacs-configuration-layers
'(
;; ----------------------------------------------------------------
;; Example of useful layers you may want to use right away.
;; Uncomment some layer names and press <SPC f e R> (Vim style) or
;; <M-m f e R> (Emacs style) to install them.
;; ----------------------------------------------------------------
sql
python
markdown
...
;; これ
(spell-checking :variables enable-flyspell-auto-completion nil)
...
)
- 同じく
.spacemacsのuser-init ()はこんな感じに追記する
(defun dotspacemacs/user-init ()
"Initialization function for user code.
It is called immediately after `dotspacemacs/init', before layer configuration
executes.
This function is mostly useful for variables that need to be set
before packages are loaded. If you are unsure, you should try in setting them in
`dotspacemacs/user-config' first."
;; MSYS2経由でインストールしたパッケージを使う
(add-to-list 'exec-path "C:\\msys64\\mingw64\\bin")
;; FlyspellにHunspellを使う
(setq ispell-program-name "hunspell")
)
exec-pathは MSYS2のインストール場所から辿った mingwのbinまでのパスを書く。
🎉🎉🎉🎉🎉