2022-12-15 12:35:38 +08:00
|
|
|
#+TITLE: (Editor) Cheatsheet
|
2022-09-15 17:18:00 +08:00
|
|
|
#+DATE: <2022-06-13 一>
|
2022-07-13 19:33:17 +08:00
|
|
|
|
2022-07-13 16:26:16 +08:00
|
|
|
|
|
|
|
* VIM
|
2022-12-15 12:35:38 +08:00
|
|
|
:PROPERTIES:
|
|
|
|
:CUSTOM_ID:vim:
|
|
|
|
:END:
|
2022-07-13 16:26:16 +08:00
|
|
|
** deletion
|
2022-08-26 15:36:28 +08:00
|
|
|
| key | usage |
|
|
|
|
|-----+-----------------------|
|
|
|
|
| D | delete to end of line |
|
2022-07-27 13:20:18 +08:00
|
|
|
|
|
|
|
** edit
|
|
|
|
| key | usage |
|
2022-08-20 21:42:16 +08:00
|
|
|
|----------------+------------------|
|
2022-07-27 13:20:18 +08:00
|
|
|
| u/C-r | 撤销/重做 |
|
|
|
|
| c i { | change inside {} |
|
|
|
|
| "{register}y/p | 向/从寄存器拷贝 |
|
2022-07-13 16:26:16 +08:00
|
|
|
|
|
|
|
** movement
|
2023-01-27 19:17:48 +08:00
|
|
|
| key | usage |
|
|
|
|
|----------+------------------------|
|
|
|
|
| w/e | 下一个单词/单词尾 |
|
|
|
|
| b | 单词头 |
|
2022-08-18 13:33:48 +08:00
|
|
|
| H/M/L | 当前页面可见顶部/中间/底部 |
|
2023-01-27 19:17:48 +08:00
|
|
|
| C-u(f)/d | 上/下翻页 |
|
|
|
|
| % | 到对应括号 |
|
|
|
|
| {} | 段落跳转 |
|
|
|
|
| g ; | goto last change |
|
|
|
|
| g */# | 正/反查找光标下的词 |
|
|
|
|
| g d/D | 跳转到本地/全局定义 |
|
|
|
|
| C-w | jump between splits |
|
|
|
|
| C-o/i | Older/Newer position |
|
|
|
|
| ` | mark |
|
2023-02-09 11:05:12 +08:00
|
|
|
| ~ | change case |
|
2022-07-25 12:47:10 +08:00
|
|
|
|
2022-07-13 16:26:16 +08:00
|
|
|
** file/split
|
2023-05-02 07:51:56 +08:00
|
|
|
| key | usage |
|
|
|
|
|-------------+---------------|
|
|
|
|
| :n/:N | 文件之间切换 |
|
|
|
|
| :b | 切换到文件 |
|
|
|
|
| C-w h/j/k/l | 切换分屏窗口 |
|
|
|
|
| gt/T | next/prev tab |
|
|
|
|
| :%!xxd (-r) | edit in hex |
|
2022-07-13 16:26:16 +08:00
|
|
|
|
|
|
|
* EMACS
|
2022-12-15 12:35:38 +08:00
|
|
|
:PROPERTIES:
|
|
|
|
:CUSTOM_ID:emacs:
|
|
|
|
:END:
|
2022-10-30 15:09:37 +08:00
|
|
|
** org
|
2022-09-24 21:22:41 +08:00
|
|
|
| key | usage |
|
|
|
|
|-------------+-------------------------------|
|
|
|
|
| C-c \vbar | 创建表格 |
|
|
|
|
| C-c C-e | 导出 HTML |
|
|
|
|
| C-c C-x C-v | toggle render images |
|
|
|
|
| C-c C-l | 编辑链接 |
|
|
|
|
| C-c C-, | org-insert-structure-template |
|
2022-12-17 13:30:27 +08:00
|
|
|
| C-c C-x p | org-set-property |
|
2022-07-18 14:40:59 +08:00
|
|
|
|
2022-12-02 20:36:53 +08:00
|
|
|
https://orgmode.org/worg/dev/org-export-reference.html
|
|
|
|
|
2022-10-30 15:09:37 +08:00
|
|
|
*Bold* /italic/ _underline_ +strikethrough+ ~code~ =verbatim=
|
|
|
|
|
2022-07-18 14:40:59 +08:00
|
|
|
** normal
|
2023-02-26 14:02:01 +08:00
|
|
|
| key | usage |
|
|
|
|
|-----------+---------------------|
|
2023-05-21 16:01:15 +08:00
|
|
|
| M-% | 替换 |
|
|
|
|
| M-; | 区域切换注释 |
|
|
|
|
| C-x C-; | 行切换注释 |
|
2023-02-26 14:02:01 +08:00
|
|
|
| C-y | paste to minibuffer |
|
|
|
|
| M-&/! | async/shell command |
|
|
|
|
| C-M-\ | indent-region |
|
|
|
|
| M-y | past previous |
|
|
|
|
| C-x ^ | enlarge-window |
|
|
|
|
| C-q <tab> | insert a tab |
|
2023-05-21 16:01:15 +08:00
|
|
|
| C-x C-+/- | text-scale-adjust |
|
2022-07-29 16:13:34 +08:00
|
|
|
|
2023-01-01 11:58:58 +08:00
|
|
|
https://www.masteringemacs.org/article/fun-games-in-emacs
|
|
|
|
|
2022-09-15 17:18:00 +08:00
|
|
|
** eww/elpher (essensial)
|
|
|
|
| key | usage |
|
|
|
|
|-------+----------------------------------|
|
|
|
|
| TAB | shr-next-link/elpher-next-link |
|
|
|
|
| d | eww-download/elpher-download |
|
|
|
|
| g | eww-reload/elpher-go |
|
2022-09-22 11:48:49 +08:00
|
|
|
| G | eww |
|
2022-09-15 17:18:00 +08:00
|
|
|
| l | eww-back-url |
|
|
|
|
| \circ | elpher-back-url |
|
|
|
|
| & | eww-browse-with-external-browser |
|
|
|
|
| w | eww-copy-page-url |
|
2022-09-24 21:22:41 +08:00
|
|
|
| C/c | elpher-copy-current/link-url |
|
2022-09-22 11:48:49 +08:00
|
|
|
| v | eww-view-page-source |
|
2022-09-15 17:18:00 +08:00
|
|
|
| . | elpher-view-raw |
|
|
|
|
|
2022-08-26 15:36:28 +08:00
|
|
|
* Git
|
2022-12-15 12:35:38 +08:00
|
|
|
:PROPERTIES:
|
|
|
|
:CUSTOM_ID:git:
|
|
|
|
:END:
|
2022-09-22 11:48:49 +08:00
|
|
|
Git 能离线使用只是个传说, 你仍然需要联网搜索该用哪个命令传什么参数
|
2022-12-17 13:30:27 +08:00
|
|
|
magic is useful
|
2022-07-18 14:40:59 +08:00
|
|
|
#+BEGIN_SRC shell
|
2022-09-22 11:48:49 +08:00
|
|
|
git log --stat | perl -ne 'END { print $c } $c += $1 if /(\d+) insertions/;'
|
|
|
|
git log --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'
|
2022-12-02 20:36:53 +08:00
|
|
|
|
|
|
|
git show :1:file # 1common 2ours 3theirs
|
2022-12-20 07:10:52 +08:00
|
|
|
|
|
|
|
git rebase --committer-date-is-author-date
|
2022-07-18 14:40:59 +08:00
|
|
|
#+END_SRC
|
2022-08-26 15:36:28 +08:00
|
|
|
|
2022-12-15 12:35:38 +08:00
|
|
|
* Shell
|
|
|
|
:PROPERTIES:
|
|
|
|
:CUSTOM_ID:shell:
|
|
|
|
:END:
|
|
|
|
** Fish
|
2022-08-26 15:36:28 +08:00
|
|
|
| key | usage |
|
|
|
|
|--------------+----------------------------|
|
|
|
|
| M-Left/Right | jump world, or prevd/nextd |
|
|
|
|
| M-s | sudo the last command |
|
2022-09-15 17:18:00 +08:00
|
|
|
| M-w | what is this |
|
2022-12-14 20:07:24 +08:00
|
|
|
|
|
|
|
* ffmpeg
|
2022-12-15 12:35:38 +08:00
|
|
|
:PROPERTIES:
|
|
|
|
:CUSTOM_ID:ffmpeg:
|
|
|
|
:END:
|
2022-12-14 20:07:24 +08:00
|
|
|
#+BEGIN_SRC shell
|
2023-05-11 15:59:34 +08:00
|
|
|
ffmpeg -hwaccel qsv -i IN -ss 5:00 -t 60 -s 720x480 -r 30 -an -threads 2 OUT
|
2022-12-14 20:07:24 +08:00
|
|
|
#+END_SRC
|