Sublime Text - Patterns of Code Editing


Advertisements

There are various types of code editing and shortcut keys used in Sublime Text editor −

  • Splitting the selection into lines
  • Wrapping the complete paragraph in HTML file
  • Finding all occurrences

This chapter discusses each of them in detail.

Splitting the Selection into Lines

The key combination Ctrl+Shift+L allows you to select the blocks of lines and split them, on Windows. The screenshot given below explains this −

Splitting the Selection into Lines

Wrapping Complete Paragraph in HTML File

The key combination Alt+Shift+w for Windows and Cmd+Shift+w for Mac, allows the user to split the sections of code and create various paragraphs. It is referred as a wrap selection with html tag. This also allows you to include HTML tags using Sublime editor.

The screenshot given below explains wrapping text with a HTML tag −

Wrapping Complete Paragraph in HTML File

After wrapping the text, the text wrapped with a HTML tag will be seen as shown below −

After Wrapping the Text

Finding all Occurrences

The key pattern Ctrl+Shift+f allows you to find a keyword in a given project. The screenshot given below explains this −

Finding all Occurrences

The shortcut key opens a window with three options included in it, namely find, where and replace,

where,

  • find refers to the search of the particular keyword,

  • where mentions the section as to which repository is searched, and

  • replace mentions the keyword which is replaced instead of find keyword.

Advertisements