懐中望遠鏡(仮)

Emacs Looks

"Less is more."

I'm using Emacs, so let's try to make this editor more beautiful according to this philosophy.

Disable toolbar

Because Emacs's tool bar is terribly old-fashioned looks, first we have to do is to hide it.

Emacs has another bar, menu bar, but in MacOS this bar is integrated in the OS's menu bar. So we don't need to hide it in this case.

(tool-bar-mode -1)
;(menu-bar-mode -1) ;; add this line if you need

Window Padding

Emacs has a parameter internal-border-width. This is what we want to add some space inside of the window.

And as you know, Emacs has "fringes" on the left and right sides. We can also set margin in these frindges by defining size explicitly.

(add-to-list 'default-frame-alist '(internal-border-width . 20))
(add-to-list 'default-frame-alist '(left-fringe . 40))
(add-to-list 'default-frame-alist '(right-fringe . 40))

(set-face-attribute 'fringe nil
                    :foreground (face-attribute 'default :foreground)
                    :background (face-attribute 'default :background))

In most themes, fringe's color is different from background color of text area. It's better to set the same color.

ModeLine

ModeLine has some properties of border: "box", "overline", and "underline".

We set the same background color as the one of text area, so at least we should set one of these properties to t.

Another choice is disable modeline. This is more minimal way that makes looks like vim.

Anyway, we use overline here.

(set-face-attribute 'mode-line nil
                    :foreground (face-attribute 'default :foreground)
                    :background (face-attribute 'default :background)
                    :inverse-video nil
                    :height 125
                    :box nil
                    :overline t
                    :underline nil)

(set-face-attribute 'mode-line-inactive nil
                    :foreground "LightGray"
                    :background (face-attribute 'default :background)
                    :inverse-video nil
                    :height 125
                    :box nil
                    :overline t
                    :underline nil)

Font & Cursor

Put these lines as you like.

;; Set font
(add-to-list 'default-frame-alist '(font . "Roboto Mono-12"))

;; Set cursor type to "bar" without blinking.
(add-to-list 'default-frame-alist '(cursor-type . bar))
(blink-cursor-mode -1)

Done!

Now our Emacs looks like this:

Cool🎉 Isn't it?


#Emacs