Enter key to move cursor to the end of line?

Is there a way to do that?

I don't find anything in the settings for Smart Key or whatever.

 

what I meant is..

 

var www = "Some String|"

my cursor is currently on the far right, i want to be able to type "Enter" and cursor goes to the right of the double quote, instead of registering a new line

var www= "Some String"|

3 comments

Hi there,

Such key is called "End".

You can assign any unused shortcut to "Move Caret to Line End" action in "Settings/Preferences | Keymap".

P.S. You can use Ctrl+Shift+Enter to complete your statement (in your case it will place caret at the end of line and will add ";" there) -- action called "Complete Current Statement" and shortcut can be checked/changed in a same way as described earlier.

6

@andriy Is there any way to do that with the "Enter" key conditionally when i am inside a statement?

0

>Is there any way to do that with the "Enter" key conditionally when i am inside a statement?

To do what exactly?

  • "Ctrl+Shift+Enter" works anywhere in the line/statement.
  • "Enter" will always do what Enter normally does -- will place line break and move caret to new line -- I do not see how Enter alone can change it's behaviour here.

As I have said earlier -- you can assign another shortcut to "Move Caret to Line End" action (e.g. Alt+Enter .. or Ctrl+Enter .. or Shift+Enter etc) if you so desire and cannot (or do not want) to use End key for that..

 

On related note: the closest alternative I can think of would be how Eclipse does escaping from quotes/bracket/paren .. but it's not implemented in IDEA-based IDEs (and pretty unlikely to be any time soon) -- https://youtrack.jetbrains.com/issue/IDEABKL-6984

3

Please sign in to leave a comment.