相关疑难解决方法(0)

如何使用Sublime Text 2重新格式化HTML代码?

我有一些格式不佳的HTML代码,我想重新格式化.是否有一个命令会自动重新格式化Sublime Text 2中的HTML代码,使其看起来更好,更容易阅读?

html indentation reformat sublimetext sublimetext2

1282
推荐指数
14
解决办法
97万
查看次数

Sublime Text 3,将空格转换为制表符

我知道有很多关于此的帖子,但我无法让它发挥作用.
我用标签进行编码.有没有办法,将空格始终转换为制表符?即打开和保存文件?有人有个主意吗?

//编辑:
我的愿望就是自动完成!- >打开,保存或动起来
有谁知道该怎么办?


我试过这个:

import sublime, sublime_plugin, os

class ExpandTabsOnSave(sublime_plugin.EventListener):
  # Run ST's 'expand_tabs' command when saving a file
  def on_pre_save(self, view):
    if view.settings().get('expand_tabs_on_save') == 1:
      view.window().run_command('expand_tabs')
Run Code Online (Sandbox Code Playgroud)

这是我的用户设置:

{
    "auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",
    "auto_indent": true,
    "detect_indentation": true,
    "draw_white_space": "all",
    "ensure_newline_at_eof_on_save": true,
    "expand_tabs_on_save": true,
    "font_face": "SourceCodePro-Regular",
    "font_size": 10,
    "format_on_save": true,
    "ignored_packages":
    [
        "Vintage"
    ],
    "indent_to_bracket": true,
    "open_files_in_new_window": false,
    "smart_indent": true,
    "tab_size": 4,
    "translate_tabs_to_spaces": false,
    "trim_automatic_white_space": true,
    "trim_trailing_white_space_on_save": true,
    "use_tab_stops": false,
    "word_wrap": …
Run Code Online (Sandbox Code Playgroud)

tabs spaces auto-indent sublimetext sublimetext3

175
推荐指数
6
解决办法
17万
查看次数

崇高文本中的重新快捷方式

可能重复:
在Sublime文本2中缩进代码?

我正在尝试学习Sublime中的键盘快捷键.Sublime Text 2中用于reindent的键盘快捷键是什么?根据一些页面应该是,TAB但只有缩进,而不是redents.

sublimetext sublimetext2

63
推荐指数
2
解决办法
8万
查看次数

sublime text 2更改缩进模板

我想更改模板ruby haml的基本缩进.当我创建一个新的文件'Tab Size:4'时,他被设置如何在'Spaces:2'中更改它?

谢谢.

indentation sublimetext

16
推荐指数
3
解决办法
1万
查看次数

如何在选定的行前面插入空格?

有没有办法在几个选定的行前面添加空格或制表符(4个空格)?因为现在如果更改代码我hava按命令+单击选择每一行.

谢谢.

sublimetext2

14
推荐指数
2
解决办法
9565
查看次数

PHP文件的不正确的sublime缩进

我一直在使用自定义快捷方式在Sublime Text中缩进,这篇文章在Sublime Text中缩进了多行

但如果有奇数个空格,它就不起作用.就像我的标签大小设置为2个空格,并且当任何行的开头有3个空格时,它不会缩进剩余的代码.

例如:

<?php

function test_indent() {
  if (condition) {
   echo "here";
  }
   else {
    echo "else";
   }
}
Run Code Online (Sandbox Code Playgroud)

当我用上面帖子中指定的自定义快捷方式缩进时,它是:

{ "keys": ["ctrl+shift+f"], "command": "reindent", "args": {"single_line": false} }
Run Code Online (Sandbox Code Playgroud)

对我来说,结果如下:

function test_indent() {
  if (condition) {
   echo "here";
 }
 else {
  echo "else";
}
}
Run Code Online (Sandbox Code Playgroud)

我需要做什么才能使其缩进?

php editor indentation sublimetext2 sublimetext3

5
推荐指数
1
解决办法
404
查看次数