git修改默认编辑器为notepad++
一开始用这个命令,发现没有生效。
git config --global core.editor "\"C:/Program Files (x86)/Notepad++/notepad++.exe\""
报错信息:
hint: Waiting for your editor to close the file... C:\Program Files (x86)\Notepad++\notepad++.exe: -c: line 1: syntax error near unexpected token `('
C:\Program Files (x86)\Notepad++\notepad++.exe: -c: line 1: `C:\Program Files (x86)\Notepad++\notepad++.exe "$@"'
error: There was a problem with the editor 'C:\Program Files (x86)\Notepad++\notepad++.exe'.
后面找到git的配置文件
C:\Program Files\Git\etc\gitconfig
发现里面生成的配置是
[core]
editor = \"C:\\\\Program Files (x86)\\\\Notepad++\\\\notepad++.exe\\\\" -multiInst -notabbar -nosession -noPlugin
然后我把斜杠都改成了反斜杠/
editor = \"C:/Program Files (x86)/Notepad++/notepad++.exe\" -multiInst -notabbar -nosession -noPlugin
就可以了