格式化php代码插件,php代码规范插件

本文目录一览:

vscode的php格式化插件该怎么用呀,弄了好久

安装“PHP Intelephense”这个插件

可以实现智能提醒和格式化

注意一定不要装错,看清楚了并不是”PHP IntelliSense”这个插件

sublime text怎么格式化PHP代码

安装格式化插件: 1.按Ctrl+Shift+P调出命令面板 2.输入 install 调出 Package Control: Install Package 选项,按下回车,底部框接着输入“Tag”,再次按回车等待安装完成并重启。 使用: 选中一段html代码,按Ctrl+Alt+F即可。

有人用Sublime Text,Php代码怎么格式化的

使用Sublime text 3 编写代码是一种享受,使用Sublime text 3 格式化HTML代码,需要安装插件,具体安装步骤如下:

1、打开菜单-首选项-插件控制,输入 install package

2、等待程序进入插件管理功能,再输入插件名称:TAG

3、点击安装插件。

4、插件安装成功后,在需要格式化的HTML代码中,选中代码,然后按Ctrl+Alt+F对代码进行格式化。

Sublime Text,php代码格式化插件codeformatter 设置PHP代码格式时报错 怎么处理

{

“codeformatter_debug”: false,

“codeformatter_php_options”:

{

“syntaxes”: “php”, // Syntax names which must process PHP formatter

“php_path”: “这里改成你php的路径”, // Path for PHP executable, e.g. “/usr/lib/php” or “C:/Program Files/PHP/php.exe”. If empty, uses command “php” from system environments

“format_on_save”: false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : “^((?!.min.|vendor).)*$”

“php55_compat”: false, // PHP 5.5 compatible mode

“psr1”: false, // Activate PSR1 style

“psr1_naming”: false, // Activate PSR1 style – Section 3 and 4.3 – Class and method names case

“psr2”: true, // Activate PSR2 style

“indent_with_space”: 4, // Use spaces instead of tabs for indentation

“enable_auto_align”: true, // Enable auto align of = and =

“visibility_order”: true, // Fixes visibility order for method in classes – PSR-2 4.2

“smart_linebreak_after_curly”: true, // Convert multistatement blocks into multiline blocks

// Enable specific transformations. Example: [“ConvertOpenTagWithEcho”, “PrettyPrintDocBlocks”]

// You can list all available transformations from command palette: CodeFormatter: Show PHP Transformations

“passes”: [],

// Disable specific transformations

“excludes”: []

},

“codeformatter_js_options”:

{

“syntaxes”: “javascript,json”, // Syntax names which must process JS formatter

“format_on_save”: false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : “^((?!.min.|vendor).)*$”

“indent_size”: 4, // indentation size

“indent_char”: ” “, // Indent character

“indent_with_tabs”: false, // Indent with one tab (overrides indent_size and indent_char options)

“eol”: “\n”, // EOL symbol

“preserve_newlines”: false, // whether existing line breaks should be preserved,

“max_preserve_newlines”: 10, // maximum number of line breaks to be preserved in one chunk

“space_in_paren”: false, // Add padding spaces within paren, ie. f( a, b )

“space_in_empty_paren”: false, // Add padding spaces within paren if parent empty, ie. f( )

“e4x”: false, // Pass E4X xml literals through untouched

“jslint_happy”: false, // if true, then jslint-stricter mode is enforced. Example function () vs function()

“space_after_anon_function”: false, // Space after anonimouse functions

“brace_style”: “collapse”, // “collapse” | “expand” | “end-expand”. put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line.

“keep_array_indentation”: false, // keep array indentation.

“keep_function_indentation”: false, // keep function indentation.

“eval_code”: false, // eval code

“unescape_strings”: false, // Decode printable characters encoded in xNN notation

“wrap_line_length”: 0, // Wrap lines at next opportunity after N characters

“unindent_chained_methods”: false, // Unindent chained method calls

“break_chained_methods”: false, // Break chained method calls across subsequent lines

“end_with_newline”: false, // Add new line at end of file

“comma_first”: false, // Add comma first

“operator_position”: “before-newline” // Operator position: before-newline, after-newline, preserve-newline

},

“codeformatter_css_options”:

{

“syntaxes”: “css,less”, // Syntax names which must process CSS formatter

“format_on_save”: false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : “^((?!.min.|vendor).)*$”

“indent_size”: 4, // Indentation size

“indent_char”: ” “, // Indentation character

“indent_with_tabs”: false, // Indent with one tab (overrides indent_size and indent_char options)

“selector_separator_newline”: false, // Add new lines after selector separators

“end_with_newline”: false, // Add new line of end in file

“newline_between_rules”: false, // Add new line between rules

“space_around_combinator”: false, // Space around combinator

“eol”: “\n” // EOL symbol

},

“codeformatter_scss_options”:

{

“syntaxes”: “scss,sass”, // Indentation size

“format_on_save”: false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : “^((?!.min.|vendor).)*$”

“indent_size”: 4, // Indentation size

“indent_char”: ” “, // Indentation character

“indent_with_tabs”: false, // Indent with one tab (overrides indent_size and indent_char options)

“selector_separator_newline”: false, // Add new lines after selector separators

“end_with_newline”: false, // Add new line of end in file

“newline_between_rules”: false, // Add new line between rules

“space_around_combinator”: false, // Space around combinator

“eol”: “\n” // EOL symbol

},

“codeformatter_html_options”:

{

“syntaxes”: “html,blade,asp,xml”, // Syntax names which must process HTML formatter

“format_on_save”: false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : “^((?!.min.|vendor).)*$”

“formatter_version”: “bs4”, // Which formatter to use. Current options are “bs4” and “regexp”. If an error occurs while loading the bs4 formatter, the regexp formatter will automatically be used

“indent_size”: 4, // indentation size

“indent_char”: ” “, // Indentation character

“indent_with_tabs”: false, // Indent with one tab (overrides indent_size and indent_char options)

“exception_on_tag_mismatch”: false, // If the last closing tag is not at the same indentation level as the first opening tag, there’s probably a tag mismatch in the file

“expand_javascript”: false, // (Under construction) Expand JavaScript inside of script tags (also affects CSS purely by coincidence)

“expand_tags”: false, // Expand tag attributes onto new lines

“minimum_attribute_count”: 2, // Minimum number of attributes needed before tag attributes are expanded to new lines

“first_attribute_on_new_line”: false, // Put all attributes on separate lines from the tag (only uses 1 indentation unit as opposed to lining all attributes up with the first)

“reduce_empty_tags”: false, // Put closing tags on same line as opening tag if there is no content between them

“reduce_whole_word_tags”: false, // Put closing tags on same line as opening tag if there is whole word between them

“custom_singletons”: “” // Custom singleton tags for various template languages outside of the HTML5 spec

},

“codeformatter_python_options”:

{

“syntaxes”: “python”, // Syntax names which must process Python formatter

“format_on_save”: false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : “^((?!.min.|vendor).)*$”

“indent_size”: 1, // indentation size

“indent_with_tabs”: true, // Indent with tabs or spaces

“max_char”: 80, // Width of output lines in characters.

“assignment”: ” = “, // This is how the assignment operator is to appear.

“function_param_assignment”: “=”, // This is how function-parameter assignment should appear.

“function_param_sep”: “, “, // This is how function parameters are separated.

“list_sep”: “, “, // This is how list items are separated.

“subscript_sep”: “=”, // This is how subscripts are separated.

“dict_colon”: “: “, // This separates dictionary keys from values.

“slice_colon”: “:”, // this separates the start:end indices of slices.

“comment_prefix”: “# “, // This is the sentinel that marks the beginning of a commentary string.

“shebang”: “#!/usr/bin/env python”, // Hashbang, a line-one comment naming the Python interpreter to Unix shells.

“boilerplate”: “”, // Standard code block (if any). This is inserted after the module doc string on output.

“blank_line”: “”, // This is how a blank line is to appear (up to the newline character).

“keep_blank_lines”: true, // If true, preserve one blank where blank(s) are encountered.

“add_blank_lines_around_comments”: true, // If true, set off comment blocks with blanks.

“add_blank_line_after_doc_string”: true, // If true, add blank line after doc strings.

“max_seps_func_def”: 3, // Split lines containing longer function definitions.

“max_seps_func_ref”: 5, // Split lines containing longer function calls.

“max_seps_series”: 5, // Split lines containing longer lists or tuples.

“max_seps_dict”: 3, // Split lines containing longer dictionary definitions.

“max_lines_before_split_lit”: 2, // Split string literals containing more newline characters.

“left_margin”: “”, // This is how the left margin is to appear.

“normalize_doc_strings”: false, // If true, normalize white space in doc strings.

“leftjust_doc_strings”: false, // If true, left justify doc strings.

“wrap_doc_strings”: false, // If true, wrap doc strings to max_char.

“leftjust_comments”: false, // If true, left justify comments.

“wrap_comments”: false, // If true, wrap comments to max_char.

“double_quoted_strings”: false, // If true, use quotes instead of apostrophes for string literals.

“single_quoted_strings”: false, // If true, use apostrophes instead of quotes for string literals.

“can_split_strings”: false, // If true, longer strings are split at the max_char.

“doc_tab_replacement”: “….”, // This literal replaces tab characters in doc strings and comments.

// Optionally preserve unassigned constants so that code to be tidied

// may contain blocks of commented-out lines that have been no-op’ed

// with leading and trailing triple quotes. Python scripts may declare

// constants without assigning them to a variables, but CodeFormatter

// considers this wasteful and normally elides them.

“keep_unassigned_constants”: false,

// Optionally omit parentheses around tuples, which are superfluous

// after all. Normal CodeFormatter behavior will be still to include them

// as a sort of tuple display analogous to list displays, dict

// displays, and yet-to-come set displays.

“parenthesize_tuple_display”: true,

// When CodeFormatter splits longer lines because max_seps

// are exceeded, the statement normally is closed before the margin is

// restored. The closing bracket, brace, or parenthesis is placed at the

// current indent level. This looks ugly to “C” programmers. When

// java_style_list_dedent is True, the closing bracket, brace, or

// parenthesis is brought back left to the indent level of the enclosing

// statement.

“java_style_list_dedent”: false

},

“codeformatter_vbscript_options”:

{

“syntaxes”: “vbscript”, // Syntax names which must process VBScript formatter

“format_on_save”: false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : “^((?!.min.|vendor).)*$”

“indent_size”: 1, // indentation size

“indent_char”: “\t”, // Indentation character

“indent_with_tabs”: true, // Indent with one tab (overrides indent_size and indent_char options)

“preserve_newlines”: true, // Preserve existing line-breaks

“max_preserve_newlines”: 10, // Maximum number of line-breaks to be preserved in one chunk

“opening_tags”: “^(Function .*|Sub .*|If .* Then|For .*|Do While .*|Select Case.*)”, // List of keywords which open a new block

“middle_tags”: “^(Else|ElseIf .* Then|Case .*)$”, // List of keywords which divide a block, but neither open or close the block

“closing_tags”: “(End Function|End Sub|End If|Next|Loop|End Select)$” // List of keywords which close an open block

},

“codeformatter_coldfusion_options”:

{

“syntaxes”: “coldfusion,cfm,cfml”, // Syntax names which must process Coldfusion Markup Language formatter

“format_on_save”: false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : “^((?!.min.|vendor).)*$”

“indent_size”: 2, // indentation size

“indent_char”: ” “, // Indentation character

“indent_with_tabs”: false, // Indent with one tab (overrides indent_size and indent_char options)

“exception_on_tag_mismatch”: false, // If the last closing tag is not at the same indentation level as the first opening tag, there’s probably a tag mismatch in the file

“expand_javascript”: false, // (Under construction) Expand JavaScript inside of script tags (also affects CSS purely by coincidence)

“expand_tags”: false, // Expand tag attributes onto new lines

“minimum_attribute_count”: 2, // Minimum number of attributes needed before tag attributes are expanded to new lines

“first_attribute_on_new_line”: false, // Put all attributes on separate lines from the tag (only uses 1 indentation unit as opposed to lining all attributes up with the first)

“reduce_empty_tags”: false, // Put closing tags on same line as opening tag if there is no content between them

“reduce_whole_word_tags”: false, // Put closing tags on same line as opening tag if there is whole word between them

“custom_singletons”: “” // Custom singleton tags for various template languages outside of the HTML5 spec

}

}

sublime text 3 怎么格式化 PHP代码 插件

Ctrl+Shift+P——输入pci回车——输入sublime-phpfmt-for-windows发现找不到该插件——Esc退出——Ctrl+Shift+P——输入pca回车——将该插件的github

原创文章,作者:BZVEN,如若转载,请注明出处:https://www.506064.com/n/128410.html

(0)
BZVENBZVEN
上一篇 2024-10-03
下一篇 2024-10-03

相关推荐

  • Python随机数生成器的种子:提高生成随机数的质量

    在Python中,random模块的使用非常广泛,它提供了许多函数来生成各种类型的随机数。随机数生成器的质量对于许多应用程序来说是至关重要的,因为较低质量的随机数可能导致程序的安全…

    编程 2024-10-03
  • mysql数据库的视图讲解(mysql视图语句)

    本文目录一览: 1、sql中视图与表的区别? 2、数据库(mysql)关键知识 3、MySQL视图 4、什么叫数据库视图 5、mysql 视图 sql中视图与表的区别? sql中视…

    编程 2024-10-03
  • 3dmax怎么贴视频材质,3dmax怎么贴材质

    本文目录一览: 1、3DMAX贴图怎样贴视频 2、急!求教高手,3DMAX中怎样贴上视频 3、3dmax怎么贴vray材质 4、3Dmax怎么加材质? 5、3dmax怎么给模型贴材…

    编程 2024-10-04
  • CentOS chown命令详解

    在Linux系统中,使用chown命令可以更改文件和目录的所有者,可以在一定程度上实现用户和权限的控制。CentOS作为一种常见的Linux发行版,自然也有自己的chown命令。在…

    编程 2024-10-03
  • 第三方接码平台详解

    一、第三方接码平台国外 第三方接码平台是指提供一种虚拟电话号码,供用户注册或绑定时使用,从而达到保护用户隐私的目的。国外的第三方接码平台与国内类似,但操作方法有所不同。在国外,部分…

    编程 2024-10-04
  • 让polkit在Linux系统中为你提供安全性和便利性

    在Linux系统中,要完成一些需要管理员权限的操作,通常需要使用sudo命令或者切换root用户。然而,这样做存在一定的风险,如用户错误使用了sudo导致系统崩溃,或者管理员的密码…

    编程 2024-10-12
  • php地址请求(php获取地址)

    本文目录一览: 1、php如何获取请求接口资源的请求者的IP地址 2、如何用php向服务器发送post请求 3、thinkphp5地址路由请求响应错误 4、php请求url并接收返…

    编程 2024-10-03
  • java接口文档,java接口文档生成

    本文目录一览: 1、java api接口文档怎么编写? 2、根据接口文档怎么使用java写接口 3、java接口文档怎么写 4、java站内信接口调用文档怎么使用 5、Java 请…

    编程 2024-10-04
  • php不为空验证(php判断空)

    本文目录一览: 1、一个表单中多个百度编辑器(UEditor) 怎么验证其内容为空(php) 在线等!! 2、thinkphp自动验证中怎么验证下拉列表不能为空,就是必须要选择一个…

    编程 2024-10-03
  • php环境集成包up(php开发环境安装)

    本文目录一览: 1、PHP是怎么一个开发环境,主要讲下大致的开发步骤啊?谢谢 2、如何同时安装并支持PHP和JSP-JSP编程 3、怎么使用Docker搭建PHP开发环境 4、ph…

    编程 2024-10-03

发表回复

登录后才能评论