ex-mode icon indicating copy to clipboard operation
ex-mode copied to clipboard

Replacing backslash

Open deafwood opened this issue 7 years ago • 4 comments

I frequently run the following command in vi: 'a,'bs/^/\\/\\// to insert a comment notation "//" at the beginning of a block of lines but am unable to do this. I get an error that says "Command error: trailing characters".

Please advise if there is a work around, thanks!

deafwood avatar Sep 21 '17 14:09 deafwood

@deafwood Exactly how do you type the command in ex-mode command line, like this? %s/'a,'bs/^/\\/\\//

hultberg avatar Oct 01 '17 12:10 hultberg

After marking the first ('a) and last ('b) lines, I enter the following command: 'a,'bs/^/\\/\\//

deafwood avatar Oct 04 '17 16:10 deafwood

Something similar that produces the same error, but works in vim (v7.4):

:%s/:\/\/bar/:\/\/foo.bar/g

socketbox avatar Mar 24 '18 11:03 socketbox

Dear all, I also have the same problem. For example:

:1,2s/^////

puts // at the beginning of lines 1 and 2 in vim.

In atom with Ex-mode, this throws the error: "Command error. Trailing characters"

baccione avatar Nov 20 '18 09:11 baccione