#+title: 不造写啥标题
#+date: <2021-05-23 Sun 10:20>
#+author: thebesttv

* 学到了 Emacs - 这次主要是和窗口有关的
** window config & register
  - =C-x r w= (=window-configuration-to-register=) :: Store the window
    configuration of the selected frame in register REGISTER.  Use
    =C-x r j= to restore the configuration.

  - =C-x r j= (=jump-to-register=) :: If the register contains a
    window configuration (one frame) or a frameset (all frames),
    restore that frame or all frames accordingly.

** =C-x 4= prefix
   - =C-x 4 f=, =C-x 4 C-f= (=find-file-other-window=) :: Find file by
     *creating* a new window or *reusing* an existing one.
   - =C-x 4 d= (=dired-other-window=) :: 和上一个差不多。
   - =C-x 4 0= (=kill-buffer-and-window=) :: Kill the current buffer
     and delete the selected window.
   - =C-x 4 b= (=switch-to-buffer-other-window=) :: Select specified
     buffer in another window.


   还有一个没见过的:
   - =C-x 4 a= (=add-change-log-entry-other-window=) :: 仿佛和 change
     log 有关系,8清楚。

** [[https://github.com/abo-abo/ace-window][ace-window - Quickly switch windows in Emacs]]
   #+BEGIN_SRC elisp
     (global-set-key (kbd "M-o") 'ace-window)
     (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))
   #+END_SRC
   酱就可以用 =M-o= 来选窗口啦。

** [[https://www.emacswiki.org/emacs/WinnerMode][winner-mode - Undo & redo window changes]]
   #+BEGIN_SRC elisp
     (winner-mode +1)
   #+END_SRC
   酱就可以用 =C-c <left>=, =C-c <right>= 来 =winner-undo= 和
   =winner-redo= 啦。