3

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!

1
  • Are you trying to figure out why notepad++ somefilename.ext doesn't work from "git bash" window on Windows? If so, you should show the result of echo $PATH from your git bash window in your question (or in a comment). Commented Aug 14, 2014 at 10:07

4 Answers 4

8

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Ive already tried all of those options but still not working for me. I know i can open files in windows explorer but its really frustrating to not get this simple thing working :(
@Maai try it in a non-git-bash, that is in a regular cmd session, launched with git-cmd.bat which is included in your msysgit installation (github.com/msysgit/msysgit/blob/master/git-cmd.bat)
This could work with Windows' version of Git, but not with Cygwin's version, because Cygwin's Git would execute Notepad++ with Cygwin's path to the file: notepad++.exe /home/user/repository/file.extension. I'm sure Windows Notepad++ won't find such file. Even if you have you repo outside Cygwin's directories, it would look like this: notepad++.exe /cygdrive/d/repository/file.extension.
@Daw true, but it has been years since I've last used the cygwin version of git.
1

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.

2 Comments

I think "git bash" is a third way to run and control Git on Windows, and it's not CygWin at all. The tutorial I just now watched on "git bash" showed a "mingw32" window started up.
Yes, but in fact, mingw32 is Cygwin, because it was forked from Cygwin long time ago (from Cygwin version 1.3 AFAIK). But it's possible that Git compiled in mingw32 environment was modified to use Windows' paths.
1

in my case worked adding single quotes around the windows path, due to spaces it was giving me the same error message, so I used:

git config --global core.editor "'c:\Program Files\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin"

and it started working

Comments

0

try this:

  1. find the place which the /etc/bash.bashrc is in windows
  2. add a notepad++ alias at the end of bash.bashrc, like this:
    alias npp=\
    "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
  1. you can use npp ~/.gitconfig to test

Comments

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.