New answers tagged

1 vote

Vim mapping to make function parameters become multi-line?

To solve this without a plugin, the following pure Vim solution relying on :substitute and = could be used. It's hard to provide a "works for all languages" solution as syntax differs ...
Friedrich's user avatar
  • 1,239
1 vote

Vim mapping to make function parameters become multi-line?

If you're happy to install a plugin, you could try Andrew Radev's splitjoin. It works with a wide range of languages, and you can configure new ones if necessary. By default it uses gS to split a ...
Rich's user avatar
  • 31.3k
1 vote

Vim mapping to make function parameters become multi-line?

You could be interested to the following: vim-argwrap plugin. It provides an :ArgWrap command that seems to do exactly what you want.
Vivian De Smedt's user avatar
1 vote

Vim mapping to make function parameters become multi-line?

A first start might be using tpope’s surround plugin to do cS(( to make the parens multi-line. Then you could attempt one of the substitutions like :substitute/, /,\r/g and clean up. But this last ...
D. Ben Knoble's user avatar
  • 25.4k
0 votes
Accepted

Is there an efficient way to delete the duplicated block with same start and end to keep unique?

Some details of your implementation could be improved but the general strategy is sound. :g/\.start/,/\.end/s/\n/\t :sort u :g/\.start/s/\t/\r/g No need for \v. Some patterns can be simplified. No ...
romainl's user avatar
  • 39.3k

Top 50 recent answers are included