Expand or collapse code elements To collapse or expand all code fragments, press Ctrl+Shift+NumPad - / Ctrl+Shift+NumPad + . IntelliJ IDEA collapses or expands all fragments within the selection, or, if nothing is selected, all fragments in the current file, for example, all methods in a file.
I can shift a line of code or a block of code in Eclipse by the following way: Focus a line or select a block of source code. Source menu -> Click "Shift Left" or "Shift Right"
Duplicate the current line or selectionPress Ctrl+D or choose Edit | Duplicate Line or Selection from the main menu . Alternatively, you can press Ctrl+Shift+A , start typing the command name in the popup, and then choose it there.
Is it possible to fold large blocks of code in IntellJ, select a section of code that encloses the folded section, and only copy the text that is visible?
For instance, if I have a JSON file like:
{
"list1" : [
1,
2,
3
],
"list2" : [
"a",
"b",
"c"
]
}
and I fold the lists so the IDE displays them as:
{
"list1" : [...],
"list2" : [...]
}
Is there a way to copy ONLY the text displayed above? Regular copy includes the code that is hidden from view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With