![]() ![]() To join the lines together, use ⌃⇧J, or Ctrl+ Shift+ J. Pressing Enter in String will auto-insert + Try it out with the code below, press Enter somewhere inside the String value: IntelliJ IDEA will automatically close off the String on the line above, add the ‘+’ symbol for concatenation, and reopen the String on the line below. One of the simplest but most useful editor features is creating a line break in the middle of a declared String using Enter. If we select more than one line and use the shortcut, it will move all highlighted lines. This means you can move the line anywhere. If you want to move just a line, or move something without factoring in code context, you can move a line up with ⌥⇧↑, or Alt+ Shift+ Up Arrow. Use ⇧⌘↓, or Ctrl+ Shift+ Down Arrow, to move it down ![]() The move is context sensitive, so in this case the IDE won’t let us move it out of the method. Applying this to the line with the variable declaration will move the whole statement, in this case the whole multi-line string declaration. Moving a statement moves the Java statement as a whole. To move a statement up use ⇧⌘↑, or Ctrl+ Shift+ Up Arrow. "and you can type and hit Enter and get the + sign " + String someText = "This code can be on a single line " + Pressing Command+D or CTRL+D will duplicate the line Pressing Command+C or CTRL+C will copy the line Pressing Command+V or CTRL+V will paste the line Pressing Command+X or CTRL+X will cut the line Sometimes it might be more useful to duplicate the line instead with ⌘D, or Ctrl+ D. Like cut, we can copy a whole line with ⌘C, or Ctrl+ C, without having to highlight it first, and paste this too. We can paste this line using ⌘V, or Ctrl+ V, like in any application. To cut a line, press ⌘X, or Ctrl+ X, without selecting or highlighting anything. There are several editor shortcuts that you can use to speed up your workflows, for example, ⌘⌫, (or Ctrl+ Y), to delete the current line. It’s worth using this shortcut when you start working on something to minimise distractions and maximise space. This hides all the other windows so the editor takes the full space available. The most useful shortcut to help you focus on your code is ⇧⌘F12 on macOS, or Ctrl+ Shift+ F12 on Windows and Linux. In this tutorial we’re going to see some shortcuts that you can use to make it easier to write and edit code. IntelliJ IDEA has lots of keyboard shortcuts and features that help you write code. This provides an easy way for people to skim the content quickly if they prefer reading to watching, and to give the reader/watcher code samples and links to additional information. This blog post covers the same material as the video. These shortcuts can also be configured if required. IntelliJ IDEA offers you a huge range of keyboard shortcuts to help you get faster and be more productive in Intellij IDEA. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |