Cygwin Tutorial: Use External Editor Notepad++

Comments 2 Standard
cygwin gulp console cli command line

Open your .baschrc file in your home directory and add these commands at the bottom of the file. You can modify any of the options being passed to notepad++ as well. By default this allows multiple instances, turns off sessions and disables plugins. You might have to update the path to notepad++ so it matches where you have it installed on your computer:

#allows you to execute the command npp filename.ext
npp () {
/cygdrive/c/Program\ Files/Notepad++/notepad++.exe -multiInst -nosession -noPlugin $(cygpath -w -- "$@")
}
#launches all typical vi commands in notepad++
vi () {
/cygdrive/c/Program\ Files/Notepad++/notepad++.exe -multiInst -nosession -noPlugin $(cygpath -w -- "$@")
}

Now restart cygwin for your changes to take effect. Test it out by running these commands!

$ vi test.php
$ npp test.php
Advertisements

2 thoughts on “Cygwin Tutorial: Use External Editor Notepad++

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s