5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Emacs:作業目的別にテーマを切り替えて使う

5
Last updated at Posted at 2021-09-16

Emacsテーマは、Melpaから package install してお好みで選べるのでとても便利ですが、一つに絞り込むのは難しいですね。私の場合、目的に応じて3つのテーマを切り替えて使えるようにしています。

1. iceberg

普段使いで目に優しいテーマ:iceberg-theme(自作テーマ)

私の Emacsは、執筆むけに使うことが多く、日本語の文章作成、編集が大半ですので、目に優しいこのテーマを愛用しています。もともとは、Vim向けに開発された、目に優しいダークブルーの配色です。

Emacs向けに移植されたものは、幾つか存在しますが、お好みにカスタマイズしたかったので自作しました。GitHubに置いてます。

Alt Text

2. doom-doracula

コード編集するときのテーマ:doom-dracula.theme

ごくたまに Emacs-LispやPerlスクリプトなどを編集することもあるので、そのときは視認性に優れていて多くの Emacserの間でも普及しているこのテーマを愛用しています。

Alt Text

3. doom-solarized-light

執筆モードでリラックスできるテーマ:doom-solarized-light.theme

Darkroom-modeで、短い文章を書いたり、エッセイの下書き、編集などをするときに珈琲を飲みながらゆったりした気分で文字書きできるので愛用しています。メニューバーもモードライも一切なしの Fullscreen画面は白紙の上になぐり書きしているかのようで快適です。

別途 installしてもよかったのですが doom-themesの中に solarized-light.themeもあったので、そちらを使っています。

Alt Text

4. テーマを切り替えて使うための設定

同様の趣旨で作られたものが Melpaでも見つかったのですが、私の場合うまく作動しなかったので独自に関数を作りました。というより下記記事からのパクリです。

(leaf doom-themes
  :ensure t
  :init
  (leaf iceberg.emacs :el-get minorugh/iceberg.emacs)
  (add-to-list 'custom-theme-load-path "~/.emacs.d/el-get/iceberg.emacs/"))

(leaf cycle-custom-theme
  :config
  (setq my:themes (list 'iceberg 'doom-solarized-light 'doom-dracula))
  (setq curr-theme my:themes)

  (defun cycle-custom-theme ()
	"Switch themes to cycle."
	(interactive)
	(disable-theme (car curr-theme))
	(setq curr-theme (cdr curr-theme))
	(if (null curr-theme) (setq curr-theme my:themes))
	(load-theme (car curr-theme) t)
	(message "%s" (car curr-theme)))

  (bind-key "<f11>" 'cycle-custom-theme)
  (setq curr-theme my:themes)
  (load-theme (car curr-theme) t))
5
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
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?