3

I've seen posts about using notepad++ and other editors for git, but not one about using PN2.

I've tried variations on the following, but none of them seem to work:

git config --global core.editor "'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w"

I just get errors like the following (this is after "git commit --amend"):

'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w: -c: line 0:
unexpected EOF while looking for matching `''
'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w: -c: line 1:
syntax error: unexpected end of file
error: There was a problem with the editor ''C:\Program Files (x86)\Programmer's
Notepad\pn.exe -allowmulti' -w'.
Please supply the message using either -m or -F option.

Is it possible to get this to work?

3
  • What do you want to use PN2 for? In general, git does not need an editor, nor care what you do with it, so what you need to explain is: what do you want to use PN2 for, exactly; and where did you use the above command (cmd, powershall, bash) ? Commented Dec 16, 2012 at 13:41
  • 2
    I'm just using windows command line for the command. I want to use pn2 for entering commit messages and interactive rebase. The default git editor using the console seems to break the console. I tried changing to simple notepad (which is what mercurial uses for commit messages windows), but this doesn't work for interactive rebase as it screws up the line endings. Commented Dec 16, 2012 at 13:48
  • Somehow missed the actual git command. I edited it in. :-/ Commented Dec 16, 2012 at 13:52

1 Answer 1

6

The editor is launched by git using bash scripting. So you should ensure your quoting is for the bash shell. You used single quotes but you have an embedded single quote in the directory name. You should probably also use forward slashes and make it unixy. Seethis answer for an example that uses Notepad++. In your case, I think the following should be ok:

git config --global core.editor "\"C:/Program Files (x86)/Programmer's Notepad/pn.exe\" -allowmulti -w"
Sign up to request clarification or add additional context in comments.

1 Comment

Note that the latest versions of Programmer's Notepad require two dashes for allowmulti; e.g. --allowmulti

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.