sublimetext tab 空格怎么设置tab 字符空格

以Mac OSX下的Sublime Text2为例:
点击 Preference -& Settings-User
【增加如下配置信息】:
// The number of spaces a tab is considered equal to
"tab_size": 4,
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": true
<div class="crayon-num" data-line="crayon-592bc<div class="crayon-num crayon-striped-num" data-line="crayon-592bc<div class="crayon-num" data-line="crayon-592bc<div class="crayon-num crayon-striped-num" data-line="crayon-592bc
// The number of spaces a tab is considered equal to"tab_size": 4,// Set to true to insert spaces when tab is pressed"translate_tabs_to_spaces": true
&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
EOF @ &#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
原创文章,转载请注明: 转载自[
本文链接地址:
- 131,184 views - 91,466 views - 50,104 views - 48,984 views - 38,938 views - 38,105 views - 33,405 views - 30,182 views - 21,818 views - 21,244 views
2015年八月 &(1)
2015年三月 &(5)
2015年二月 &(3)
2015年一月 &(12)
2014年十二月 &(4)
2014年十一月 &(3)
2014年七月 &(1)
2014年五月 &(1)
2014年四月 &(12)
2014年三月 &(4)
2014年二月 &(6)
2014年一月 &(8)
2013年十二月 &(1)
2013年十月 &(9)
2013年九月 &(7)
2013年八月 &(8)
2013年六月 &(4)
2013年五月 &(4)
2013年四月 &(3)
2013年三月 &(10)
2013年二月 &(1)
2013年一月 &(2)
2012年十二月 &(1)
2012年十一月 &(7)
2012年十月 &(2)
2012年九月 &(4)
2012年八月 &(13)
2012年七月 &(14)
2012年六月 &(12)
2012年五月 &(15)
2012年四月 &(20)
2012年三月 &(22)
2012年二月 &(86)
标签云(3D)
WP Cumulus Flash tag cloud by
9 or better.45783人阅读
Preference-defalut:
【将Tab键自动替换为4个空&#26684;】
// The number of spaces a tab is considered equal to
“tab_size”: 4,
// Set to true to insert spaces when tab is pressed
“translate_tabs_to_spaces”: true,
&&相关文章推荐
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:321169次
积分:2453
积分:2453
排名:第13851名
原创:40篇
转载:28篇
评论:35条
(9)(6)(12)(1)(4)(8)(3)(2)(4)(17)(1)sublime text修改TAB缩进为空格_sublime text_ThinkSAAS
sublime text修改TAB缩进为空格
sublime text修改TAB缩进为空格
内容来源: 网络
普通方式设置sublime text2的tab为4个空格的方式:&#13;
在sublime text中将TAB缩进直接转化为4个空格,可以按照如下方式操作:&#13;
菜单栏: Preferences -& Settings – More -& Syntax Specific – User&#13;
然后添加设置代码就可以了,文件保存在$Packages/User下&#13;
"tab_size": 4,&#13;
"translate_tabs_to_spaces":&#13;
如果以上办法无效,可以参考如下方式:&#13;
Here is a simple
plug-in to convert tabs (only at the beginning of lines) to spaces in the current file whenever you save it.&#13;
In Sublime, go to the Preferences menu and choose Browse Packages… This will open the Sublime Text 2 Packages folder. Create a new folder here with your last name, then open your new folder (you just created your own Package!)&#13;
Next, create an empty file in the folder called “tabs_to_spaces.py”. Paste this code into the file:&#13;
import sublime, sublime_plugin
# class ExampleCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.insert(edit, 0, "Hello, World!")
class ConvertTabsToSpaces(sublime_plugin.EventListener):
def on_pre_save(self, view):
edit = view.begin_edit()
view.run_command(&expand_tabs&, {"set_translate_tabs": True})
view.end_edit(edit)
#sublime.message_dialog("Converted endings.")
This creates a hook and runs whenever you save the file, but right before the save actually occurs, allowing you to modify the document text. In this case all we did was run the menu command “expand_tabs”. You could also run other commands or perform custom&#13;
text replacements.&#13;
E文部分转自:&#13;
PHP开发框架
开发工具/编程工具
服务器环境
ThinkSAAS商业授权:
ThinkSAAS为用户提供有偿个性定制开发服务
ThinkSAAS将为商业授权用户提供二次开发指导和技术支持
让ThinkSAAS更好,把建议拿来。
开发客服微信你正在使用的浏览器版本过低,将不能正常浏览和使用知乎。

我要回帖

更多关于 sublime3 tab 4个空格 的文章

 

随机推荐