一、一般模式:删除、复制与粘贴类命令 x,X x为向后删除一个字符,X为先前删除一个字符 nx(n代表数字) 向后删除n个字符 dd 删除当前行 D 删除当前行所有字符,试成为空行 ndd(n代表数字) 删除光标所在行的向下n列 d1G 删除光标所在行到第一行的所有数据 dG 删除光标所在行到最后一行的所有数据 yy 复制光标所在行 y1G 复制光标所在行到第一行的所有数据 yG 复制光标所在行到最后一行的所有数据 ynj(n代表数字) 复制光标所在行向下n+1行 dnj(n代表数字) 删除光标所在行向下n+1行 p,P p为复制的数据粘贴在光标的下一行,P为复制的数据粘贴在光标的上一行 J 将光标所在行与下一行的数据结合成一行 u 恢复前一个动作(undo) 二、编辑模式命令 i,I i为在当前光标所在处插入输入的文字,I为在光标所在行第一个非空字符插入输入的文字 a,A a为在当前光标所在处下一个字符插入输入的文字,A为在光标所在行最后一个字符的下一个字符处插入输入的文字 o,O o为在光标所在行的下一行行首开始插入字符,O为在光标所在行的上一行行首开始插入字符 r,R r为替换光标所在那一个字符,R为一直替换光标所指的文字,直到退出 Esc 退出,回到一般模式 三、命令模式 h 光标向左移一个字符 j 光标向下移一个字符 k 光标向上移一个字符 l 光标向右移一个字符 Ctrl+f 屏幕向下翻一页 Ctrl+b 屏幕向上翻一页 Ctrl+d 屏幕向下翻半页 Ctrl+u 屏幕向上翻半页 + 光标移动到下一行的第一个非空字符 - 光标移动到当前行的第一个非空字符 n空格(n代表数字) 光标向当前行向右移动n个字符 0(数字0) 光标移动到当前行的第一个字符(可以为空字符,注意与-区分) $ 光标移动到当前行的最后一个字符(可以为空字符,注意与-区分) H 光标移动到当前屏幕最上方的那一行的第一个非空字符 M 光标移动到当前屏幕最中间那一行的第一个非空字符 L 光标移动到当前屏幕最下方的那一行的第一个非空字符 G 光标移动到该文章最后一行的第一个非空字符 nG(n代表数字) 光标移动到该文章第n行的第一个非空字符 n光标从当前行向下移动n行的第一个非空字符 /word 在光标之后查找word字符串 ?word 在光标之前查找word字符串 :s/word1/word2/g 在光标当前行查找word1,并替换成word2 :n1,n2s/word1/word2/g 在第n1行与第n2行之间查找word1,并替换成word2 :%s/word1/word2/g 整个文章查找word1,并替换成word2 :w 将编辑的数据保存到硬盘文件中 :w [filename] 将编辑后的数据保存到硬盘的另一个文件中 :r [filename] 在编辑数据时,读入另一个文件中的数据,即将filename文件中的内容加到光标所在行下一行 :wq或:x 保存并退出 :q 退出,适用于未修改的文件 :q! 强制退出,适用于修改文件后不保存退出 :set nu 显示行号 :set nonu 取消行号 :n1,n2 w [filename] 将n1到n2行的内容保存到名为filename的文件中

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Notepad++7.3.1
Easy-to-use and free code editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
