424

I have several strings selected in a file in Sublime Text and I want to convert them all to lowercase.

How can I convert them all to lowercase in Sublime Text?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
arturomp
  • 28,790
  • 10
  • 43
  • 72

5 Answers5

847

From the Sublime Text docs for Windows/Linux:

Keypress            Command
Ctrl + K, Ctrl + U  Transform to Uppercase
Ctrl + K, Ctrl + L  Transform to Lowercase

and for Mac:

Keypress    Command
cmd + KU    Transform to Uppercase
cmd + KL    Transform to Lowercase

Also note that Ctrl + Shift + p in Windows ( + Shift + p in a Mac) brings up the Command Palette where you can search for these and other commands. It looks like this:

enter image description here

The Vee
  • 11,420
  • 5
  • 27
  • 60
arturomp
  • 28,790
  • 10
  • 43
  • 72
  • 5
    I'm used to Notepad++ where you can just select text and use right mouse button to manipulate it. Sublime lacks a lot of mouse manipulations – vsync Feb 19 '14 at 10:03
  • 90
    I wonder why I always learn such things from SO instead of a documentation :) – Vitalii Zurian May 13 '14 at 07:55
  • 3
    Too Bad There Isn't Sentence & Title Case Shortcuts, That'd be Something. – Ben Racicot Jul 30 '14 at 15:40
  • 14
    @BenRacicot No problem, add the built-in functions to your key bindings (Preferences -> Key Bindings-User): `[ { "keys": ["super+k", "super+t"], "command": "title_case" }, ]` – Alexei Danchenkov Sep 26 '14 at 05:59
  • 10
    It's actually Ctrl + KU and Ctrl + KL for Windows too. At least in ST2 which is the one I'm using. – rzb Aug 17 '15 at 01:25
  • Is there something to have Title Form (See https://english.stackexchange.com/questions/14/which-words-in-a-title-should-be-capitalized or http://titlecase.com/ or http://titlecapitalization.com/)? – Royi Aug 30 '17 at 17:24
  • Just to help memorize it: in emacs it is `Ctrl`+`x`, `Ctrl`+`u/l`. – HongboZhu Aug 30 '18 at 08:59
  • 1
    I wish there was a `Toggle Case` command. Changing case is done so rarely that it would be convenient to have it under just one action key instead of two. Like, if there is at least one uppercase character in selection, it goes all uppercased. If not, all goes lowercase. I would prefer to press it twice to make it lowercase instead of having a separate key. – Robo Robok Jan 20 '19 at 00:30
82

For Windows:

  • Ctrl+K,Ctrl+U for UPPERCASE.
  • Ctrl+K,Ctrl+L for lowercase.

Method 1 (Two keys pressed at a time)

  1. Press Ctrl and hold.
  2. Now press K, release K while holding Ctrl. (Do not release the Ctrl key)
  3. Immediately, press U (for uppercase) OR L (for lowercase) with Ctrl still being pressed, then release all pressed keys.

Method 2 (3 keys pressed at a time)

  1. Press Ctrl and hold.
  2. Now press K.
  3. Without releasing Ctrl and K, immediately press U (for uppercase) OR L (for lowercase) and release all pressed keys.

Please note: If you press and hold Ctrl+K for more than two seconds it will start deleting text so try to be quick with it.

I use the above shortcuts, and they work on my Windows system.

Anish Nair
  • 3,238
  • 29
  • 41
30

As a bonus for setting up a Title Case shortcut key Ctrl+kt (while holding Ctrl, press k and t), go to Preferences --> Keybindings-User

If you have a blank file open and close with the square brackets:

[  { "keys": ["ctrl+k", "ctrl+t"], "command": "title_case" } ]

Otherwise if you already have stuff in there, just make sure if it comes after another command to prepend a comma "," and add:

{ "keys": ["ctrl+k", "ctrl+t"], "command": "title_case" }
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
user3486945
  • 301
  • 3
  • 3
21

For Windows OS

For Uppercase CTRL + K + U

For Lowercase CTRL + K + L

Misha Akopov
  • 12,241
  • 27
  • 68
  • 82
Navneet Kumar
  • 623
  • 1
  • 6
  • 16
7

For others needing a key binding:

{ "keys": ["ctrl+="], "command": "upper_case" },
{ "keys": ["ctrl+-"], "command": "lower_case" }
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
wadey
  • 71
  • 1
  • 3