Create a gist now

Instantly share code, notes, and snippets.

Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
Ctrl+⇧+↩ insert line before
Ctrl+⇧+↑ move line (or selection) up
Ctrl+L select line (repeat to select next lines)
Ctrl+D select word (repeat select others occurrences in context for multiple editing)
Ctrl+M jump to closing bracket for current code, repeat to jump to opening bracket
Ctrl+⇧+M select all contents of the current brackets (curly brackets, square brackets, parentheses)
Ctrl+KK delete from cursor to end of line
Ctrl+K+⌫ delete from cursor to start of line
Ctrl+] indent current line(s)
Ctrl+[ un-indent current line(s)
Ctrl+⇧+D duplicate line(s)
Ctrl+J join line below to the end of the current line
Ctrl+ / comment/un-comment current line
Ctrl+⇧+/ block comment current selection
Ctrl+Y redo, or repeat last keyboard shortcut command
Ctrl+⇧+V paste and indent correctly
Ctrl+Space select next auto-complete suggestion
Ctrl+U soft undo (somehow undoes your movements; it jumps to your last change before undoing it when you repeat this command)

Navigation/Goto Anywhere

Ctrl+P quick-open files by name in your project (doesn’t seem to need an actual project set up, it just searches in the directories around the currently-opened file
Ctrl+R goto symbol (functions and classes) in the file. Same as Ctrl+P, then type @
Ctrl+; goto word in current file. Same as Ctrl+P, then type #
Ctrl+G goto line in current file. Same as Ctrl+P, then type :

General

Ctrl+⇧+P command prompt
Ctrl+KB toggle side bar

Find/Replace

Ctrl+F find
Ctrl+H replace
Ctrl+⇧+F find in files

Tabs

Ctrl+⇧+t open last closed tab (just like in your browser)
Ctrl+PgDn cycle down through open tabs, cycle up with Ctrl+PgUp
Ctrl+⇆ cycle through last tabs (repeat to go back further in history)

Split window

Alt+⇧+2 split into two columns
Alt+⇧+1 revert to single column
Alt+⇧+5 grid (4 groups)
Ctrl+[1,2,3,4] jump to “group” (pane)
Ctrl+⇧+[1,2,3,4] move file to specified group

Bookmarks

Ctrl+F2 toggle bookmark
F2 next bookmark
⇧+F2 previous bookmark
Ctrl+⇧+F2 clear bookmarks

Text manipulation

Ctrl+KU upper case
Ctrl+KL lower case
@Leimi
Leimi commented Feb 22, 2012

Ctrl+C, Ctrl+X and Ctrl+V let you copy/cut/paste lines if you don't select anything. So, Ctrl+X doesn't "delete" a line, it cuts it. To delete a line, the default shortcut is Ctrl+Shift+K :)

@losvedir

Highlighting a bunch of lines then hitting Cmd (Ctrl?) +Shift+L gives you multi-cursors on each line. I do that, followed by Cmd + Right arrow (End?) to get easily get a cursor at the end of a series of lines to simultaneously type something after each.

@eteanga
Owner
eteanga commented Feb 23, 2012

@Leimi I was only slowly beginning to understand that. I've updated the reference for Ctrl+C and Ctrl+X.

@eteanga
Owner
eteanga commented Feb 23, 2012

@losvedir I've figured out that it's Ctrl+L repeated, followed by Ctrl+⇧+L, then finally to get to the end. Now you have the cursor at the end of multiple lines. Thanks for sharing!

@hkdobrev

Ctrl+Shift+J expand the selection to the indentation level of the current line. So if you want to select a block of code with the same indentation it's really useful.

@paulirish

A few written about in more detail: http://whiletruecode.com/post/7-handy-text-manipulation-tricks-sublime-text-2

Feels like someone should make a cheatsheet for these. It'd be interesting to explore a visual layout like ted naleid's vim movements

@shabith
shabith commented Oct 14, 2012

Alt + F3 select all occurrences of current word for multiple editing. Very useful.

@rameshsrinivasan

Useful information...
thank you... :)

@lety4ent
lety4ent commented Feb 6, 2013

Very useful information, however ... could you modify the commands in order to be more specific about if it's a Ctrl or Cmd key ? Well, that could be great for iOS users.

Cool !

@passion8

Thanks .
Very useful .

@darxsys
darxsys commented Apr 2, 2013

Thanks!

@tuvokki
tuvokki commented Apr 10, 2013

For some serious concentration (though only on one screen); via the View menu. Select “Enter Distraction Free Mode,” or press shift + F11 (or use the Mac keyboard shortcut, Control + Shift + Command + F).

@bendman
bendman commented Apr 10, 2013

The one that makes Ctrl+D (most common multi-cursor) so useful: Ctrl+K, Ctrl+D. Hitting Ctrl+K before hitting Ctrl+D allows you to skip to the next word, so you can be picky about what gets a cursor.

One note about multi-cursor is that it's case sensitive according to the current state of the Find tool. Open the find tool and set it to case sensitive if you want multi-cursor to be case sensitive.

@nocommit

These are definitely useful. Thought losvedir had the solution, but does anyone know the shortcut for slicing through the code? On notepad++ it was alt + vertical mouse drag, and it's the only thing I miss about that program.

@aditya-kappagantula

That was very helpful! Thank u :)

@EvanHahn
EvanHahn commented Jun 3, 2013

I think Ctrl+KK should be Ctrl+K.

@witsu
witsu commented Jun 5, 2013

Thank you

@enlacee
enlacee commented Jun 5, 2013

good !!

@tmhrtwg
tmhrtwg commented Jul 3, 2013

Nice list, thanks!

@Taiger
Taiger commented Jul 3, 2013

To slice through the code hold down the middle mouse button for Windoz/Linux.

@piotrkubisa

Also http://www.sublimetext.com/docs/2/column_selection.html is very useful (shift+RMB on Win/Linux or Middle Mouse Button or Ctrl + Shift + Up/Down )

@emilioborraz

Defenitivly Ctrl+⇧+t made my day, thank you!

@rafaelune

Ctrl+` : To open console

@pjc
pjc commented Aug 18, 2013

Two questions:

  1. How do I switch between columns in Textmate? ctrl + tabonly switches between tabs in the same column.
  2. How do I 'exit' a multiple cursor like you get from cmd + shift + l or cmd + d?
@ntrp
ntrp commented Sep 21, 2013
  1. ctrl + groupnumber -> ctrl + tab or ctrl + pgdown
  2. escape
@xiaodaigh

what is CTRL+KU?

@dufferzafar

@xiaodaigh Ctrl + KU - pressed as Ctrl + K immediately followed by U - turns the text to uppercase. Similarly Ctrl + KL turns to lowercase.

@Eleonore9

ctrl + } increases font-size
ctrl + | decreases font-size

@srinivas-singanamalla

how could i go to end of a block or highlight it? if i keep the cursor at do (or some where on the line, would like to jump or highlight the end of the block.

do

end
@japborst

@srinivas-singanamalla just use the end key on your keyboard, to highlight: shift + end

@ZacNeubert

What key is ⇧? I've never seen that before.

@YannickNascimento

and save all shortcut

@YannickNascimento

@PoisonRain ⇧ its the shift key

@hanvid
hanvid commented Mar 19, 2014

Thanks a lot for these shortcuts. Really useful!

@wolfstevent

Ctrl/Cmd+Shift V is great. How many times I've spoken ill words to Sublime after pasting (Ctrl/Cmd+V) some nicely indented code and have it completely balled up. Now I know it was a PEBKAC error.

@KennChege

Brilliant !!! Thank you.

@xanderoid

the coolest shortcut EVER is 'ctrl' + 'shift' + 'w' with a block of code selected. This wraps the code in a tag. By default is a p tag in HTML files, not sure what it would be in others languages. But you can change the opening and closing tag just by typing... Very helpful if you want to encapsulate a block of code in a div for example.

@joseadrian

I don't know if this is common sense but: If you don't select anything, Ctrl + Shift + D duplicates the line to the next one, and if you select something it duplicates the content at the end of the selection.

@ghost
ghost commented Jul 14, 2014

How to increase text size on MAC

@nazartokar

Great!

@xkeshav
xkeshav commented Jul 30, 2014

Alt + . => Close HTML tag

@jozsefk9

If I go too far with Ctrl+D how to I go a step back or how to go backward?

@xala3pa
xala3pa commented Nov 15, 2014

Great!! Thanks

@sgsvenkatesh

Thanks!
Really helpful.

@hackerkid

How can I stop a program that I started running from sublime(CTRL+ b) without going to terminal?

@dka-odoo

Really Helpful
Thanks!

@daao87
daao87 commented Mar 4, 2015

Is it possible to add or remove spaces to a block of selected text? I mean, like when pressing tab for a selection indents all the block at once, I would like the same behavior but with spaces instead. Thanks!!

@sathishvj

Sometimes I want replacements only in the selected text. How do I add the "in selection" command to a key press. I'm unable to figure out the command for that.

@wenqinruan

what key is ↩???

@schlueter

@wenqinruan ↩ is the enter or return key

@dimpu
dimpu commented Sep 1, 2015

Thanks

@railsfactory-madhusudhan

anyone let me know multi select shortcut for sublime 3? I have used ctrl + shift + l in sublime test 2, seems it is not working in 3. I am used to ctrl + shft + l, but the command ctrl + x + ⇧ for sublime 3 it's not very user friendly.

@arangates

how to create numered list or bulleted list !

@niyaz000
niyaz000 commented May 8, 2016

Nice one.....

@GoEagles999

Thanks

@limubai123

Thanx

@Shahadat3031

Thanks

@gap99
gap99 commented Dec 1, 2016

Obat Gagal Ginjal Akut
Suatu keadaan yang tidak pernah beliau alami sebelum minum Obat Herbal Penyakit gagal ginjal. Ketika obat-obatan habis dan telat cuci darah, kondisi saya pasti langsung drop, tetapi saat ini sudah ada Obat Tradisional Xamrthone Plus serta daun teh murbei yang pasti menjadi kawan hidup saya. Sesegera mungkin mulailah pola hidup sehat dan tetap mengkonsumsi Obat sakit ginjal Tradisional.

Obat Kanker Darah Stadium 2
Tuhan telah menggunakan Amazon Plus Jus Kulit Manggis yang menolong Steven sembuh dari penyakit kanker darah yang akut ini. Tuhan sudah menguji Steven dengan sangat keras, dan Steven berhasil melaluinya. Steven berterima kasih pada Tuhan Yang Maha Esa yang telah memberikan jawaban total berkat Obat Alami Kanker Sel Darah Putih Kronis Amazon Plus Ekstrak Kulit Manggis.

Obat Alami Batu Ginjal Yang Ampuh
Obat Tradisional Amazon sangat bagus dalam menyembuhkan sakit batu ginjal secara alamiah untuk organ-organ tubuh yang lain. Pengobatan dengan menggunakan obat alami penyakit batu ginjal Amazon merupakan pengobatan yang sangat terpercaya dan sudah terbukti ampuh menyembuhkan sakit batu ginjal hingga sembuh, tanpa harus dengan cara operasi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment