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
Thank you so much. This is the clearest and best explanation on the web.
Brilliant!! Worked a dream (after including \(x86\) in the paths in my case). Thank you!!!
Is there any way to do the same thing for MobaXterm
You can probably figure out a way to hook into the launch of MobaTextEditor and replace that with the Notepad++ shell.