LoginSignup
5
5

More than 5 years have passed since last update.

Moom

Last updated at Posted at 2018-05-10

Moom

主に macOS で Emacs を使う人に向けたツールとして,Moom を porting しています.マウスを使わず,キーボードだけで,Emacsのフレームの位置を動かしたり,最大化したりできます.

最大化や拡大時にはフォント設定を変更するので,そのあたりの挙動が好みでない時は,(moom-toggle-font-module)init.el に書いておくか, moom-font.el を削除すれば大丈夫です.デモなどは,下記リポジトリの README が詳しいです.インストールは melpa からどうぞ.

macOS以外に,Ubuntu 18.04, Windows 8, Windows 10 で動作確認していますが,精度面でもう少し改良が必要な状況です.

move-right.gif

とりあえず使う

インストールに成功していると仮定して,とりあえず以下3行を init.el に記載すれば適当に動きます.moom-recommended-keybindings は,ガッツリとキーバインドを奪いますのでご注意を.ただこのパッケージはマイナーモードなので (moom-mode -1) すればいつでもキーバインドを取り戻せます.あるいは同関数のオプションを工夫すれば,特定の操作だけ,推奨キーバインドを設定できます.'all指定は,'(move fit expand fill font reset)と同じです.

(when (require 'moom nil t)
  (moom-recommended-keybindings 'all)
  (moom-mode 1))

すると,moom-mode-map に次のキーバインドが設定されます.

;; Move
(define-key moom-mode-map (kbd "M-0") 'moom-move-frame) ;; to top-left corner
(define-key moom-mode-map (kbd "M-1") 'moom-move-frame-left)
(define-key moom-mode-map (kbd "M-2") 'moom-move-frame-to-center)
(define-key moom-mode-map (kbd "M-3") 'moom-move-frame-right)

;; Fit
(define-key moom-mode-map (kbd "M-<f1>") 'moom-move-frame-to-edge-left)
(define-key moom-mode-map (kbd "M-<f3>") 'moom-move-frame-to-edge-right)
(define-key moom-mode-map (kbd "<f1>") 'moom-move-frame-to-edge-top)
(define-key moom-mode-map (kbd "S-<f1>") 'moom-move-frame-to-edge-bottom)

;; Expand
(define-key moom-mode-map (kbd "<f2>") 'moom-cycle-frame-height)
(define-key moom-mode-map (kbd "C-c f s") 'moom-change-frame-width-single)
(define-key moom-mode-map (kbd "C-c f d") 'moom-change-frame-width-double)
(define-key moom-mode-map (kbd "C-c f a") 'moom-change-frame-width-half-again)

;; Fill
(define-key moom-mode-map (kbd "C-c f f t") 'moom-fill-top)
(define-key moom-mode-map (kbd "C-c f f b") 'moom-fill-bottom)
(define-key moom-mode-map (kbd "C-c f f l") 'moom-fill-left)
(define-key moom-mode-map (kbd "C-c f f r") 'moom-fill-right)
(define-key moom-mode-map (kbd "C-c f f 1") 'moom-fill-top-left)
(define-key moom-mode-map (kbd "C-c f f 2") 'moom-fill-top-right)
(define-key moom-mode-map (kbd "C-c f f 3") 'moom-fill-bottom-left)
(define-key moom-mode-map (kbd "C-c f f 4") 'moom-fill-bottom-right)
(define-key moom-mode-map (kbd "C-c f f m") 'moom-fill-band)
(define-key moom-mode-map (kbd "M-<f2>") 'moom-toggle-frame-maximized)

;; Font
(define-key moom-mode-map (kbd "C--") 'moom-font-decrease)
(define-key moom-mode-map (kbd "C-=") 'moom-font-increase)
(define-key moom-mode-map (kbd "C-0") 'moom-font-size-reset)

;; Reset
(define-key moom-mode-map (kbd "C-c C-0") 'moom-reset)

以下,随時更新

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