user234932
user234932

Reputation:

SublimeText2: how to join lines using shortcuts

In Vim and Vintage mode for SublimeText2, I can use Shift+J to join selected lines together. How does this work in vanilla SublimeText2 without Vintage using a shortcut?

I've looked at key bindings and I can see that there is a mapping for join_lines command:

    { "keys": ["ctrl+j"], "command": "join_lines" },

However, pressing the combination doesn't do anything, and menu item doesn't show the shortcut. What is the right way to map this shortcut and is there another shortcut that I might have missed?

EDIT

To clarify what I am trying to do, I am trying to get something like this:

if (condition) {
    return;
}

to be joined like this:

if (condition) { return; }

(with or without spaces around return;.)

EDIT2

Not sure if this matters, but this is SublimeText2 on Linux.

Upvotes: 1

Views: 174

Answers (2)

user234932
user234932

Reputation:

I will answer my own question here, but it's just a workaround. Not sure if it's the correct way to do it.

I've copied the binding in the question to the user bindings file, and it works.

Upvotes: 0

ian
ian

Reputation: 168

When you're on a line, in standard mode, hit ctrl-j (cmd-j os OSX) to join the line below to the current line.

Upvotes: 1

Related Questions