我在Windows 7 64位操作系统上尝试将notepadd ++设置为Git Bash中的tex teditor
这是我已经完成的事情
git config --global core.editor" \" C:/ Program Files(x86)/ Notepad ++ / notepad ++。exe \" -multiInst -notabbar -nosession -noPlugin"
在我的系统变量中设置notepadd ++
现在,当我尝试编辑文件(即notepad ++ myfile)时,它说找不到命令。即使我只是尝试打开notepad ++,也说找不到命令
我在Git中是全新的,我想我完全迷失在我正在做的事情中。我基本上想要的是让我的记事本++与Git Bash一起工作
请帮忙。谢谢!
答案 0 :(得分:1)
您可以使用双引号和单引号的组合,例如" How can I set up an editor to work with Git on Windows?":
git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
还请注意使用' /
'而不是' \
'在这种情况下。
答案 1 :(得分:1)
您需要将文件路径从Cygwin上的Git生成的Unix / Cygwin格式转换为Windows格式,即Windows上的Notepad ++。否则Git on Cygwin将执行Notepad ++,如下所示:
C:/Program Files (x86)/Notepad++/Notepad++.exe /home/user/repository/file.extension`
很明显,Notepad ++找不到这样的文件。
请参阅我对问题How to add split Git diff hunk from cygwin using Windows editor的回答。介绍了如何正确配置它。
答案 2 :(得分:0)
试试这个:
/etc/bash.bashrc
在 windows 中的位置 alias npp=\
"'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
npp ~/.gitconfig
进行测试