Spacemacsにカスタムlayerを追加する

Table of Contents

SpacemacsにカスタムLayerを追加するサンプルを作りました

https://github.com/kentakozuka/my-layer

インポート方法

カスタムレイヤーを格納する場所(~/.emacs.d/private/)に移動します。

cd ~/.emacs.d/private/

サンプルレイヤーをcloneします。

https://github.com/kentakozuka/my-layer.git

~/.spacemacsdotspacemacs-configuration-layersmy-layerを追加します。

...
   ;; List of configuration layers to load.
   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.
     ;; ----------------------------------------------------------------
     ...
     my-layer
   )
...

.spacemacsをリロードしてインポートは終了です。

使ってみる

あとは、拡張子が.mmのファイルを作成し(e.g. sample.mm)、spacemacsで開くとモードラインにMMが表示されます。

SPC m h wをタイプするとHello, world!がバッファーに挿入されます。