It probably has no practical consequences, but it makes me think I'm doing something wrong...
When creating a for loop in Octave, the bracketing on the left gray bar of the editor (along the line numbers) doesn't stay with the end closing line. It rather seems tethered to the first line after the loop, and keeps on widening with every return if the cursor is at the beginning of the line following the loop.
Introducing tab spaces in front of end doesn't seem to do the trick in terms of "linking" the bracket to the end line.
Here is an example:
Serendipitously, I found a "way" to keep the bracket end align with the end command: just insert a backslash:
Related
There is no easier way to explain what I want to do than a picture:
I would like to reduce the time it takes me to refactor HTML code by deleting all the white space behind (or before, doesn't matter that much) my caret until the next non-blank character, emphasized by the highlighted blue whitespace I would like to delete. I found a way to do this on vim, but I want to do this on Intellij.
Try Ctrl+Alt+J (⌃⇧J on Mac) on the <a>... line to perform the 'Join Lines' action.
More information on the feature can be found here and here.
I made a .txt file (UTF-8) and put the following text in it:
123
456
789
I then tried to find out the position of the character '4' by using the InStr() function. Surprisingly, the result was 6. I tried with the character '3', and the result was 3. So, there must be two characters in between the 3 and the 4.
I then tried InStr(TextBox1.Text, Chr(13)) and the result was 4.
Ok. The "New Line" has a character located in the 4th position. If so, then what is 5th character in there?
The actual character(s) used for new-line are different from one platform to the next. Some systems use character 13 to mean a new-line, some use 10, and some, like Windows, use both.
Technically, character 13 is supposed to mean a carriage return (return the print head of the printer to the left side of the page), that's why it's often referred to as CR. Remember, in the early days of computing, printers were used as terminals rather than video screens. So, the closest equivalent of CR on a video terminal is for the cursor to return to the beginning of the current line, but not advance to the next line.
Character 10 means line-feed (LF), which means to advance (i.e. feed) the paper by one line so that the print head is ready to print on the next line. The closest equivalent to a line-feed on a video terminal is to move the cursor down to the next line, but keep it at the same x-position.
So, with those two-things in mind, if you wanted to begin typing at the beginning of the next line, you would need to do both things. You need to advance to the next line on the page AND return to the beginning of the line, hence CRLF, two characters.
Presumably, some system designers thought it was too wasteful to use two characters for each new-line, when the added nuance was rarely needed for computers with video displays, so they opted to only use either CR or LF. Since the correct encoding to use changes from one platform to another, it's best to use Environment.NewLine in .NET to get whichever is appropriate for the current system.
Consider, for example, when you run this console app on windows:
Public Sub Main()
Console.Write("123" & vbCr)
Console.Write("4" & vbCr)
End Sub
The output is:
423
The carriage-return only caused the cursor to go back to the beginning of the line. It didn't cause it to move down to the next line, so the 4, when it's printed, overwrites the 1.
I follow along in totoreals all the time and the instructor is so quick to get to the end of the line of code and add a semicolon.
The only ways I know how to do this is to hit the end key and that is not easy to reach, use arrow keys and push twice or more or use my mouse. For a time I remapped by end key and my cap lock key.
What are most coders using to get to the end of a line?
It works like this: Home/End takes you to the beginning/end of a line, Ctrl+Home/End to the beginning/end of document.
Mac might be an exception: Command+Left/Right arrow to go to the beginning/end of the line. If that doesn't work, try using Fn or Fn+Command instead of Command in the previous shortcut.
I am new to Intellij Idea. I didn't find any information on how to wrap the code after certain characters (ex: 150 characters, break the line)
I want to break the code after the vertical line, the following code must come in next line.
Note: I used Reformat code option, but it did just realigned the code with some white spaces etc, but not wrapping up the code. It's difficult to see the end of the code.
You go to Settings (alt+ctrl+s) then select Code Style - General
Here you can configure your margins and if you want the code to wrap after it reaches the end of it
I was programming in PHP and typing mysql_connect, and by default the single-quotation is automatically closed, so I would have something like this mysql_connect('localhost[cursor is here]'). I still need to type my username and password, it just seems really out of the way to press the right arrow key to escape the single-quotations for writing the other arguments (username/password). Is there a hot key similar to ctrl+enter that can help move my cursor out of the quotations but not to the next line?
I often use Cmd-Right Arrow to move the the end of the line. I also make heavy use of Opt-Right Arrow and Opt-Left Arrow to move words at a time instead of characters.
My solution to this was to record my own macro; it moves the caret to the right, inserts a comma and then a space. I've mapped the macro to command and < (shift and comma). Activating the macro on your code results in:
mysql_connect('localhost', [cursor is here])