I am using msysgit in Windows 7. How do I invoke notepad++ from Git Bash, like we do it with our default notepad?
Like for example
name@usename notepad textfile.t
The below is listed on Udacity's course on Git and GitHub. It worked for me:
Run the following command in Git Bash after checking the location of Notepad++ on your PC.
echo 'alias npp="C:/Program\ Files\ \(x86\)/Notepad\+\+/notepad\+\+.exe"' >> ~/.bashrc
Notice how I had to escape characters like the space and the brackets. You can escape any character if you're not sure whether it should be escaped or not. Also make sure to use the alias you want; I chose npp.
Close and re-open Git Bash
npp in Git Bash, if it opens then you're good to go. If not, try the below points:Test .bashrc by running the command below in Git Bash
source ~/.bashrc
Retry typing npp to start Notepad++. If Notepad++ doesn't start, check the contents of the file ~/.bashrc created in step 1.
To ensure the .bashrc file contents are loaded each time you open Git Bash, edit ~/.bash_profile and add the following two lines. (Reference)
if [ -r ~/.profile ]; then . ~/.profile; fi
case "$-" in *i*) if [ -r ~/.bashrc ]; then . ~/.bashrc; fi;; esac
Close and re-open Git Bash. Type npp in Git Bash to check it starts correctly.