Created
January 17, 2013 06:50
-
-
Save ollar/4554215 to your computer and use it in GitHub Desktop.
sublime hot keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sublime Text 2 Tips | |
Useful URLs | |
http://www.sublimetext.com/dev | |
http://docs.sublimetext.info/en/latest | |
http://wesbos.com/sublime-text-code-folding | |
http://benmccormick.org/blog/2013/01/01/sublime-text-for-javascript-configuration/ | |
Command 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 (selection operations can be repeated multiple times) | |
Select line: Ctrl+L (Selection > Expand Selection to Line) | |
Select word: Ctrl+D (Selection > Expand Selection to Word) | |
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) | |
Skip selection: Ctrl+K, Ctrl+D | |
Scroll to selection: Ctrl+K, Ctrl+C (Goto > Scroll > Scroll to Selection) | |
Navigation | |
Jump to closing parenthesis (repeat to go to opening): 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 add or remove part of the selection using Alt (Remove from selection) and | |
??? (Add to selection) and using the same technique. | |
Mark | |
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 | |
Reindent 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 | |
http://textmatetheme.com/ | |
http://www.webgeekshub.com/webGeekDownloads/TextMate-Themes%20Bundle.zip | |
(extract zip to "%AppData%\Sublime Text 2\Packages") | |
User-Settings (Preferences > Settings - User) | |
CODE: SELECT ALL | |
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Color Scheme - Default/Zenburnesque.tmTheme", | |
"draw_minimap_border": false, | |
"font_face": "Consolas", | |
"font_options": ["directwrite"], | |
"font_size": 11, | |
"highlight_line": true, | |
"highlight_modified_tabs": true, | |
"hot_exit": false, | |
"ignored_packages": ["Vintage", "ZenCoding"], | |
"line_numbers": false, | |
"rulers": [80, 120], | |
"spell_check": true, | |
"theme": "Soda Dark.sublime-theme", | |
"trim_trailing_white_space_on_save": true, | |
"detect_indentation": false, | |
"tab_size": 4, | |
"translate_tabs_to_spaces": true, | |
"use_tab_stops": true | |
} | |
Packages | |
Package Control: http://wbond.net/sublime_packages/packa ... stallation | |
Ctrl+Alt+P (Preferences > Package Control) | |
AdvancedNewFile: https://github.com/skuroda/Sublime-AdvancedNewFile | |
Ctrl+Alt+N [conflicts with "Sublime Files"] | |
Alignment: http://wbond.net/sublime_packages/alignment | |
Align selected lines: Ctrl+Alt+A | |
Automatic Backups: https://github.com/joelpt/sublimetext-automatic-backups | |
Preferences > Package Settings > Automatic Backups > Settings - User | |
CODE: SELECT ALL | |
{ | |
"backup_dir": "D:/Backups", | |
"backup_merge_command": "C:/Program Files (x86)/Beyond Compare 2/BC2.exe \"{oldfilepath}\" \"{curfilepath}\"" | |
} | |
Backwards in history: Ctrl+Alt+[ | |
Forwards in history: Ctrl+Alt+] | |
Merge from backup history: Ctrl+Alt+Shift+M | |
CTags: https://github.com/SublimeText/CTags (Find > CTags) | |
DocBlockr: https://github.com/spadgos/sublime-jsdocs | |
FileDiffs | |
FindKeyConflicts: https://github.com/skuroda/FindKeyConflicts | |
Ctrl+Shift+P, FindKeyConflicts | |
Git: https://github.com/kemayo/sublime-text-2-git (Tools > Git) | |
HexViewer: https://github.com/facelessuser/HexViewer | |
[Shortcuts conflict with "build"] | |
Toggle hex editor mode: Ctrl+Shift+B, Ctrl+Shift+H | |
Show hex inspector: Ctrl+Shift+B, Ctrl+Shift+I | |
Hex finder: Ctrl+Shift+B, Ctrl+Shift+F | |
Hex editor: Ctrl+Shift+B, Ctrl+Shift+E | |
Hex writer: Ctrl+Shift+B, Ctrl+Shift+X | |
Discard edits: Ctrl+Shift+B, Ctrl+Shift+U | |
Http Requester: https://github.com/braindamageinc/SublimeHttpRequester | |
IndentGuides: https://github.com/SublimeText/IndentGuides | |
Nettuts+ Fetch: http://net.tutsplus.com/articles/news/i ... uts-fetch/ | |
Origami (https://github.com/SublimeText/Origami) | |
Create an adjacent pane: Ctrl+K, Ctrl+Arrows (View > Origami > Pane > Create > ...) | |
Destroy an adjacent pane: Ctrl+K, Ctrl+Shift+Arrows (View > Origami > Pane > Destroy > ...) | |
Travel to adjacent pane: Ctrl+K, Arrows (View > Origami > Pane > Travel to > ...) | |
Carry the current file to destination: Ctrl+K, Shift+Arrows (View > Origami > File > Carry to > ...) | |
Clone the current file to destination: Ctrl+K, Alt+Arrows (View > Origami > File > Clone to > ...) | |
PlainTasks: https://github.com/aziz/PlainTasks | |
Prefixr: https://github.com/wbond/sublime_prefixr | |
SidebarEnhancements: https://github.com/titoBouzout/SideBarEnhancements | |
Sublime Files: https://github.com/al63/SublimeFiles | |
Open file navigator: Ctrl+Alt+N [conflicts with "AdvancedNewFile"] | |
Super Calculator | |
Select text then press Alt+C | |
SublimeLinter: https://github.com/SublimeLinter/SublimeLinter | |
SublimeXiki-master: https://github.com/lunixbochs/SublimeXiki | |
SyncedSidebar | |
Trailing Spaces | |
Wrap Plus (https://github.com/ehuss/Sublime-Wrap-Plus) | |
Wrap selection: Alt+Q | |
Web Packages | |
CSS-Snippets: https://github.com/joshnh/CSS-Snippets | |
cssTidy: https://github.com/fitnr/SublimeCSSTidy | |
Emmet: https://github.com/sergeche/emmet-sublime, http://docs.emmet.io/ (try "div>ul>li*3" <tab>) | |
HTML5: https://github.com/mrmartineau/HTML5 | |
HtmlTidy: https://github.com/welovewordpress/SublimeHtmlTidy | |
PyV8 | |
SublimeCodeIntel: https://github.com/Kronuz/SublimeCodeIntel | |
Jump to symbol definition: Ctrl+F3 | |
Sublime-HTMLPrettify: https://github.com/victorporof/Sublime-HTMLPrettify | |
Snippets | |
Emmet Css Snippets | |
HTML Snippets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment