The conversion between the TAB key and the SPACEBAR is always a problem, such as in Makefile, where the TAB key should be replaced with a space.
In Python code, however, the conversion between invisible spaces and tab keys can also be problematic due to the strict indentation format. In UltraEdit, we can define the TAB key to convert to a number of space characters to meet our own requirements. In the VI under Linux?
The vi under Linux is generally a link to vim, and we create the. vimrc file in the user's home directory:
Set ts=4 (Note: TS is the abbreviation for TabStop, set tab width 4 spaces)
Set Expandtab
For a saved file, you can use the following method to replace the Space and tab:
tab is replaced with a space:
: Set ts=4
: Set Expandtab
:%retab!
Space is replaced with tab:
: Set ts=4
: Set Noexpandtab
:%retab!
Add! is the tab that is used to process non-whitespace characters, that is, all tabs, if not added, only the tab at the beginning of the line is processed.
VI Converts the TAB key to a space