Sublime Text 2 Cheat Sheet

Todd Murchison edited this page Jan 30, 2016 · 13 revisions

Basics

keyboard shortcut explanation
cmd + s save
cmd + w close
cmd + shift + t re-open last closed file
cmd + f find
cmd + opt + f find and replace
cmd + shift + f find and replace across multiple files/projects
cmd + i incremental find

Navigation

keyboard shortcut explanation
cmd + opt + (arrows) move between tabs
cntl + tab cycle through tabs
cmd + (no.) move to tab number
cmd + p goto anything (#txt - fuzzy search / :50 - goto line no. / @)
cmd + cntl + p project menu/history
cmd + shift + p command palette

View

keyboard shortcut explanation
cmd + alt + 2 split window (columns)
cmd + alt + shift + 2 split window (rows)
cmd + alt +1 single window
cntl + (no.) navigate between windows

Code

keyboard shortcut explanation
cmd + ] indent
cmd + [
cntl + m jump between curly braces
opt + (arrows) move through text one word at a time
opt + shift + (arrows) highlight text one word at a time
cmd + d select a word
cmd + l select a line
cmd + shift + j select indentation
cmd + cntl + (up/down) move line up/down through the file
cmd + k skip
cmd + u undo
cntl + spacebar autocomplete
hold cmd + (select/drag)

Settings

User preferences example (Preferences ==> Settings - User):

{
    "auto_complete_commit_on_tab": true,
    "font_size": 14,
    "margin": 2,
    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "ignored_packages":[],
    "vintage_start_in_command_mode": false
}

:notebook: Note: "Vintage mode" = vim emulator ==> ignored_packages":[]

Project specific settings:

edit project-name.sublime-project

{
    "folders":
    [
        {
            "path": "/Users/Dude/project-name"
        }
    ],
    "settings":
    {
        "tab_size": 4,
        "etc": "..."
    }
}

Running Sublime from the Mac OS command-line:

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
subl --help

References