vi junior use

<!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face {font-family:"/@宋体"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin-top:0cm; margin-right:0cm; margin-bottom:10.0pt; margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:宋体; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:11.0pt; mso-ansi-font-size:11.0pt; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-font-kerning:0pt;} .MsoPapDefault {mso-style-type:export-only; margin-bottom:10.0pt; line-height:115%;} /* Page Definitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->

0.
上下左右
(){}

均可将光标定位 ( 自己试试 )
1.
vim #
在命令行中输入 vim, 进入 vim 编辑器

2.
i
#
按一下 i , 下端显示 --INSERT--
#
插入命令 , vim 中可能任意字符都有作用
3.
Esc
#
退出 i( 插入 ) 命令进行其它命令使用
4.
:r filename #
读入一个文件内容 , 并写入到当前编辑器中
5.
:w newfilename #
将该编辑器中的内容写入到一个新文件中
6.
:w #
在编辑的过程中保存文件 , 相当于 word 中的 ctrl+s
7.
:!ls #
在编辑过程中执行 shell 命令 ls
8.
:sh #
进入 shell 命令行 , 执行完命令后 ctrl+d 退出重新进入 vim 编辑继续编辑
9.
:wq #
保存文件并退出
10.
ZZ #
保存文件并退出 , 同上一个命令 , 注意大写
11.
:q! #
强制退出 , 不保存
12.
:set number #
使编辑中的文件显示行号
13.
:set nonumber #
与上一条命令相反 , 不显示行号
14.
:help i #
查看插入命令帮助
15.
u #
撤消上一步操作
16.
/Fedora #
查找 Fedora 字符

17.
:s /Fedora/Redhat #
Fedora 字符替换为 Redhat( 只替换在光标所在的行 )
18.
dw #
删除单词
dd #
删除行
19.
o #
打开空白一行
20.
vim + filename #
进行文件最后一行进行编辑
21.
vim +n filename #
进入文件第 n 行进行编辑
22.
:1,.s/redhat/fedora
#.
号表示当前行 , 即光标所在行
#
将第 1 行到当前行 (.) 第一次出现的 redhat 字符代替为 fedora
23.
:1,.s/redhat/fedora/g
#
将第 1 行到当前行 (.) 所有出现的 redhat 字符代替为 fedora,g 全局标志
24.
:1,$s/redhat/fedora/g
#$
表示最后一行
#
将第 1 行到最后一行所有出现的 redhat 字符代替为 fedora
25.
:%s/redhat/fedora/g #
同上一个命令
26.
:%s//<redhat/>/fedora/g
#
将第 1 行到最后一行所有出现的 redhat 字代替为 fedora
#
, 而不是字符
27.
:f #
显示文件内容 , 状态等等
#
ctrl+g 命令
28.
:e! #
当前文件 , 返回到上次保存
:e file #
切换编辑文件
29.
:n #
当编辑时有多个文件 ( 比如 vim file1 file2) 时切换到下一个文件 , :e file 结合使用

:
在有 : 号的命令输入后都要回车才能执行 , 不再说

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值