Run two commands on the same line in vi editor

This team

%s#^#/*

and this team

%s#$#*/

works fine in the vi editor on ubuntu 14.04 when I execute them separately one by one.

I need to execute them as in one line, for example

%s#^#/* <bar> %s#$#*/

I also tried | and ; and CR as a separator and always get error 488 trailing character

+4
source share
1 answer

In my vim 7.4 patch 769 this works very well.

:%s/foo/FOO/ | %s/bar/BAR/

, . Vim , , #. , vim , .

, , :

:%s/foo/FOO/ | %s#bar#BAR

, , . . & :

:s#.*#/* & */
+2

Source: https://habr.com/ru/post/1656455/


All Articles