1

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!

Maai
  • 349
  • 3
  • 12
  • 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). – cardiff space man Aug 14 '14 at 10:07

3 Answers3

3

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.

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • 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 Jun 15 '14 at 05:19
  • 1
    @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 (https://github.com/msysgit/msysgit/blob/master/git-cmd.bat) – VonC Jun 15 '14 at 05:21
  • 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`. – David Ferenczy Rogožan Aug 07 '14 at 16:01
  • @Daw true, but it has been years since I've last used the cygwin version of git. – VonC Aug 07 '14 at 16:03
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.

Community
  • 1
  • 1
David Ferenczy Rogožan
  • 18,863
  • 8
  • 68
  • 65
  • 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. – cardiff space man Aug 14 '14 at 10:15
  • 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. – David Ferenczy Rogožan Aug 14 '14 at 12:17
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
Benjamin Zach
  • 813
  • 11
  • 27
freebeing
  • 1
  • 1