vim replace text at end of line
# Basic syntax:
:%s/.*\zs<search_pattern>/<replacement>/
vim replace text at end of line
# Basic syntax:
:%s/.*\zs<search_pattern>/<replacement>/
vim replace with new line
# Basic syntax:
:%s/character/\r/g # note, use \r instead of \n
# Example usage:
# Say you have a file with a line this and you want all parameters on different
# lines:
<param_1> <param_2> <param_3> <param_4>
# You could run:
:%s/ /\r/g # to get:
<param_1>
<param_2>
<param_3>
<param_4>
# Or you could run something like:
%s/<> </\r:/g # to get:
<param_1:
param_2:
param_3:
param_4> # which saves you some work if you also want to delete the separators
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us