Sublime Text(v 2.0)-如何在方括号后的新行上停止自动缩进? [英] Sublime Text (v 2.0) - how do I stop auto indentation on new lines after brackets?

查看:170
本文介绍了Sublime Text(v 2.0)-如何在方括号后的新行上停止自动缩进?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Notepad ++跳转到Sublime Text2.但是,一个问题阻止了我这样做:

I'm trying to make the jump from Notepad++ to Sublime Text 2. However one issue is stopping me from doing so:

在CSS,JavaScript或PHP中工作时-每当我输入方括号并按[ENTER]时,都会添加一个额外的缩进.例如.下面显示的是如果您输入方括号并按Enter键,则插入符号的最终位置:

When working in CSS, JavaScript or PHP - whenever I type a bracket and press [ENTER], an extra indentation is added. E.g. below show's you where the caret ends up if I type a bracket and press enter:

    {
        |

我需要插入符号出现在与支架相同的水平点上,像这样:

I need the caret to appear at the same horizontal point as the bracket, like so:

    {
    |

我尝试弄乱缩进设置无济于事.这是我当前的用户设置:

I've tried messing with the indentation settings to no avail. Here are my current User Settings:

{
"auto_indent": true,
"auto_match_enabled": false,
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"detect_indentation": false,
"font_face": "Courier New",
"font_size": 10,
"highlight_modified_tabs": true,
"ignored_packages":
[
    "Vintage"
],
"indent_to_bracket": false,
"line_padding_bottom": 1,
"line_padding_top": 1,
"smart_indent": false,
"trim_automatic_white_space": false
}

更新:如果我将 auto_indent 设置为 false ,则会产生另一个问题.在这种情况下,插入标记将始终放置在该行的开头.例如

UPDATE: if I set auto_indent to false, this creates a different problem. In this case, the caret will always be placed at the very beginning of the line. E.g.

        {
|

我还尝试了无用的处理Packages/JavaScript中的文件.

I've also tried playing with the files in Packages/JavaScript to no avail.

我真的很想开始使用此编辑器,对此我将非常感激!

Would really appreciate a solution as I really want to start using this editor!

谢谢.

推荐答案

在例如在Ruby中,尽管两者中都存在increaseIndentPattern之类的设置,但您仍需要编辑%AppData%\Sublime Text 2\Packages\Ruby\Miscellaneous.tmPreferences文件,而不是%AppData%\Sublime Text 2\Packages\Default\Indentation Rules.tmPreferences文件.也就是说,编辑后者(例如,注释标签内部)将不起作用.对版本2.0.1有效.

To prevent "smart" indentation or automatic next/extra level indentation in e.g. Ruby you need to edit the %AppData%\Sublime Text 2\Packages\Ruby\Miscellaneous.tmPreferences file, not the %AppData%\Sublime Text 2\Packages\Default\Indentation Rules.tmPreferences file, despite of presence of settings like increaseIndentPattern in both. That is, editing the latter (commenting out the tag insides, for example) won't take any effect. Valid for version 2.0.1.

这篇关于Sublime Text(v 2.0)-如何在方括号后的新行上停止自动缩进?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆