小编use*_*343的帖子

在 vi 编辑器的替换中使用插入符号 (^)

我正在使用 CentOS,并且正在阅读有关编辑器中的替换命令 ,s///的信息vi。我想测试一些我看到的例子:

:%s/old/new/g     Substitutes old with new throughout the file
:.,$s/old/new/g   Substitutes old with new from the current cursor position to the end of the file
Run Code Online (Sandbox Code Playgroud)

上面的示例对我来说按预期工作,但以下包含插入符号 ( ^) 的示例不起作用:

 :^,.s/old/new/g   Substitutes old with new from the beginning of the file to the current cursor position
Run Code Online (Sandbox Code Playgroud)

我试过了,但没有用,所以插入符号不起作用还是我输入的命令不正确?

editors vi

5
推荐指数
1
解决办法
576
查看次数

标签 统计

editors ×1

vi ×1