LoginSignup
9
7

More than 5 years have passed since last update.

ゆるふわカワイイ*scratch*バッファ

Posted at

みなさまEmacsを起動してる頃ですが.emacs Advent Calendar 2016です。

@kiwanamiさんがEmacsの起動画面のカスタマイズについてを書いてくださいましたが、私は*scratch*に拘ってます。

*scratch*バッファとは何か

Emacs起動時に最初から作られるバッファのひとつです。“scratch”は「書きなぐる」みたいな意味で、ファイルを作るまでもない適当な下書きみたいなのを利用します。

Emacsを起動したあとの*scratch*のようす

*scratch* バッファのようす

私はどうするか

こんな感じの函数を定義するじゃろ。

init.el
(defun my/insert-tetosan ()
  "Kimiwa jitsuni bakadana."
  (with-current-buffer "*scratch*"
    (goto-char (1- (point-max)))
    (insert "
;;        r /
;;   __ , --ヽ!-- .、_
;;  !  `/::::;::::ヽ l
;;  !二二!::/}::::丿ハニ|
;;  !ニニ.|:/ ノ/ }::::}コ
;;  L二lイ  0´ 0 ,':ノコ
;;  lヽノ/ヘ、 '' ▽_ノイ ソ
;;   ソ´ /}`ス / ̄ ̄ ̄ ̄/
;;    .(_:;つ/  0401 / カタカタ
;;   ̄ ̄ ̄ ̄ ̄\/____/
")))

init-open-recentfを使ってる場合は、これをinit-open-recentf-before-hookに追加してやるだけで良いのでカンタン。

init.el
(add-hook 'init-open-recentf-before-hook #'my/insert-tetosan)
(init-open-recentf)

そんな怪しいもん入れたくねえよってひとも、これでいいんじゃないかと。

init.el
(advice-add 'command-line-1 :after #'my/insert-tetosan)

AAを選ぶ

やる夫AA録2には、けっこういろんなキャラクターのアスキーアートがございますので、小さいものを自分の環境でずれないように加工すれば良いんじゃないですかね。

9
7
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
9
7