
- Sublime Text Tutorial
- Sublime Text - Home
- Sublime Text – Introduction
- Sublime Text – Installation
- Sublime Text – Data Directory
- Creating First Document
- Editing First Text Document
- Patterns of Code Editing
- Sublime Text – Sublime Linter
- Sublime Text – Shortcuts
- Sublime Text – Snippets
- Sublime Text – Macros
- Sublime Text – Key Bindings
- Sublime Text – Column Selection
- Sublime Text – Indentation
- Sublime Text – Base Settings
- Sublime Text – Theme Management
- Understanding Vintage Mode
- Sublime Text – Vintage Commands
- Sublime Text – Testing Javascript
- Sublime Text – Testing Python Code
- Sublime Text – Spell Check
- Sublime Text – Packages
- Sublime Text – Menus
- Sublime Text – Sub Menus of Font
- Sublime Text – Developing Plugin
- Sublime Text – Command Palette
- Debugging PHP Application
- Debugging Javascript Application
- Sublime Text – Batch Processing
- Distraction Free Mode
- SublimeCodeIntel Plugin
- Sublime Text Useful Resources
- Sublime Text - Quick Guide
- Sublime Text - Useful Resources
- Sublime Text - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Sublime Text - Editing First Text Document
Code editors allow the users to edit the code scripts and text documents with various shortcut keys. In this chapter, let us understand through various examples about editing options of first text document in Sublime Text.
Simultaneous Write-Up
In this example, you will see how to add print statements at two locations.
Step 1 − Consider the first script of Python with the following code in it −

Step 2 − Let us suppose that, in the given script you want to mention the starting and ending points of the loop, using simple statements. You can write the print statement wherever required, however, in Sublime Text editor you can simultaneously add comments and statements in two places with a shortcut of Ctrl+cursor point for Windows or Linux, and Cmd+cursor point for Mac. Then, you can see the cursor points as mentioned below −

Step 3 − Now, you can insert the print statements at both the locations of the mentioned cursor points, as shown in the image below.

Finding Occurrences
Sublime Text editor includes a feature to find the occurrences of the keywords included in the scripts. The shortcut key for finding occurrences of the keyword is Ctrl+D after highlighting the associated keyword.

If you want to search for a keyword, say print from the given code, you can use Ctrl+D or Cmd+D to get the count of occurrences of the associated keyword.

Appending Comments in Line
We can append comments at the end of line using the shortcut key Ctrl+Shift+L for Windows and Cmd+Shift+L for Mac operating system after selecting the code section where you actually need the comment.
