我需要的是 Git Bash 中的命令,它将在 Notepad++ 中打开文件(txt、html、php..)。就像当我notepad test.txt在记事本中输入 test.txt opens 时一样,我想要类似的命令,比方说npp test.txt它将在 Notepad++ 中打开 test.txt 。我用的是Win7(64)。
npp我在 Notepad++ 安装目录中 创建一个名为的文件。npp里面有以下内容:
#!/bin/sh
"c:/Program Files (x86)/Notepad++/notepad++.exe" -multiInst -notabbar -nosession -noPlugin "$*"
Run Code Online (Sandbox Code Playgroud)
然后将 Notepad++ 安装添加到您的 PATH 中。
现在,在 git bash 中,您可以使用如下命令: npp foo.txt启动 Notepad++ 编辑 foo.txt。