mirror.dongdigua.github.io/org/cheatsheet.org

71 lines
2.1 KiB
Org Mode
Raw Normal View History

2022-07-13 16:26:16 +08:00
#+STARTUP: indent
#+TITLE: Editor Cheatsheet
2022-07-13 16:26:16 +08:00
* VIM
** deletion
| key | usage |
|-------+------------------------|
** edit
| key | usage |
| u/C-r | 撤销/重做 |
| c i { | change inside {} |
| "{register}y/p | 向/从寄存器拷贝 |
2022-07-13 16:26:16 +08:00
** movement
| key | usage |
|----------+----------------------------|
| w/e | 下一个单词/单词尾 |
| b | 单词头 |
| H/M/L | 当前页面可见顶部/中间/底部 |
| C-u(f)/d | 上/下翻页 |
| % | 到对应括号 |
| {} | 段落跳转 |
| g ; | goto last change |
| g */# | 正/反查找光标下的词 |
| g d/D | 跳转到本地/全局定义 |
2022-07-13 16:26:16 +08:00
** visual
| key | usage | next |
|-----+--------------+------------------------|
| C-v | 矩形区域选择 | S-i 插入, esc 批量执行 |
** file/split
| key | usage |
|-------------+--------------|
| :n/:N | 文件之间切换 |
| :b | 切换到文件 |
| C-w h/j/k/l | 切换分屏窗口 |
| ZZ | :wq |
* EMACS
** org-mode
2022-07-29 16:13:34 +08:00
| key | usage |
|--------------+----------------------------|
| C-c \vbar | 创建表格 |
| C-c C-e | 导出 HTML |
| M-left/right | 升级(promote)/降级(demote) |
| C-c C-x C-v | toggle render images |
2022-07-18 14:40:59 +08:00
** normal
| key | usage |
|---------+---------------------|
| M-% | 替换 |
| M-; | 区域切换注释 |
| C-x C-; | 行切换注释 |
| C-y | paste to minibuffer |
2022-07-18 14:40:59 +08:00
2022-07-29 16:13:34 +08:00
** dired
| key | usage |
| R | rename |
2022-07-18 14:40:59 +08:00
* Git (虽然不算editor, 但是先也放这吧)
#+BEGIN_SRC shell
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 }'
#+END_SRC