Repository: spyder-ide/spyder

Issue:
How do I move to a new line while I'm in the middle of the current line?
It was line:

```
C.append(35|)
...........|
.......----------
.......The cursor
```

At this point, I don't want to press the ")" and then press  the enter key to start a new line. 
I just want to start a new line and move the cursor there (like Ctrl + Enter in VS Code), how should I do (I mean a shortcut key is helpful)?

The best I can do was to keep an empty line at the end of the file, and "move" to the next line, but it doesn't solve the problem


Discussion:
I don't understand too well what you mean. Could you post a little video to see how things work in VSCode and Spyder? You can use Licecap for that.

Thanks!
Using VS Code:
![1](https://user-images.githubusercontent.com/12162979/31586379-9d1ee7d2-b202-11e7-859e-c3fc106f17b2.gif)

Using Spyder:
![2](https://user-images.githubusercontent.com/12162979/31586380-9d4e0238-b202-11e7-8b71-2a90ae5ec34f.gif)

Operation like VS Code could really save me a lot of trouble when typing in Spyder, thanks
I know that there is a shortcut for moving to next line in Spyder, but it just doesn't work when there is no empty line at the end of the editor, hope you know what I mean :)
In VS Code:
Ctrl + Enter to create a new line
![3](https://user-images.githubusercontent.com/12162979/31586436-901dd6f0-b203-11e7-9435-a34fe2f1515c.gif)

In Spyder:
Only move to the next line, didn't move if there is no "next line"
![4](https://user-images.githubusercontent.com/12162979/31586437-90562528-b203-11e7-99df-92bfa765f94e.gif)

So you want to create a new line below a given line, no matter where the cursor is placed?
Yes, and this is VERY helpful for me when editing the parameters
Thank you
Sorry, this is too specific and we don't have time to implement it. However, we're welcome to receive a pull request that does it.
I'm missing the feature as well. Found an easy solution on [Stackoverflow](https://stackoverflow.com/questions/28182566/how-to-add-new-line-keyboard-shortcuts-in-spyder) for anybody looking for a quick and dirty implementation. Keep in mind, that this can be overwritten while updating spyder.
When I get some time I'm going to put this into a pull request.

Resolving patch:
diff --git a/spyder/config/main.py b/spyder/config/main.py
--- a/spyder/config/main.py
+++ b/spyder/config/main.py
@@ -348,6 +348,7 @@
               'editor/unindent': 'Ctrl+[',
               'editor/move line up': "Alt+Up",
               'editor/move line down': "Alt+Down",
+              'editor/go to new line': "Ctrl+Shift+Return",
               'editor/go to definition': "Ctrl+G",
               'editor/toggle comment': "Ctrl+1",
               'editor/blockcomment': "Ctrl+4",
diff --git a/spyder/widgets/sourcecode/base.py b/spyder/widgets/sourcecode/base.py
--- a/spyder/widgets/sourcecode/base.py
+++ b/spyder/widgets/sourcecode/base.py
@@ -974,6 +974,11 @@ def move_line_down(self):
         """Move down current line or selected text"""
         self.__move_line_or_selection(after_current_line=True)
         
+    def go_to_new_line(self):
+        """Go to the end of the current line and create a new line"""
+        self.stdkey_end(False, False)
+        self.insert_text(self.get_line_separator())
+        
     def extend_selection_to_complete_lines(self):
         """Extend current selection to complete lines"""
         cursor = self.textCursor()
diff --git a/spyder/widgets/sourcecode/codeeditor.py b/spyder/widgets/sourcecode/codeeditor.py
--- a/spyder/widgets/sourcecode/codeeditor.py
+++ b/spyder/widgets/sourcecode/codeeditor.py
@@ -546,6 +546,8 @@ def create_shortcuts(self):
                                      name='Move line up', parent=self)
         movelinedown = config_shortcut(self.move_line_down, context='Editor',
                                        name='Move line down', parent=self)
+        gotonewline = config_shortcut(self.go_to_new_line, context='Editor',
+                                      name='Go to new line', parent=self)
         gotodef = config_shortcut(self.do_go_to_definition, context='Editor',
                                   name='Go to definition', parent=self)
         toggle_comment = config_shortcut(self.toggle_comment, context='Editor',
@@ -646,7 +648,7 @@ def cursor_move_event():
                                       name='enter array table', parent=self)
 
         return [codecomp, duplicate_line, copyline, deleteline, movelineup,
-                movelinedown, gotodef, toggle_comment, blockcomment,
+                movelinedown, gotonewline, gotodef, toggle_comment, blockcomment,
                 unblockcomment, transform_uppercase, transform_lowercase, 
                 line_start, line_end, prev_line, next_line,
                 prev_char, next_char, prev_word, next_word, kill_line_end,


Test patch: