You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Feature request: Support &/$0 in vim substitute replacements #5753
I'd like a way to refer to the entire search pattern in a Vim replacement. Currently I have to wrap the whole pattern in brackets and use $1 in my replacement.
@nikklassen Note that you can use $& (:%s/foo/namespace.$&/) to get the whole text. This may not be expected Vim behavior, but still, you can easily use it as a workaround.
That's exactly what I wanted. It should've occurred to me to try that given how other substitutions work. I really just wanted to use this feature, the exact syntax isn't important to me, and given that Vim bindings aren't being maintained this could probably be closed.
Activity
marijnh commentedon Jan 22, 2019
(The vim bindings are not being actively maintained, so feature requests are unlikely to get acted on.)
marcelgerber commentedon Apr 8, 2019
@nikklassen Note that you can use
$&(:%s/foo/namespace.$&/) to get the whole text. This may not be expected Vim behavior, but still, you can easily use it as a workaround.nikklassen commentedon Apr 8, 2019
That's exactly what I wanted. It should've occurred to me to try that given how other substitutions work. I really just wanted to use this feature, the exact syntax isn't important to me, and given that Vim bindings aren't being maintained this could probably be closed.
[vim mode] codemirror#5753 Feature request: Support &/$0 in vim subst…
ilyakharlamov commentedon Jul 5, 2019
fix in #5929
[vim mode] #5753 Feature request: Support &/$0 in vim substitute repl…
[vim mode] codemirror#5753 Feature request: Support &/$0 in vim subst…
Update from master (#1)