Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can try with a plugin: <code>Tools/New Plugin...</code></p> <pre class="lang-py prettyprint-override"><code>import sublime_plugin class ExpandSelectionToOtherLinesCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().run_command("expand_selection", {"to": "line"}) start_region = self.view.sel()[0] self.view.window().run_command("select_all") self.view.sel().subtract(start_region) </code></pre> <p>Save this file in your <code>Packages/User</code>.</p> <p>Then, add the key binding for that plugin:</p> <pre><code>{ "keys": ["super+alt+l"], "command": "expand_selection_to_other_lines" } </code></pre> <p>This command will select all other lines. When you have other lines selected, you can use <code>Split selection into lines</code> command (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>L</kbd>, <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>L</kbd> on Mac).</p> <p>If you want to have everythnig in a single shortcut, you can modify the plugin like this:</p> <pre class="lang-py prettyprint-override"><code>import sublime_plugin class ExpandSelectionToOtherLinesCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().run_command("expand_selection", {"to": "line"}) start_region = self.view.sel()[0] self.view.window().run_command("select_all") self.view.sel().subtract(start_region) self.view.window().run_command("split_selection_into_lines") self.view.window().run_command("move", {"by": "characters", "forward": False}) </code></pre> <p>The last line is only to remove selection, leaving multiple cursors at the beginning of selected lines.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload