LoginSignup
4
3

More than 5 years have passed since last update.

EditorconfigをEmacsで使う(OSX)

Posted at

Editorconfigとは

Editorconfigはタブ幅の設定や改行などの設定を統一した設定ファイル(.editorconfig)で様々なEditorに反映させることが出来るツールです。

複数人で行うプロジェクトでみんながそれぞれ違うエディタを使っていてもコーディングルールを簡単に統一出来るので、非常に重宝します。

Editorconfigのインストール

OSXの場合、homebrewを使って簡単にインストールできます。

$ brew install ediorconfig

EditorconfigのEmacsプラグインを設定する

次にEditorconfingをEmacsで使うためのプラグインをインストールします。
自分はcaskを使っているのでCaskに以下を追記してインストールしました。

Cask
(depends-on "editorconfig")

$ cask install

Editorconfigはプラグインから先ほどhomebrewでインストールしたEditorconfigのコマンドを実行するため、その実行PATHを設定しないといけません。

emacsのinit.elファイル以下を追記します。

.emacs.d/init.el
(setq edconf-exec-path "/usr/local/bin/editorconfig")

あとはエディタの設定をしたいプロジェクトのトップディレクトリに.editorconfigを設置すれば反映します。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3