# ndd-terminal-plugin **Repository Path**: crazy-geeker/ndd-terminal-plugin ## Basic Information - **Project Name**: ndd-terminal-plugin - **Description**: ndd-terminal-plugin是一款Notepad--终端插件,可在Notepad--窗内显示终端命令窗口,可以让使用者不必离开Notepad--即可执行终端命令。 - **Primary Language**: C++ - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 7 - **Forks**: 3 - **Created**: 2023-02-12 - **Last Updated**: 2024-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: ndd, notepad--, Terminal, ndd插件, Notepad--终端插件 ## README # ndd-terminal-plugin ## 介绍 ndd-terminal-plugin是一款Notepad--终端插件,可在Notepad--窗内显示终端命令窗口,可以让使用者不必离开Notepad--即可执行终端命令。 ![ndd-terminal-plugin](images/ndd-terminal-plugin.png#pic-center) ndd-terminal-plugin 支持开启多种终端,每个终端可开启多个实例,支持自由定义终端,支持每种终端定义快捷键。 ### 开发及适用环境 - 开发环境 Visual Studio 2019,Qt为 5.15.2。 - 适用环境 Windows, 64位Notepad--v1.22.2 及以上。 ### 默认支持的终端: - Command Prompt (命令提示符) - PowerShell - WSL #### Command Prompt 窗口 ![Command Prompt](images/cmd.png) #### PowerShell ![PowerShell](images/powershell.png) #### WSL ![WSL](images/wsl.png) ## 配置终端 在 ndd-terminal-plugin 插件安装目录中的 ndd-terminal-plugin.json 文件是本插件的配置文件。每个终端的参数都在此配置。 ```json { "terminals": [ { "name": "Command Prompt", "command": "C:\\Windows\\System32\\cmd.exe", "shortcut": "Ctrl+1" }, { "name": "PowerShell", "command": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe", "shortcut": "Ctrl+2" }, { "name": "Ubuntu", "command": "C:\\Windows\\system32\\wsl.exe -d Ubuntu", "shortcut": "Ctrl+3" } ] } ``` > terminals 终端列表,其中每一项表示一个终端的配置。 > name 终端名称,显示在菜单中,终端窗口标题。command 打开终端的命令。shortcut 终端快捷键。 ### 示例1,配置ESP32嵌入式编译环境 菜单和窗口名称为ESP32-IDF,快捷键Ctrl+E。安装ESP32-IDF提取出ESP32-IDF命令行作为command。配置如下: ```json { "terminals": [ { "name": "Command Prompt", "command": "C:\\Windows\\System32\\cmd.exe", "shortcut": "Ctrl+1" }, { "name": "PowerShell", "command": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe", "shortcut": "Ctrl+2" }, { "name": "Ubuntu", "command": "C:\\Windows\\system32\\wsl.exe -d Ubuntu", "shortcut": "Ctrl+3" }, { "name": "ESP32-IDF", "command": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Bypass -NoExit -File E:\\mcu_ws\\esp32\\Espressif\\Initialize-Idf.ps1 -IdfId esp-idf-10828de56b3c63e0d967fab18296358f", "shortcut": "Ctrl+E" } ] } ``` 效果: ![ESP32嵌入式编译环境效果预览](images/ESP32-IDF.png) ### 示例2,配置Python控制台 菜单和窗口标题为Python 3.10,Python路径为C:\\Python310\\python.exe,作为command,快捷键是Ctrl+P。 ```json { "terminals": [ { "name": "Command Prompt", "command": "C:\\Windows\\System32\\cmd.exe", "shortcut": "Ctrl+1" }, { "name": "PowerShell", "command": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\PowerShell.exe", "shortcut": "Ctrl+2" }, { "name": "Ubuntu", "command": "C:\\Windows\\system32\\wsl.exe -d Ubuntu", "shortcut": "Ctrl+3" }, { "name": "Python 3.10", "command": "C:\\Python310\\python.exe", "shortcut": "Ctrl+P" } ] } ``` 效果预览 ![Python控制台效果预览](images/python.png) ## 插件安装 1. 下载 ndd-terminal-plugin-1.2.0.1_x64.zip。 2. 解压出 ndd-terminal-plugin.dll 和 ndd-terminal-plugin.json 放入 notepad-- 安装目录下的plugin目录下。 3. 重启notepad--。 4. 单击 notepad-- 菜单"插件" -> “Terminal Plugin”。