PhpStorm shortcut for line breaks - line

Is there a shortcut in PhpStorm for making line breaks?
For example in my previous IDE (Zend studio 5.5) when i'm writing a line and press ctrl+Enter it adds line break tag to the end of the current line and starts new line.
## At the end of first line i use shortcut to add line break at the end and start new line
This is first line <br />
This is new line

Related

Intellij shortuct to create a line between two lines?

Say I have two lines
line 39: foo
line 40: bar
My cursor is one line 39, and I want to write some stuff right below, moving the content of line 40 to line 41, like so:
line 39: foo
line 40: <cursor...>
line 41 bar
So: Given that I'm initially on line 39, how do I move my cursor down to line 40, shifting everything on line 40 and beyond to one line below?
The manual way is to drag my cursor all the way the end of line 30, hit enter. But if line 30 is a big line, it takes time to do this.
There are numerous ways to achieve this (from obvious End then Enter combo to IdeaVim's o), but the Intellij's way to do it would be Shift + Enter hotkey.
The shortcut is called Start New Line in Editor's Action keymap and can be changed to your preference.
Please use Shift+Enter .
Check https://www.jetbrains.com/help/idea/working-with-source-code.html#editor_lines_code_blocks

VB.NET - Appending text to the last line of text file leaves (sometimes) an empty line

The intention of the software I am coding is to append a string to the last line of a text file. The problem I am experiencing is that depending on the situation, sometimes I get an empty line when I try to append text to the last line of a text file.
My text file is very simple. It contains a few lines of text and each line contains a few words. When I open the text file with Windows' Notepad (without editing the content of the text file) and I move the caret to the end of the entire file, sometimes the caret is positioned at the end of the last line with content (text), and sometimes it is positioned at an empty line that doesn't contain even a white space.
When the caret's ending position corresponds to the last char of a line that contains text, I don't experience any problem appending some text programmatically. The programmatically appended line is at a new line and there isn't any empty line between the old last line and the current last line in the text file.
The problem appears when I can move the caret in the text file to the last possible position and that position corresponds to an empty line. In that case, when I try to append a new line programmatically, I can see an empty line before the just added line.
I have tried different codes and techniques, but it always happens the same to me.
The code I am actually using is:
If stringLastLine.Length = 0 Then
Using sw As StreamWriter = New System.IO.StreamWriter(filePath, True)
sw.Write("Inserted text")
sw.Close()
End Using
ElseIf stringLastLine.Length > 0 Then
Using sw As StreamWriter = New System.IO.StreamWriter(filePath, True)
sw.Write(Environment.NewLine & "Inserted text")
sw.Close()
End Using
End If
Basically, I am trying to detect if the last line length is over zero, so it's a line with text content and I will use "environment.newline + string". If it's a line without content (length = 0) I add directly the string without using "environment.newline". In the case that length = 0 I always get an empty line in between.
Any idea to solve this problem?
How about trimming your text to ensure there's no end of line characters at the end (the whole text)? Right now you might have an issue with multiple blank lines:
text = text.TrimEnd({Convert.ToChar(10), Convert.ToChar(13)})
This handles the EOL characters.

Editor config new line at start of file

Editor config has an option to insert blank lines at the end of the file. Is there something similar which allows for blank lines at the start of the file, ignoring shebang lines?

TextMate: how to highlight the entire line to copy and paste?

I find the control+a and control+e hard to press, and for some reason control+shift+e doesn't seem to highlight the entire line.
I want to copy the line into my clipboard. How do I do this?
To highlight a line in TextMate, Shift+Command+L is what you want.
Command-LeftArrow Shift-DownArrow is one way
Triple-click, then hit ⌘+C to copy.
cmd-leftArrow # to get cursor to beginning of line
shift-cmd-rightArrow # to highlight entire line
cmd-c # copy the line to clipboard
If you want to duplicate a line you can use this shortcut:
Cmd + left arrow to go at the beginning of the line
Ctrl + Shift + D to duplicate the entire line below the one you want to duplicate
Duplicate Line / Selection (⌃⇧D) — this will duplicate the current line, leaving the caret in the same column on the new line, or if there is a selection, duplicate that.
Source: textMate official website
PERSONAL WARNING:
Selecting a word, or whatever, and apply this shortcut will duplicate next to the original one. Not below.
TIPS
If you want to move your new duplicated line or whatever:
Ctrl + Cmd + arrow up will move up
Ctrl + Cmd + arrow down will move down
Happy coding 🖖

Line breaks in WMD editor

Does anyone have any suggestions on how to handle line breaks with a WMD editor?
When a user hits enter in the textarea I want it to equate to a line break in the html.
Thanks...
A single empty line will move your text to a new line. Is this what you mean?