導航:首頁 > 編程語言 > sublimetext2php配置

sublimetext2php配置

發布時間:2023-08-31 14:28:42

A. sublime text2寫php,有哪些值得推薦的插件

以下都是說的sublime text 3,有的插件在st2裡面找不到。我默認認為樓主已經安了插件中心。
前端插件
emmet:前端神器,網上介紹一大把。這個插件在2裡面叫zen coding
css format:css格式化,支持幾種格式方式
jquery:jquery提示插件
jsFormat:js和jquery壓縮插件
php插件
docBlock:類、控制器、方法等的文檔生成器,輸入/**之後回車即可
sublimeCodeIntel:PHP代碼提示,可以提示相應類裡面的方法、變數等等

B. 如何在Sublime text中運行PHP文件

一、將PHP安裝目錄放如環境變數PATH
二、添加PHP的build system
1)進入如下菜單:
2)彈出內容如下:
{
"cmd": ["make"]
}
修改為:
{
"cmd": ["php", "$file"],
"file_regex": "php$",
"selector": "source.php" }
3)保存在默認的目錄下即可,注意修改文件名為 php.sublime-build 。
執行快捷鍵為Ctrl+B。
你還不明白的話可以去後盾網去問問專家教師,他們一定會的,這樣不就行了,如果嫌棄麻煩可以上後盾人,找找相關教材視頻看看,不就會了,希望能幫到你,給個採納吧謝謝

C. 有哪些sublime text 2 PHP插件推薦

ZenCoding
html及css編碼利器,安裝成功後,默認快捷鍵為Tab,在Sublime下 按 Ctrl+Alt+Enter 後輸入標簽可以實時對展開代碼進行預覽2)。
SublimeCodeIntel
可以對代碼進行提示補全及跟蹤,個人非常喜歡其對javascript的補全,太給力了!
代碼提示
安裝後,默認情況下即可對系統函數進行提示補全,不過如果想要更強悍的功能,還要進行配置,這里以php為例,打開插件安裝目錄下的.codeintel/config文件,添加如下代碼3):
{
"PHP": {
"php": 'D:\Wamp\php\php.exe',
"phpExtraPaths": [],
"phpConfigFile": 'D:\Wamp\php\php.ini'
}
}

函數跟蹤
這個功能在大型的IDE裡面比較通用,就是可以方便的查看函數定義的文件及函數的具體內容。游標放置到函數上,Alt+左鍵點擊 即可打開函數定義的頁面找到該函數定義的具體位置,也可使用 Ctrl+F3 來打開。
JS Format
一個JS代碼格式化插件。操作快捷鍵是Ctrl+Alt+f

DetectSyntax
這是一個代碼檢測插件,自動檢測當前載入文件的文檔類型。
Bracket Highlighter
類似於代碼匹配,可以匹配括弧,引號等符號內的范圍。
GOto-CSS-Declaration
點擊html文檔中的類或ID,直接跳轉到對應css文檔中的定義位置,前提是這個css文檔必須是打開的。
GBK Encoding Support
sublime本身不支持GBK,根據國情,裝下這個插件就可以支持GBK了,同時也提供GBK與UTF之間轉換。
JS Minifer
提供js壓縮功能,基於GG的closure complier,快捷鍵:ctrl+alt+M

prefixr
提供CSS3屬性的瀏覽器前綴自動填充像-webkit- -moz- -o- -m-, 快捷鍵:ctrl+alt+x

html5
html5 該插件提供許多 html5相關的標簽等snippets,也非常實用。
SFTP
插件提供ftp伺服器管理,通過配置來操作。可以對不同項目進行不同的設置。

1) 其實可以通過每個插件裡面的說明文檔或配置文件來進行查看的
2) 代碼具體格式含義請看說明文檔

D. 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)
"rece_empty_tags": false, // Put closing tags on same line as opening tag if there is no content between them
"rece_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 mole 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)
"rece_empty_tags": false, // Put closing tags on same line as opening tag if there is no content between them
"rece_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
}
}

閱讀全文

與sublimetext2php配置相關的資料

熱點內容
36位單片機 瀏覽:428
英雄聯盟山東伺服器地址 瀏覽:212
sd伺服器什麼意思 瀏覽:617
thinkphp去indexphp 瀏覽:62
電腦顯示連接未加密 瀏覽:193
zao伺服器怎麼修改 瀏覽:244
php使用jsapi調起支付 瀏覽:891
vivo雲伺服器網 瀏覽:722
cmd遠程連接命令行 瀏覽:961
黑馬python講義 瀏覽:133
php高並發測試 瀏覽:88
第二屆程序員節開幕式 瀏覽:84
運維程序員腳本 瀏覽:371
塑源碼燕窩的安全性 瀏覽:176
作業調度採用高響應比優先調度演算法 瀏覽:160
和平精英如何切換蘋果到安卓 瀏覽:532
資料庫調用表單的命令 瀏覽:923
程序員技能大賽 瀏覽:11
什麼app買品牌衣服 瀏覽:15
手機看世界名著哪個app好 瀏覽:495