No Space Please, Only Tabs for Indentation
2014-07-07 17:07
711 查看
Generally, most of code editors provide two options for indentation: space and tab. And I don't quite understand under what condition one should use spaces for indentation purpose instead of tabs; to me, that just makes your
code less readable, nothing else.
Visual Studio:
You might need to visualize the space symbols before you can do anything to them:
To make VS apply tabs for indent automatically when you press 'Enter' key, you need to go Tools->Options:
In the dialog brought up, select Text Editor->C#->Tabs, and there you go. You can also specify other configuration of how the text editor perform the indentation, like 'Tab size', which indicates how many spaces' width should
a tab occupy.
But what about the spaces that left behind by your stupid predecessor? Most of the text editors coming with IDEs provide a tool to convert indent from space to tab and vice versa, however, you need to highlight the lines before
proceeding:
WebStorm:
Go to File->Settings: Expand 'Code Style', Select the language, tick 'Use tab character'
To convert indents:
To view the space symbols: go to View->Active Editor->Show Whitespaces
Notepad++:
SubLime 2
This editor has a wonderful function, which is to convert all the leading spaces in the opening file as indent to tabs:
NetBeans 8.0
Tab Setting:
Install themes:
code less readable, nothing else.
Visual Studio:
You might need to visualize the space symbols before you can do anything to them:
To make VS apply tabs for indent automatically when you press 'Enter' key, you need to go Tools->Options:
In the dialog brought up, select Text Editor->C#->Tabs, and there you go. You can also specify other configuration of how the text editor perform the indentation, like 'Tab size', which indicates how many spaces' width should
a tab occupy.
But what about the spaces that left behind by your stupid predecessor? Most of the text editors coming with IDEs provide a tool to convert indent from space to tab and vice versa, however, you need to highlight the lines before
proceeding:
WebStorm:
Go to File->Settings: Expand 'Code Style', Select the language, tick 'Use tab character'
To convert indents:
To view the space symbols: go to View->Active Editor->Show Whitespaces
Notepad++:
SubLime 2
This editor has a wonderful function, which is to convert all the leading spaces in the opening file as indent to tabs:
NetBeans 8.0
Tab Setting:
Install themes:
相关文章推荐
- ubuntu cd /h tab键显示错误:bash: cannot create temp file for here-document: No space left on device
- 树莓派使用Tab键后提示bash: cannot create temp file for here-document: No space left on device
- No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=arm64, VALID_ARCHS=armv7 armv...
- No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
- No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386)
- PCIE配置失败,提示 pci 0000:01:00.0: BAR 4: no space for [mem size 0x00200000]
- No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active&
- 错误代码:No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=arm64, VALID_ARCHS=armv7 armv7s).
- No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=arm64, VALID_ARCHS=armv7 armv7s).
- ios Xcode运行报错 No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv7, VA
- 在64位机器中编译出错No architectures to compile for (ONLY_ACTIVE_ARCH...解决方法
- Mysql 创建表时错误:Tablespace for table `tablexx` exists. Please DISCARD the tablespace before IMPORT.
- Android Studio No tab content FrameLayout found for id 问题修复
- no chain can produce code for this qt version please define one or more tool chains问题
- No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv7, VA
- checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with
- log4j:WARN No appenders could be found for logger;log4j:WARN Please initialize the log4j system ....
- No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_
- vSphere Client 虚拟机报错:There is no more space for virtual disk
- 如何解决No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).