vim/vi学习笔记(第一章 the vi text editpr)

笔记来自OReilly - Learning the vi Editor

quit and save is ZZ
退出并且保存
w save your file but not quit
保存文件但不退出
q to quit if you haven’t made any edits
当你没做任何编辑时退出
wq both save your edits and quit (:wq is equivalent to ZZ)
保存文件同时退出

e:! RETURN if you want to wipe out of all of the edits you have made in a session and return to the original file
如果你想要回到原文件并且清除所有在当前会话中所做的编辑
:q! RETURN you want to wipe out your edits and then just quit vi
(the exclamation point added to the :e or :q command causes vi to override this prohibition,performing the operation even though the buffer has been modified)
清除编辑及退出编辑器
(感叹号!使编辑器忽略警告,即使缓冲区被修改了也继续操作)

:w! file to overwrite the existing file,or type :w newfile to save the edited version in a new file
重写已存在的文件 将正在编辑的版本保存为新文件
type :!rm junkfile to delete a (large) unneeded file and free some space
删除(大量的)不必要的文件以及清理空间
:!df to see whether there’s any space on another file system .if there is ,choose a directory and write your file to it with :W pathname(df is the UNIX command to check a disk’s free space)
查找哪儿有剩余空间,如果存在,选择目录然后将文件写入(df在UNIX中用来查看磁盘剩余空间)
:!ls /tmp to see whther there any files you can remove to gain some disk space
查看是否有磁盘空间提供给你来移动文件

you can create a shell by typing :sh
你可以开启一个shell通过输入
type CTRL-D or exit to terminate the shell and return to vi
输入。。。。。。。。。来结束shell并返回vi

…then write your file with :w!
。。。然后开始编辑你的文档

附练习图:
这里写图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值