From kirkenda@eecs.cs.pdx.edu Mon Nov 11 22:54:19 1991 From: kirkenda@eecs.cs.pdx.edu (Steve Kirkendall) Newsgroups: comp.editors Subject: Quoting in ex/vi -- more info Date: 12 Nov 91 01:15:09 GMT Organization: Portland State University, Portland, OR The first results are in on my question about character quoting in ex/vi. The table below shows what I've learned from e-mail, and a few tests. Please check it out, and let me know of any errors or omissions. ex vi .exrc characters to quoted ----+----+------+-------------------------------------------------------- \ \ ^V The | command separator \ ^V n.a. Special control characters on any command line ^V ^V^V ^V Whitespace in a :map or :unmap command \ \ \ Whitespace in a :set command \ \ \ Meta-characters in a regexp or substitution text \ \ \ The %, #, and ! characters in a shell escape/filename The "ex" column refers to command lines that are interactively typed into ex, or for ex macros executed via ":@x". The "vi" column refers to ex command lines that are interactively typed using vi's ":" command. It also works for vi macros/maps which use ":". Please note that when you're defining the macro, though, you'll need to quote any ^Vs to delay their effect until the macro is applied. Also, to quote a whitespace character in a :map command, you need to actually insert a ^V into the command line, which is done by hitting ^V twice. The ".exrc" column refers to commands in the .exrc file, or a file which is executed via the ":so" command, or for the value of EXINIT. The quoting character for special control characters is different, but this is probably due to the serial line discipline, and not so much ex/vi itself. This also explains why ^V must be typed twice in vi but only once in ex, to quote whitespace in a :map. Bearing this in mind, the quoting character is consistent in all contexts except when the '|' command separator is to be quoted in .exrc files. ------------------------------------------------------------------------------- Steve Kirkendall kirkenda@cs.pdx.edu Grad student at Portland State U.