@kyanny's blog

My thoughts, my life. Views/opinions are my own.

Emacs: Doom Emacs からローカルインストールした textlint を使う

  1. textlint をローカルにインストールする Getting Started with textlint · textlint
  2. flycheck-textlint-config.textlintrc に変更する(デフォルトは textlintrc.json
  3. flycheck で textlint を使う設定をした - @znz blog を参考に、add-node-modules-path をインストールする

~/.doom.d/packages.el

(package! add-node-modules-path)

~/.doom.d/config.el

(with-eval-after-load 'markdown-mode
  (add-hook 'gfm-mode-hook #'add-node-modules-path)
  (add-hook 'markdown-mode-hook #'add-node-modules-path))

textlint のインストール・セットアップと .el への設定追記が終わったら doom sync と Emacs を再起動する。

$ ~/.emacs.d/bin/doom sync

Flycheck が有効化されているかどうかは M-x flycheck-verify-setup で確認できる。

executable / config file が見つからないなどの場合は自動的に disabled になるので、textlint をインストールしていないディレクトリ内でファイルを編集するときは邪魔にならなくて良い。