原帖在这里
下面是我使用 Sublime Text 编辑器开发 Laravel 应用程序时使用的配置。
要安装插件,请使用 cmd shift p / alt shift p 打开命令面板,然后选择“安装插件”。
LSP 插件需要 Node.js,因此第一步是安装 Node.js。
安装指南:https://github.com/nvm-sh/nvm#installing-and-updating
使用指南:https://github.com/nvm-sh/nvm#usage
安装后,运行以下命令:
npm -g i intelephense
打开菜单LSP>;服务器> “Package Settings”下的 LSP-intelephense 并配置如下:
{ "enabled": true, "command": [ "intelephense", "--stdio", ], "scopes": ["source.php", "embedding.php"], "syntaxes": ["Packages/PHP/PHP.sublime-syntax"], "languageId": "php", "initializationOptions": { "clearCache": false, "licenceKey": "", }, }
打开命令面板并选择启用 LSP:启用语言服务器。
使用 cmd , / alt ,:
打开
{ "ignored_packages": [ "Git", "Git blame", "GitGutter", "Vintage", ], "save_on_focus_lost": true, "shell_exec_executable": "/bin/zsh", "shell_exec_output": "panel", "shell_exec_output_word_wrap": false }
[ { "command": "lsp_symbol_definition", "args": { "side_by_side": false }, "keys": [ "super+enter" ], "context": [ { "key": "lsp.session_with_capability", "operator": "equal", "operand": "definitionProvider" }, { "key": "auto_complete_visible", "operator": "equal", "operand": false } ] }, { "command": "lsp_format_document", "keys": [ "super+shift+'" ], "context": [ { "key": "lsp.session_with_capability", "operator": "equal", "operand": "documentFormattingProvider | documentRangeFormattingProvider" } ] }, { "keys": ["super+b"], "command": "toggle_side_bar" }, { "keys": ["super+t"], "command": "toggle_terminus_panel" }, { "keys": ["super+shift+o"], "command": "close_all" }, { "keys": ["super+shift+t"], "caption": "Terminus: Open Default Shell in Split Tab", "command": "terminus_open", "args": { "post_window_hooks": [ ["carry_file_to_pane", {"direction": "down"}] ] } }, { "keys": ["super+shift+;"], "command": "shell_exec_run", "args": { "format": "./vendor/bin/pint" } } ]
[ { "button": "button1", "count": 1, "modifiers": ["super"], "press_command": "drag_select", "command": "lsp_symbol_definition" }, { "button": "button1", "count": 1, "modifiers": ["ctrl"], "press_command": "drag_select", "press_args": {"additive": true} } ]
规范 URL
欲了解更多详细信息,请访问我博客上的原始帖子。
以上是Laravel 的 Sublime Text 配置的详细内容。更多信息请关注PHP中文网其他相关文章!