10

I use Sublime Text and this shortcut (Edit > Line > Swap Line Up/Swap Line Down) allows me to move lines of code up and down in the file while shifting everything around it. On my new computer this command moves the window currently in focus to the next space.

I checked the keyboard shortcuts in Preferences but could not find it. Where else can I find the shortcut and disable it so that I can use it in Sublime?

6

As an alternative solution for Sublime Text (if you want to keep the new OS key mappings) you can add the following lines to your user key bindings file (in menu Subline Text 2 > Preferences > Key Bindings - User):

{ "keys": ["super+shift+up"], "command": "swap_line_up" },
{ "keys": ["super+shift+down"], "command": "swap_line_down" }

This will map +Shift+ or to the Swap Line Up/Down commands.

A similar issue exists with the batch selection commands usually mapped to Ctrl+Shift+ or .

These can be remapped using the following settings:

{ "keys": ["ctrl+alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["ctrl+alt+shift+down"], "command": "select_lines", "args": {"forward": true} } 

This will map Ctrl+Alt+Shift+ or to the batch selection commands.

Obviously you can change the combinations to whatever you prefer, but these did not seem to be used for anything.

  • I gave up on trying to override the keyboard shortcut, it seems that they forgot to add the new ones in OSX Mavericks to the System Preferences. I ended up following your advice but did it slightly differently. – jaredsmith Dec 18 '13 at 22:08
5

Cmd+Ctrl with or is not actually mapped by Mac OS X, which is where the confusion is coming from.

It is likely a window manager like SizeUp that is overriding those shortcuts. You can disable the shortcut in the application's preferences.

  • 1
    OMG thanks for this comment. I've been suffering ever since Mavericks, thinking it was that but it was SizeUp! – Dominic Aug 13 '15 at 15:25
3

Try looking at System Preferences > Keyboard (It should be on the second row and third column of the window).

enter image description here

You can also go to search and type "Keyboard" in Spotlight.

enter image description here

When you have found it, go to the "Shortcuts" tab (it's on the third one from the left) and look for the shortcut there.

enter image description here

When you do, delete it from there and try using Siblime again.

  • 2
    He said that he checked the preferences and could not find the keyboard? – Pfitz Dec 6 '13 at 8:26
  • I have updated the answer with pictures of where to get the keyboard preferences. – chrisjr Dec 6 '13 at 16:34
  • @Junior117 thanks for the effort but as OP says the keyboard shortcut isn't there for these new ones – Dominic Aug 31 '14 at 21:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .