1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2024-11-27 22:42:50 +01:00
IntelliJ-IdeaVim/doc/ideajoin-examples.md
Alex Plate 03f18af66f
Temporaly get back ideajoin-examples because of help link in release
Revert "Move ideajoin examples to wiki"

This reverts commit d06f2a2d
2019-07-26 16:01:12 +03:00

896 B

Some examples of join command with ideajoin option enabled.
Put set ideajoin to your ~/.ideavimrc to enable this functionality.

  1. Automatic join concatenated lines:
"Hello" +                 ->       "Hello world"
" world!"
  1. Nested if's:
if (a) {                  ->       if (a && b) {
  if (b) {                             ...
     ...                           }
  }
}
  1. Remove braces from one line for / if / while:
if (fail) {               ->       if (fail) return;
     return;
}
  1. Kotlin one line method:
fun myNumber(): Int {     ->       fun myNumber(): Int = 42
    return 42
}
  1. Join declaration and initialization:
int a;                    ->       int a = 5;
a = 5;
  1. Chain call:
sb.append("a");           ->       sb.append("a").append("b");
sb.append("b");

And other functions provided by the plugins.