wiki/运维/操作系统/Linux/笔记/12.文本编辑-VIM.md
2025-01-02 10:46:09 +08:00

36 lines
761 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.

## 1、命令模式玩法
- r filename读文件内容到当前文件中
- w filename另存文件到另外一个文件中
- command执行命令
- rcommand读入命令的输入
- d删除
- y复制
- p粘贴
- u撤回
- U反撤回
- set nu设置行号
- set ic忽略大小写
- set noic认定大小写
- set ai自动缩进
- set noai取消自动缩进
- set list显示换行符
- set nolist不显示换行符
- set key=passwd加密
- set key=:禁用加密
##### 1.1 查找并替换
**查找:**
`/文件`
- n向下
- N向上
**替换格式:**
`s/要查的内容/替换的内容/修饰符`
**修饰符:**
- i忽略大小写
- g全局替换
- gc全局替换每次替换前询问