Files
Obsidian/Books/Vim实用技巧/一、入门导读.md
2023-02-20 12:24:25 +08:00

28 lines
852 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
tag: vim
---
# 技巧1`.` 命令
`.` 命令是一个微型的宏,用来重复上一次的修改。
# 技巧2常用的整行指令
| 复合 | 等效 |
| ---- | ------ |
| `C` | `c$` |
| `s` | `cl` |
| `S` | `C$` |
| `I` | `^i` |
| `A` | `$a` |
| `o` | `A<CR` |
| `O` | `ko` |
# 技巧3活用 `.` 和 `;`
例:` '+' -> ' + '` `f+`, `s<BS>+<BS><ESC>`
`;` 可以重复上一次的查找指令。
> `,` 返回上一次的查找。
# 技巧4可重复的操作及回退
| 操作 | 重复 | 回退 |
| ---------------------------- | ---- | ---- |
| `{edit}` | `.` | `u` |
| `f/F{char}`/`t/T{char}` | `;` | `,` |
| `/patter<CR>`/`?pattern<CR>` | `n` | `N` |
| `:s/target/replacement` | `&` | `u` |
| `qx{changes}q` | `@x` | `u` |
# 技巧