> For the complete documentation index, see [llms.txt](https://docs.crushing.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.crushing.xyz/java-ways/101/basis/tool/vim/vim-advance.md).

# Vim advance

```yaml
   Author: Gentleman.Hu
   Create Time: 2020-11-06 16:17:19
   Modified by: Gentleman.Hu
   Modified time: 2020-11-06 20:58:43
   Email: justfeelingme@gmail.com
   Home: https://crushing.xyz
   Description: 一些vim进阶用法
```

## 基础

| 符号 | 对应单词                | 含义                                |
| -- | ------------------- | --------------------------------- |
| y  | yank                | 拷贝, 大写yank到行尾                     |
| t  | till                | 直到                                |
| c  | change              | 改                                 |
| g  | not sure(namespace) | "go"                              |
| a  | append              | 小写后插,大写前插                         |
| o  | not sure            | 小写下行插,大写上行插                       |
| d  | delete              | 小写跟数字,删除指定数量,大写从cursor删到行尾        |
| \~ | 改变大小写               | 改变大小写                             |
| p  | put                 | 寄存器存的内容放在cursor后,大写放之前.前边跟数字,放置n遍 |
| e  | end                 | 末尾                                |
| $  | end                 | 末尾                                |
| 0  | start               | 首                                 |
| %  | not sure            | 匹配到对应括号                           |
| z  | not sure            | z. cursor居中屏幕;zt,top;zb,bottom    |
| \* | mark/star           | 快速标记                              |

* 上表并不完整, 列举仅仅常用

## 用例实践

* 多行添加注释

![](https://cdn.jsdelivr.net/gh/gentlemanhu/public-store/images/20201106165738.gif)

* gt+"字符",删除直到某个"字符"

![](https://cdn.jsdelivr.net/gh/gentlemanhu/public-store/images/20201106170133.gif)

* 其他慢慢探索

## Macro用例实践

> 在spacevim中录制macro

| Key                | Mode   | Action                           |
| ------------------ | ------ | -------------------------------- |
| `<leader>` + `qr`  | Normal | Same as native `q`               |
| `<leader>` + `qr/` | Normal | Same as native `q/`, open cmdwin |
| `<leader>` + `qr?` | Normal | Same as native `q?`, open cmdwin |
| `<leader>` + `qr:` | Normal | Same as native `q:`, open cmdwin |

> 普通vim直接`q`即可进入录制,spacevim改变了映射,`qr`刻可进入录制

* 简单加引号

![](https://cdn.jsdelivr.net/gh/gentlemanhu/public-store/images/20201106171938.gif)

* 其他用例可参照资源, 各种玩法, 等待探索

## Resources

* [油管\_大神](https://www.youtube.com/watch?v=IiwGbcd8S7I)
* [vim\_micros](https://spin.atomicobject.com/2014/11/23/record-vim-macros/)
* [stack\_exchange\_what\_is\_meaning\_of\_blabla\_invim](https://vi.stackexchange.com/a/18745)
* [vim\_CheatSheet](https://www.fprintf.net/vimCheatSheet.html)
* [dot\_command\_in\_vim](https://stackoverflow.com/a/7325105)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.crushing.xyz/java-ways/101/basis/tool/vim/vim-advance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
