
本文档介绍了笔者使用 Sublime Text 编辑器进行 Laravel 应用开发时的配置方案。
插件
以下插件显著提升了开发效率:
GitBlameGitGutterAdvancedNewFileSyncSideBarLSPLSP-intelephenseLSP-bashLSP-dockerfileLSP-eslintLSP-jsonVue 语法高亮LSP-slimLSP-tailwindcssTerminusFile IconsCodeiumShellExecute
插件安装方法:使用 cmd + shift + p / alt + shift + p 打开命令面板,选择“安装插件”进行安装。
LSP 配置
LSP 插件依赖 Node.js,请先安装 Node.js:
Intelephense 配置
安装 Intelephense:
npm -g i intelephense
在 Sublime Text 中,打开 Preferences > Package Settings > LSP > Servers > 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:在命令面板中选择 LSP: Enable Language Server。
Sublime Text 设置
使用 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 } ] }, // ... (其余按键绑定保持不变)]
鼠标绑定
添加以下鼠标绑定:
[ { "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} }]
更多细节请访问我的博客原文。
以上就是Sublime Text Config for Laravel的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1252211.html
微信扫一扫
支付宝扫一扫