Reputation: 4360
I have a block of code, e.g.
...
elseif a:flag ==# "replace" return "fg"
elseif a:flag ==# "visual" return "#b58900"
elseif a:flag ==# "insert" return "#268bd2"
elseif a:flag ==# "normal" return "#859900"
elseif a:flag ==# "replace" return "#dc322f"
elseif a:flag ==# "visual" return 3
elseif a:flag ==# "insert" return 4
elseif a:flag ==# "normal" return 2
elseif a:flag ==# "replace" return 1
...
Now I want to move the return
part below the ìf
statements of all lines at once. Is this possible in vim?
I tried <C-v>I<CR><ESC>
. But that does only move the first return
to a new line.
Upvotes: 1
Views: 99
Reputation: 727
In command mode:
:%s/return/\r\t\treturn/gc
Omit the trailing gc to avoid the confirmation.
Upvotes: 2