Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capitalize selection in Sublime Text

Is there a way to capitalize a selection in Sublime? For example, if I have some text like word, I'd like the output to be Word.

I know that there is already an option to convert case into lower case or upper case, but those would result in word and WORD respectively. Is there a way to only capitalize the first letter?

like image 538
Saad Avatar asked Jun 23 '15 16:06

Saad


People also ask

How do you capitalize the first letter in Sublime Text?

One of the most popular code and text editors, Sublime Text also includes a capitalization tool. Just select your text, click the Edit menu, and select Convert Case followed by the case you want.

How do I select the same word in Sublime Text?

Alt+F3 gives a really simple way to do find and replace: Use it to select all occurrences of the current word or selection, then just start typing to replace or edit them all at once.

How do I replace multiple lines in Sublime Text?

Alternatively you can select lines and go to SELECTION MENU >> SPLIT INTO LINES. Now you can edit multiple lines, move cursors etc. for all selected lines.


Video Answer


2 Answers

You can do it using the menu Edit>Convert Case>Title Case.

In case you want to set a keybinding the name of the associated command is title_case.

like image 186
sergioFC Avatar answered Sep 21 '22 20:09

sergioFC


Add keybinding under the preferences as follows:

[
// for uppercase:
  { "keys": ["ctrl+u"], "command": "upper_case" },

// for lowercase:
  { "keys": ["ctrl+l"], "command": "lower_case" },

// for titlecase:
  { "keys": ["ctrl+t"], "command": "title_case" },
]
like image 35
Abhishek Pareek Avatar answered Sep 22 '22 20:09

Abhishek Pareek