Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

notepad++ not working in Git Bash

Tags:

git

notepad++

I'm on windows 7 64 bit os and I'm trying to setup notepadd++ as my tex teditor in Git Bash

here's what I've already done

  1. git config --global core.editor "\"C:/Program Files (x86)/Notepad++/notepad++.exe\" -multiInst -notabbar -nosession -noPlugin"

  2. set up notepadd++ in my system variables

now, when I try to edit a file (i.e. notepad++ myfile), it says command not found. even when I try just to open notepad++, it says command not found

I'm totally new in Git and I think I'm totally lost in what I'm doing. What I basically want is to get my notepad++ work with Git Bash

Please help. Thanks!

like image 989
Maai Avatar asked May 29 '26 21:05

Maai


2 Answers

You can use a combination of double and single quotes, as in "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"

Note also the use of '/' instead of '\' in this case.

like image 158
VonC Avatar answered May 31 '26 10:05

VonC


You need to convert file path from the Unix/Cygwin format, which Git on Cygwin produces, to the Windows format, which Notepad++ on Windows uses. Otherwise Git on Cygwin will execute Notepad++ like this:

C:/Program Files (x86)/Notepad++/Notepad++.exe /home/user/repository/file.extension`

It's obvious that Notepad++ won't find such file.

See my answer to question How to add split Git diff hunk from cygwin using Windows editor. There is described how to configure it properly.

like image 44
David Ferenczy Rogožan Avatar answered May 31 '26 11:05

David Ferenczy Rogožan