If I select multiple lines and do substitution at the beginning of text it actually substitutes at the beginning of the line. For example, given:abc    def  ghiIf we do:Vjj:s/^/-->/then we get:-->    abc-->        def-->      ghibut this is no different than Vjj:s/0/-->/What we actually want is:--> abc    --> def  --> ghiI would have expected the circumflex accent, ^, to go to the beginning of text, not the beginning of line like 0 does. What is going wrong here?
Substitution at the beginning of the text line, not the absolute beginning of line
substitute
^  represents the beginning of the line in regex language it is not related to the motion ^ that's why your solution won't work.You'll have to use that::%s/\(^\s*\)/\1-->Here you use the substitution with a capture group, here is a detail of the pattern:\(    \)     Will be used to capture characters and reuse them in the subtitution string  ^\s*       You capture any number of whitespaces at the beginning of the lineIn the substitution string \1 is used to insert the content of your capture group.You can even simplify the expression with::%s/^\s*/&-->Here you don't use capture group (\(  \)) because & makes reference to the whole matched pattern.