serkanyersen
3/26/2012 - 6:33 PM

sublime: os x keymap

sublime: os x keymap

[
     /* Mac os x does not use home / end keys like windows. These keys fixes this behavior */
     // Move selection to beggining of the line, windows style
     { "keys": ["shift+home"], "command": "move_to", "args": {"extend":true, "to": "bol"}},
     // Move selection to end of the line, windows style
     { "keys": ["shift+end"], "command": "move_to", "args": {"extend":true, "to": "eol"}},
     // Move cursor to beggining of the line, windows style
     { "keys": ["home"], "command": "move_to", "args": {"to": "bol"}},
     // Move cursor to end of the line, windows style
     { "keys": ["end"], "command": "move_to", "args": {"to": "eol"}},

     /* Eclipse keys */
     // Go to anything menu
     { "keys": ["super+t"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
     // Shift+Enter to add a new line without going to end of the line
     { "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} },
     // Move lines up and down
     { "keys": ["alt+up"], "command": "swap_line_up" },
     { "keys": ["alt+down"], "command": "swap_line_down" },
     // Close all tabs without closing sublime
     { "keys": ["shift+super+w"], "command": "close_all" },
     // Change selected texts case
     { "keys": ["shift+super+y"], "command": "lower_case" },
     { "keys": ["shift+super+x"], "command": "upper_case" },
     // You don't actually need this but if you are used to use this in eclipse it will be good.
     { "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
     // Deleted current line
     { "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
     // Command palette should be easily accessible
     { "keys": ["super+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },

     /* You may or may not want these */
     // { "keys": ["super+alt+j"], "command": "join_lines" },
     // { "keys": ["super+alt+down"], "command": "duplicate_line" },
     
     
     /* Find commands */
     // Search / Replace manu is way more usable then just search
     { "keys": ["super+f"], "command": "show_panel", "args": {"panel": "replace"} },
     // I cannot use super+k because a lot of sublime keys already uses it. but alt+ will just do
     // Lets you immediatelly start searching kurrent word, continuously 
     // It's not exactly the same with eclipse because in eclipse you will simply go on 
     // finding last searched word if nothing else is selected, instead sublime will just 
     // automatically select current word
     { "keys": ["alt+k"], "command": "find_under" },
     // This does the same but also creates a cursor on the next instance so you can edit them all at once
     { "keys": ["alt+g"], "command": "find_under_expand" },

     /* Incredibly usefull comments shortcuts */
     { "keys": ["super+7"], "command": "toggle_comment", "args": { "block": false } },
     { "keys": ["super+8"], "command": "toggle_comment", "args": { "block": true } }
]