Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Sublime Text Cheat Sheet
- ##### *Jeff Miller, 22 January 2013*
- ### Useful URLs
- * [Latest developer builds](http://www.sublimetext.com/dev)
- * [Official documentation](http://www.sublimetext.com/docs/2/)
- * [Unofficial documentation](http://docs.sublimetext.info/en/latest/)
- * [Code Folding tutorial](http://wesbos.com/sublime-text-code-folding)
- * [Package Control packages](http://wbond.net/sublime_packages/community)
- * [Default Color Schemes](http://d.hatena.ne.jp/pmekyky385/20121207/1354982155)
- ### Command Palette
- * Open Palette: Ctrl+Shift+P (Tools > Command Palette...)
- ### Goto Anything
- * Go to file: Ctrl+P (Goto > Goto Anything...)
- * Go to symbol: Ctrl+P, "@symbol" (Ctrl+R, Goto > Goto Symbol...)
- * Go to line number: Ctrl+P, ":#" for line (Ctrl+G, Goto > Goto Line...)
- * Go to word: Ctrl+P, "#word" (Ctrl+;)
- ### Editing
- * Insert line after: Ctrl+Enter
- * Insert line before: Ctrl+Shift+Enter
- * Repeat last keyboard command: Ctrl+Y (Edit > Repeat)
- * Transpose: Ctrl+T (Edit > Text > Transpose)
- * (Un)Comment current line: Ctrl+/ (Edit > Comment > Toggle Comment)
- * Block (un)comment current selection Ctrl+Shift+/ (Edit > Comment > Toggle Block Comment)
- * Paste and indent correctly: Ctrl+Shift+V (Edit > Paste and Indent)
- * Uppercase: Ctrl+K, Ctrl+U (Edit > Convert Case > Upper Case)
- * Lowercase: Ctrl+K, Ctrl+L (Edit > Convert Case > Lower Case)
- ### Line Operations
- * Indent current line(s): Ctrl+] (Edit > Line > Indent)
- * Unindent current line(s): Ctrl+[ (Edit > Line > Unindent)
- * Move line/selection up: Ctrl+Shift+Up (Edit > Line > Swap Line Up)
- * Move line/selection down: Ctrl+Shift+Down (Edit > Line > Swap Line Down)
- * Duplicate lines: Ctrl+Shift+D (Edit > Line > Duplicate Line)
- * Join lines: Ctrl+J (Edit > Line > Join Lines)
- ### Deleting
- * Delete word forwards: Ctrl+Del
- * Delete word backwards: Ctrl+Backspace
- * Delete line: Ctrl+Shift+K (Edit > Line > Delete)
- * Delete from cursor to end of line: Ctrl+K, Ctrl+K
- * Delete from cursor to start of line: Ctrl+K, Ctrl+Backspace
- ### Selection (can Be Repeated Multiple Times)
- * Select line: Ctrl+L (Selection > Expand Selection to Line)
- * Select word: Ctrl+D (Selection > Expand Selection to Word); Skip selection: Ctrl+K, Ctrl+D; Undo last selection: Ctrl+U
- * Select scope: Ctrl+Shift+Space (Selection > Expand Selection to Scope)
- * Select brackets: Ctrl+Shift+M (Selection > Expand Selection to Brackets)
- * Select indentation: Ctrl+Shift+J (Selection > Expand Selection to Indentation)
- * Select tag: Ctrl+Shift+A (Selection > Expand Selection to Tag)
- * Scroll to selection: Ctrl+K, Ctrl+C (Goto > Scroll > Scroll to Selection)
- ### Navigation
- * Jump to matching bracket: Ctrl+M (Goto > Jump to Matching Bracket)
- * Jump to your last change (repeat to undo change): Ctrl+U (Edit > Undo Selection > Undo)
- ### Bookmarks
- * Toggle bookmark: Ctrl+F2 (Goto > Bookmarks > Toggle Bookmark)
- * Next bookmark: F2 (Goto > Bookmarks > Next Bookmark)
- * Previous bookmark: Shift+F2 (Goto > Bookmarks > Previous Bookmark)
- * Select all bookmarks: Alt+F2 (Goto > Bookmarks > Select all Bookmarks)
- ### Find/replace
- * Find: Ctrl+F (Find > Find...)
- * Find Next: F3 (Find > Find Next)
- * Find Previous: Shift+F3 (Find > Find Previous)
- * Replace: Ctrl+H (Find > Replace...)
- * Find in files (Navigate using F4, Shift+F4): Ctrl+Shift+F (Find > Find in Files...)
- ### Code Folding:
- * Fold: Ctrl+Shift+[ (Edit > Code Folding > Fold)
- * Unfold: Ctrl+Shift+] (Edit > Code Folding > Unfold)
- * Unfold all: Ctrl+K,Ctrl+J (Edit > Code Folding > Unfold All)
- * Fold attributes: Ctrl+K,Ctrl+T (Edit > Code Folding > Fold Tag Attributes)
- ### Macros
- * Record: Ctrl+Q (Tools > Record Macro)
- * Playback: Ctrl+Shift+Q (Tools > Playback Macro)
- ### Tabs
- * Previous tab: Ctrl+PgUp (Goto > Switch File > Previous File)
- * Next tab: Ctrl+PgDown (Goto > Switch File > Next File)
- * Switch to tab number: Alt+number (Goto > Switch File > ...)
- ### Split Layout
- * Set single layout: Alt+Shift+1 (View > Layout > Single)
- * Set # columns: Alt+Shift+2,3,4 (View > Layout > Columns)
- * Set 2 or 3 rows: Alt+Shift+8,9 (View > Layout > Rows)
- * Set 2x2 grid: Alt+Shift+5 (View > Layout > Grid)
- * Move to group #: Ctrl+# (View > Focus Group)
- * Move file to group #: Ctrl+Shift+# (View > Move file to Group)
- ### Organization
- * Toggle side bar: Ctrl+K, Ctrl+B (View > Side Bar > Hide Side Bar)
- * Distraction free: Shift+F11 (View > Enter Distraction Free Mode)
- * Enable spell-check (Navigate using Ctrl+F6, Ctrl+Shift+F6): F6 (View > Spell Check)
- ### Multiple Cursors
- * Press Ctrl then click in each region
- * Ctrl+Shift+L (Selection > Split into Lines)
- * Highlight word, press Ctrl+D (Selection > Expand Selection to Word) repeatedly to select additional occurrences of that word.
- * Add cursor at all occurrences of a word with Alt+F3 (Find > Quick Find All)
- * Add new line with cursor: Ctrl+Alt+Up, Ctrl+Alt+Down (Selection > Add Previous Line)
- * Return to single selection: Esc (Selection > Single Selection)
- * You can select a rectangular selection by using Shift, then holding the right mouse button and dragging over the area you wish to select. You can remove part of the selection using Shift+Alt.
- ### Marking
- * Set mark: Ctrl+K, Ctrl+Space (Edit > Mark > Set Mark)
- * Select to mark: Ctrl+K, Ctrl+A (Edit > Mark > Select to Mark)
- * Delete to mark: Ctrl+K, Ctrl+W (Edit > Mark > Delete to Mark)
- * Switch location with mark: Ctrl+K, Ctrl+X (Edit > Mark > Swap with Mark)
- * Clear Mark: Ctrl+K Ctrl+G (Edit > Mark > Clear Mark)
- ### Projects
- * Switch Project: Ctrl+Alt+P (Project > Switch Project in Window...)
- * Select root folder: Project > Add Folder to Project...
- * Save: Project > Save Project As... (.sublime-project file)
- ### Miscellaneous
- * Show scope in status bar: Ctrl+Alt+Shift+P
- * Re-indent Lines: Edit > Line > Reindent
- * Close Tag: Alt+.
- * Reopen Closed File: Ctrl+Shift+T (File > Open Recent... > Reopen Closed File)
- * See Key Bindings: Preferences > Key Bindings - Default
- * TextMate Theme Compatible: [Themes Bundle](http://www.webgeekshub.com/webGeekDownloads/TextMate-Themes%20Bundle.zip) (extract to "%AppData%\Sublime Text 2\Packages")
- * A list of all installed packages is in "%AppData%\Sublime Text 2\Packages\User\Package Control.sublime-settings" (see "installed_packages")
- ### Command Line Script
- Save as "subl.cmd" in your path, and run it. Supports wildcards.
- @ECHO OFF
- REM 2012-12-30 Jeff Miller
- SETLOCAL
- CALL :GetStPath
- IF "%StPath%"=="" ( ECHO Can't find Sublime Text & GOTO :EOF )
- PATH %StPath%;%PATH%
- set LIST=
- :NEXTARG
- IF "%~1"=="" GOTO :START
- FOR %%i IN (%1) DO CALL :ADDARG "%%~fi"
- SHIFT
- GOTO :NEXTARG
- :ADDARG
- SET LIST=%LIST% %1
- GOTO :EOF
- :START
- START "Sublime Text" sublime_text.exe --add %LIST%
- GOTO :EOF
- :GetStPath
- SETLOCAL
- FOR /F "skip=2 delims=" %%f IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sublime Text 2_is1" /v InstallLocation') DO SET P=%%f
- ENDLOCAL & SET StPath=%p:~33%
- GOTO :EOF
- ### My User Settings
- Install “Theme - Nexus” and [“DejaVu” fonts](http://dejavu-fonts.org/wiki/Download)
- **Preferences > Settings - User :**
- {
- "bold_folder_labels": true,
- "caret_style": "phase",
- "color_scheme": "Packages/Theme - Nexus/Nexus.tmTheme",
- "detect_indentation": false,
- "draw_minimap_border": false,
- "ensure_newline_at_eof_on_save": true,
- "fade_fold_buttons": false,
- "font_face": "DejaVu Sans Mono",
- "font_options": [
- "directwrite"
- ],
- "font_size": 10,
- "highlight_line": true,
- "highlight_modified_tabs": true,
- "hot_exit": false,
- "ignored_packages": [
- "Vintage",
- "ZenCoding"
- ],
- "line_numbers": false,
- "line_padding_bottom": 1,
- "line_padding_top": 1,
- "rulers": [
- 80,
- 120
- ],
- "spell_check": true,
- "tab_size": 4,
- "theme": "Nexus.sublime-theme",
- "translate_tabs_to_spaces": true,
- "trim_trailing_white_space_on_save": true,
- "use_tab_stops": true
- }
- ## PACKAGES I USE
- ### [AdvancedNewFile](https://github.com/skuroda/Sublime-AdvancedNewFile)
- *File Creation Plugin.*
- * Ctrl+Alt+N [conflicts with "Sublime Files"]
- **Preferences > Package Settings > AdvancedNewFile > Settings - User :**
- {
- "alias": {
- "desktop": "C:/Users/jeff/Desktop/",
- "temp": "C:/Users/jeff/AppData/Local/Temp"
- }
- }
- ### [Automatic Backups](https://github.com/joelpt/sublimetext-automatic-backups)
- *Automatically Save Off A Backup Of Your Files Each Time You Save A File.*
- * Backwards in history: Ctrl+Alt+[
- * Forwards in history: Ctrl+Alt+]
- * Merge from backup history: Ctrl+Alt+Shift+M
- **Preferences > Package Settings > Automatic Backups > Settings - User :**
- {
- "backup_dir": "D:/Backups",
- "backup_merge_command": "C:/Program Files (x86)/Beyond Compare 2/BC2.exe \"{oldfilepath}\" \"{curfilepath}\""
- }
- ### [BracketHighlighter](https://github.com/facelessuser/BracketHighlighter)
- *Bracket And Tag Highlighter.*
- **Preferences > Package Settings > Bracket Highlighter > Settings - User :**
- {
- "angle_style": "outline",
- "curly_style": "outline",
- "quote_style": "outline",
- "round_style": "outline",
- "square_style": "outline",
- "tag_style": "outline"
- }
- ### [BufferScroll](https://github.com/SublimeText/BufferScroll)
- *Remember, restore and sync scroll, bookmarks, marks, folds and cursors.*
- ### [Clipboard History](https://github.com/kemayo/sublime-text-2-clipboard-history)
- *Keep a history of your clipboard items.*
- * Show History: Ctrl+Alt+V
- * Paste Previous History Entry: Ctrl+Shift+V
- * Paste Newer History Entry: Ctrl+Shift+Alt+V
- ### [CTags](https://github.com/SublimeText/CTags)
- *CTags Support.*
- * Find > CTags
- * Rebuild Tags: Ctrl+T, Ctrl+R
- * Navigate to Definition: Ctrl+Shift+.
- * Jump Back: Ctrl+Shift+,
- * Show Tags: Alt+S
- * Show All Tags: Alt+Shift+S
- ### [DocBlockr](https://github.com/spadgos/sublime-jsdocs)
- *Make Writing Documentation A Breeze. Supports Javascript, Php, Actionscript, Coffeescript, Java, Objective C, C And C++.*
- * `/**`< Enter >
- * `/*` < Enter >
- * `/**`< Enter >`function foobar (baz, quux) { }` - where function (or variable definition) already exists. Shift-Enter will place the definition inline.
- * Decorate comment: `// foo!`< Ctrl+Enter >
- ### [Emmet](https://github.com/sergeche/emmet-sublime)
- *Emmet (previously Called Zen Coding).*
- * [Documentation](http://docs.emmet.io/)
- * `div#page.section`< Tab > becomes `<div id="page" class="section"></div>`
- * `div[title="Hello"]`< Tab > becomes `<div title="Hello"></div>`
- * `li.item$*3`< Tab > becomes `<li class="item#"></li>` (3 times)
- * `p>{Click }+a{here}+{ to continue}`< Tab > becomes `<p>Click <a href="">here</a> to continue</p>`
- * `div#page>(div#header>ul#nav>li*4>a{Item $})+(div#page>(h1>span)+p*2)+div#footer`< Tab >
- ### [FileDiffs](https://github.com/spape/SublimeFileDiffs)
- *Shows Diffs Between The Current File, Or Selection(s) In The Current File, And Clipboard, Another File, Or Unsaved Changes.*
- **Preferences > Package Settings > FileDiffs > Settings - Default :**
- For [Beyond Compare 2](http://scootersoftware.com):
- {
- "cmd": [
- "C:/Program Files (x86)/Beyond Compare 2/BC2.exe",
- "$file1",
- "$file2"
- ],
- "open_in_sublime": false
- }
- ### [FindKeyConflicts](https://github.com/skuroda/FindKeyConflicts)
- Assist In Finding Key Conflicts Between Various Plugins.
- * Ctrl+Shift+P, FindKeyConflicts
- ### [GenerateUUID](https://github.com/SublimeText/GenerateUUID)
- Generate Uuid.
- * Generate UUID: Ctrl+Shift+U
- ### [Git](https://github.com/kemayo/sublime-text-2-git)
- Git Integration.
- * [Wiki](https://github.com/kemayo/sublime-text-2-git/wiki)
- * Install [Git](http://git-scm.com/download/win) using “Run Git from the Windows Command Prompt”
- * Tools > Git
- ### [HexViewer](https://github.com/facelessuser/HexViewer)
- *Allows The Toggling Of A File Into A Hex Viewing Mode.*
- * Tools > Packages > Hex Viewer
- * NOTE: Shortcuts conflict with "build"
- * Toggle hex editor mode: Ctrl+Shift+B, Ctrl+Shift+H
- * Show hex inspector: Ctrl+Shift+B, Ctrl+Shift+I
- **Preferences > Package Settings > Hex Viewer > Settings - User :**
- {
- "auto_open": true,
- "auto_open_patterns": [
- "*.bin",
- "*.dll",
- "*.ico",
- "*.lib",
- "*.pyc",
- "*.exe",
- "*.res"
- ],
- "bytes_per_line": 16,
- "custom_font": "Consolas",
- "custom_font_size": 12,
- "group_bytes_by_bits": 8,
- "inspector": false
- }
- ### [HighlightWords](https://github.com/seanliang/HighlightWords)
- *Highlight mutiple words in different colors.*
- * Highlight Words: Ctrl+Alt+H (Edit > Highlight Words > Highlight Words)
- * Unhighlight Words: Ctrl+Alt+U (Edit > Highlight Words > Unhighlight Words)
- ### [HTML5](https://github.com/mrmartineau/HTML5)
- *HTML5 bundle.*
- ### [INI](https://github.com/clintberry/sublime-text-2-ini)
- *INI Syntax Highlighting.*
- ### [Markdown Preview](https://github.com/revolunet/sublimetext-markdown-preview)
- *Preview Your Markdown Files Quickly In Your Web Browser.*
- * Ctrl+Shift+P, Markdown Preview
- ### [Open URL](https://github.com/noahcoad/open-url)
- *Open URLs, Files, Folders, Or Google Text Under The Cursor Or In Selected Text.*
- * Open URL: Ctrl+U
- ### [Package Control](http://wbond.net/sublime_packages/package_control/installation)
- *A Full-featured Package Manager That Helps Discovering, Installing, Updating And Removing Packages.*
- Ctrl+` then paste:
- import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'
- * Ctrl+Shift+P, Install Package (Preferences > Package Control)
- ### [PlainTasks](https://github.com/aziz/PlainTasks)
- *An opinionated todo-list plugin*
- * Tutorial: Preferences > Package Settings > PlainTasks > Tutorial
- * Create list: Ctrl+Shift+P, Tasks: New document
- * New Task: Ctrl+Enter (or Ctrl+I)
- * Task Complete (toggle): Ctrl+D
- ### [PowerShell](https://github.com/SublimeText/PowerShell)
- *Support For The Ms PowerShell 2 Programming Language.*
- ### [Prefixr](http://wbond.net/sublime_packages/prefixr)
- *Run CSS Through The Prefixr API.*
- * Prefixr: Ctrl+Alt+X
- ### [Pretty JSON](https://github.com/dzhibas/SublimePrettyJson)
- Prettify JSON.
- * Prettify: Ctrl+Alt+J
- **Preferences > Package Settings > Pretty JSON > Settings - User :**
- {
- "ensure_ascii": true,
- "indent": 4,
- "sort_keys": true,
- "use_entire_file_if_no_selection": true
- }
- ### [SideBarEnhancements](https://github.com/titoBouzout/SideBarEnhancements)
- *Provides Enhancements To The Operations On Side Bar Of Files And Folders.*
- * Open current file in browser: F12 (NOTE: doesn’t support IE)
- ### [Sublime-HTMLPrettify](https://github.com/victorporof/Sublime-HTMLPrettify)
- *Html, Css And Javascript Code Formatter.*
- * Requires [Node.js](http://nodejs.org)
- * Prettify: Ctrl+Shift+P, htmlprettify
- ### [SublimeCodeIntel](https://github.com/Kronuz/SublimeCodeIntel)
- *Code Intelligence Plugin For Php, Python, Rhtml, Javascript, Smarty, Mason, Node.js, Xbl, Tcl, Html, Html5, Templatetoolkit, Xul, Django, Perl, Ruby, Python3.*
- * Jump to Symbol: Ctrl+F3 (or Alt+Click)
- * Manual autocomplete: Ctrl+J [NOTE: conflicts with “Join Lines”]
- ### [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter)
- *Highlights Lines Of Code The Linter Deems To Contain (potential) Errors.*
- * CSS, JS requires [Node.js](http://nodejs.org)
- * C++ requires [cppcheck](http://cppcheck.sourceforge.net/)
- * Note that C++ filters [can’t be modified](https://github.com/SublimeLinter/SublimeLinter/issues/300)
- * HTML requires [tidy](https://github.com/w3c/tidy-html5)
- * Lint: Ctrl+Alt+L
- * Next/Previous Error: Ctrl+Alt+E, Ctrl+Alt+Shift+E
- **Preferences > Package Settings > SublimeLinter > Settings - User :**
- {
- "sublimelinter": "load-save",
- "sublimelinter_executable_map": {
- "c": "C:/Program Files/cppcheck/cppcheck.exe",
- "css": "C:/Program Files/nodejs/node.exe",
- "javascript": "C:/Program Files/nodejs/node.exe"
- },
- "sublimelinter_gutter_marks": true,
- "sublimelinter_popup_errors_on_save": true
- }
- ### [Tag](https://github.com/SublimeText/Tag)
- *Collection Of Packages About Tags.*
- * Edit > Tag
- * Put matching closing tag: Alt+.
- ### [Theme - Nexus](https://github.com/EleazarCrusader/nexus-theme)
- *Dark Custom Ui Theme.*
- ### [Open URL](https://github.com/noahcoad/open-url)
- *Open URLs, files, folders, or google text under the cursor or in selected text.*
- * Open highlighted URL: Ctrl+U
- ### [VBScript](https://github.com/SublimeText/VBScript)
- VBScript Package.
Add Comment
Please, Sign In to add comment