本文目录一览:
- sublime thinkphp怎么安装
- sublimetext自带格式化代码功能 怎么用
- Sublime Text,php代码格式化插件codeformatter 设置PHP代码格式时报错 怎么处理
- sublime text 3怎样安装php插件
- Sublime 安装完phpfmt插件后,保存文件总是提示:php版本问题
sublime thinkphp怎么安装
其实在sublime中已经自建了格式化按钮:
Edit - Line - Reindent
只是sublime并没有给他赋予快捷键,所以只需加上快捷键即可
Preference - Key Bindings -user
中 括号内添加(比如添加:ctrl + alt + f)
{ "keys": ["ctrl+alt+f"], "command": "reindent" }
- 打开 Sublime Text 2,按下 Control + ` 调出 Console,通常这个快捷键会与PC上的其它软件起冲突,需要修改其它软件的这个快捷键。
- 将以下代码粘贴进命令行中并回车:
import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen(''+pf.replace(' ','%20')).read())
- 重启 Sublime Text 2,如果在 Preferences - Package Settings中见到Package Control这一项,就说明安装成功了。 按ctrl+shift+p 输入install 回车,等待响应,输入“format”,就可以显示很多格式化软件 根据自己的使用选择喜欢的,你就直接输入thinkphp就出现了 然后安装即可
sublimetext自带格式化代码功能 怎么用
安装格式化插件:
- 按Ctrl+Shift+P调出命令面板
- 输入 install 调出 Package Control: Install Package 选项,按下回车,底部框接着输入“Tag”,再次按回车等待安装完成并重启。 使用: 选中一段html代码,按Ctrl+Alt+F即可。
Sublime Text,php代码格式化插件codeformatter 设置PHP代码格式时报错 怎么处理
{
"codeformatter_debug": false,
"codeformatter_php_options": {
"syntaxes": "php",
"php_path": "这里改成你php的路径",
"format_on_save": false,
"php55_compat": false,
"psr1": false,
"psr1_naming": false,
"psr2": true,
"indent_with_space": 4,
"enable_auto_align": true,
"visibility_order": true,
"smart_linebreak_after_curly": true,
"passes": [],
"excludes": []
},
"codeformatter_js_options": {
"syntaxes": "javascript,json",
"format_on_save": false,
"indent_size": 4,
"indent_char": " ",
"indent_with_tabs": false,
"eol": "\n",
"preserve_newlines": false,
"max_preserve_newlines": 10,
"space_in_paren": false,
"space_in_empty_paren": false,
"e4x": false,
"jslint_happy": false,
"space_after_anon_function": false,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 0,
"unindent_chained_methods": false,
"break_chained_methods": false,
"end_with_newline": false,
"comma_first": false,
"operator_position": "before-newline"
},
"codeformatter_css_options": {
"syntaxes": "css,less",
"format_on_save": false,
"indent_size": 4,
"indent_char": " ",
"indent_with_tabs": false,
"selector_separator_newline": false,
"end_with_newline": false,
"newline_between_rules": false,
"space_around_combinator": false,
"eol": "\n"
},
"codeformatter_scss_options": {
"syntaxes": "scss,sass",
"format_on_save": false,
"indent_size": 4,
"indent_char": " ",
"indent_with_tabs": false,
"selector_separator_newline": false,
"end_with_newline": false,
"newline_between_rules": false,
"space_around_combinator": false,
"eol": "\n"
},
"codeformatter_html_options": {
"syntaxes": "html,blade,asp,xml",
"format_on_save": false,
"formatter_version": "bs4",
"indent_size": 4,
"indent_char": " ",
"indent_with_tabs": false,
"exception_on_tag_mismatch": false,
"expand_javascript": false,
"expand_tags": false,
"minimum_attribute_count": 2,
"first_attribute_on_new_line": false,
"reduce_empty_tags": false,
"reduce_whole_word_tags": false,
"custom_singletons": ""
},
"codeformatter_python_options": {
"syntaxes": "python",
"format_on_save": false,
"indent_size": 1,
"indent_with_tabs": true,
"max_char": 80,
"assignment": " = ",
"function_param_assignment": "=",
"function_param_sep": ", ",
"list_sep": ", ",
"subscript_sep": "=",
"dict_colon": ": ",
"slice_colon": ":",
"comment_prefix": "# ",
"shebang": "#!/usr/bin/env python",
"boilerplate": "",
"blank_line": "",
"keep_blank_lines": true,
"add_blank_lines_around_comments": true,
"add_blank_line_after_doc_string": true,
"max_seps_func_def": 3,
"max_seps_func_ref": 5,
"max_seps_series": 5,
"max_seps_dict": 3,
"max_lines_before_split_lit": 2,
"left_margin": "",
"normalize_doc_strings": false,
"leftjust_doc_strings": false,
"wrap_doc_strings": false,
"leftjust_comments": false,
"wrap_comments": false,
"double_quoted_strings": false,
"single_quoted_strings": false,
"can_split_strings": false,
"doc_tab_replacement": "....",
"keep_unassigned_constants": false,
"parenthesize_tuple_display": true,
"java_style_list_dedent": false
},
"codeformatter_vbscript_options": {
"syntaxes": "vbscript",
"format_on_save": false,
"indent_size": 1,
"indent_char": "\t",
"indent_with_tabs": true,
"preserve_newlines": true,
"max_preserve_newlines": 10,
"opening_tags": "^(Function .*|Sub .*|If .* Then|For .*|Do While .*|Select Case.*)",
"middle_tags": "^(Else|ElseIf .* Then|Case .*)$",
"closing_tags": "(End Function|End Sub|End If|Next|Loop|End Select)$"
},
"codeformatter_coldfusion_options": {
"syntaxes": "coldfusion,cfm,cfml",
"format_on_save": false,
"indent_size": 2,
"indent_char": " ",
"indent_with_tabs": false,
"exception_on_tag_mismatch": false,
"expand_javascript": false,
"expand_tags": false,
"minimum_attribute_count": 2,
"first_attribute_on_new_line": false,
"reduce_empty_tags": false,
"reduce_whole_word_tags": false,
"custom_singletons": ""
}
}
sublime text 3怎样安装php插件
使用Sublime text 3 编写代码是一种享受,使用Sublime text 3 格式化HTML代码,需要安装插件,具体安装步骤如下:
- 打开菜单-首选项-插件控制,输入 install package
- 等待程序进入插件管理功能,再输入插件名称:TAG
- 点击安装插件。
- 插件安装成功后,在需要格式化的HTML代码中,选中代码,然后按Ctrl+Alt+F对代码进行格式化。
Sublime 安装完phpfmt插件后,保存文件总是提示:php版本问题
这个英文的意思是你的插件使用的php版本是5.6,但是你本地的php版本是7.0。所以会有版本上的不兼容,建议你更新一下插件。 提示后面给出了插件的配置文件的地址,你打开插件的配置文件把里面引用的php版本改成和你电脑使用的php版本一样就可以了。