No Space Please, Only Tabs for Indentation

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:










评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值