Indentation is the process of maintaining the code blocks of programming languages to maintain a systematic structure. It helps to convey the developers a better structure of program. This chapter explains you in detail about indentation in Sublime Text editor.
Indentation helps to maintain the code structure such that it is easily understood by anyone who accesses it. Proper indentation imparts the following features to the code −
Sublime Text editor provides various options for code indentation as shown in the following screenshot −
The usage of these options is discussed in detail here −
Indent option helps to create indentation of the specified code. You have to select the code specified and select the Indent option. You can also use the shortcut Ctrl+[ after selecting the required code that is to be indented. Refer to the following screenshot for a better understanding −
Unindent option works in the reverse of indent procedure. The shortcut for the unindent option is Ctrl+]. Refer to the following screenshot for a better understanding −
Reindent option is used to undo the unindent option and revert the code back to the same condition. Refer to the following screenshot for a better understanding −
Proper indentation offers various benefits to the code and developers. They are discussed below −
Code blocks will be visible without much effort.
Developer can focus on lines of code that are necessary and easily ignore the irrelevant ones.
A developer using the same kind of code structure multiple times need not focus on the start of block and end of block statements.
Any misplaced lines of code can be easily identified.