- 本插件为团队内部打造使用,不对外更新负责,
- 2023年了,前端建议采用VSCode。
- 快捷调出命令输入窗口,自动关闭
- 自定义条数的保留历史记录,支持管理
- 自动读取项目的 scripts 到命令列表快捷调用,当前支持:
- 所有 node 项目
package.json
文件对应的 scripts 字段 - 所有 python 项目的
poetry.toml
对应的 scripts 字段
- 所有 node 项目
- 支持内置调用(阻塞),外置调用(非阻塞)两种方式
# 打开 SublimeText3的插件目录,并在该目录下打开shell
菜单栏 > Preferences > Browse Packages...
# 在插件目录运行shell,下载插件
# gitee
git clone --depth=1 [email protected]:Capsion-ST-PLugins/Run-Command.git cps_run_command
# or github
git clone --depth=1 [email protected]:Capsion-ST-PLugins/Run-Command.git cps_run_command
# 重启ST 通过快捷键调用(前提要打开一个有效文件)
ctrl + f1
快捷键:
alt + f1
:调出插件面板(前提要打开一个有效文件)
# 支持单条命令
npm i
# 支持组合命令
git add . & git cz
mkdir projectName & cd projectName & npm init -y
# 使用 ":" 前缀会创建一个独立的cmd窗口来执行命令
:npm init -y
# 使用 "$" 前缀执行的命令不会记入历史记录,并且命令成功后,窗口自动关闭
$npm init -y
# 不使用任何后缀,会使用sublime内置的命令面板执行命令,无法进行交互
npm init
Packages/User/cps.sublime-settings
// 配置文件
{
"name": "tett 插件",
"author": "CPS",
"mail": "[email protected]",
"cps_run_commands": { // 所有配置都在这个字段内
"default_workspace": ".", // 默认的工作目录
"history_count": 100 // 历史记录数量
"mode_scripts_enable":true, // 读取py和node项目的script字段
"mode_scripts_run_in_new_shell":true, // 脚本通过独立的shell运行,不阻塞sublimetext
}
}
Packages/User/Default.sublime-keymap
[
{
"keys": ["alt+f1"],
"command": "cps_run_commands" // 打开调用窗体
},
{
"keys": ["alt+f2"],
"command": "cps_panel_toggle" // 过往历史信息
},
]
DIR:cps-Run-Command # root
|-- .github/ #
| |-- workflows/ # 「workflows」
| | |-- test.yaml #
| | `-- relese.yaml #
|-- .sublime/ # 「.sublime」默认配置文件存放
| |-- Default.sublime-keymap # 快捷键
| |-- Default.sublime-commands # 默认配置【只读】
| `-- Context.sublime-menu # 右键菜单
|-- core/ # 「core」核心代码
| |-- __init__.py #
| |-- utils.py #
| |-- typing.py #
| |-- shell.py #
| |-- settingManager.py #
| |-- scriptsParser.py #
| |-- history.py #
| `-- .histroy #
|-- screenshot/ # 「screenshot」
| |-- Usage.png #
| |-- step4.gif #
| |-- step3.gif #
| |-- step2.gif #
| |-- step1.gif #
| `-- cps-Run-Command.gif #
|-- scripts/ # 「scripts」
| `-- test.py #
|-- yarn.lock #
|-- README.md #
|-- pyproject.toml #
|-- main.py # 入口代码
|-- .python-version #
`-- .gitignore #
- 373704015 (qq、wechat、email)