Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim 常用命令 #39

Open
chenyinkai opened this issue Apr 11, 2018 · 0 comments
Open

vim 常用命令 #39

chenyinkai opened this issue Apr 11, 2018 · 0 comments
Labels

Comments

@chenyinkai
Copy link
Owner

chenyinkai commented Apr 11, 2018

vim 常用命令

最近阿里云搞活动,于是入手了个服务器,记录一下操作过程中的一些常用 vim 命令。

编辑状态

a / i 进入编辑状态
esc 退出编辑

退出, 保存

:q 退出
:q! 强制退出
:w 保存
:wq 保存退出

删除

x 删除光标所在位置
dd 删除整行, 剪切
dw 删除单词(光标在单词首位)

复制

yy 复制整行
yw 复制单词

粘贴

p 粘贴

撤销

u 撤销上一次, u3 撤销三次ß

光标操作

gg 跳到首行
G 跳到末行
nG 跳到指定行,如 3g 跳到第三行
:set nu 显示文件行数

查找

/ 直接输入斜杠符号,然后接要查找的字符串,比如:/apple,然后回车确定
n 在搜索到结果之后,可以用n键来往下看下一个匹配到的字符串,或者用N来往上查找,记得之前先按回车哦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant