emacs の設定は人生(反論はない)
2022年末時点の mac 版 emacs 設定のトピックを書いておく。
- Cask から straight.el への移行
- ほとんど use-package 化 (leaf 化は挫折)
- (mac-auto-ascii-mode 1) をしたいので port 版 emacs に変更
- go-translate 導入
- lookup 何年振りかにインストール
- server-start + emacsclient 化
- elscreen をやめて tab-bar-mode に
- ispell 実行バイナリを hunspell に
- 検索は swiper
- メインUI は ivy、counsel
よく使ったコマンド
- ivy-switcher-buffer
- counsel-rg
導入した elisp 小物関数
- 現在行を region にする
;; from http://xahlee.info/emacs/emacs/emacs_region.html
(defun my-select-line ()
"Select current line."
(interactive)
(goto-char (line-beginning-position))
(push-mark (line-end-position))
(setq mark-active t))
region 範囲を変更するというのは意外にむずい。
- region 範囲の数字を sum
;; https://emacs.stackexchange.com/questions/10939/sum-numbers-in-region
(require 'cl-lib)
(defun sum-numbers-in-region (start end)
(interactive "r")
(message "%s" (cl-reduce #'+
(split-string (buffer-substring start end))
:key #'string-to-number)))
なんてエレガントな
enjoy emacs on next year.