How to edit cygwin files using notepad++
So, I’ve been using windows on my new Netbook. This is the first time I’ve really decided to use cygwin for day to day stuff and actually trying to make it productive is quite a work. One of the things I noticed was that the regular editors like vim and emacs had a lot of trouble adapting to cygwin. For example, backspace doesn’t work for vim and Ctrl-X, Ctrl-C combination didn’t work for emacs for me (I even double checked with google to check if my fingers lost their mojo).
I name this file np (in true Unix fashion of naming things as shortly as possible ) and place in my ~/bin for maximum adaptability.
#!/bin/bash
# Edit your cygwin files in notepad++, the best windows editor.
# Vim and emacs don't seem to work too well in cygwin.
ROOT_DIR_WINDOWS=D:\\\\cygwin
expandToWindows() {
y=`echo $1| sed -e 's/\//\\\\/g'`
echo $ROOT_DIR_WINDOWS\\$y
}
expArg=`expandToWindows $1`
echo $expArg
/cygdrive/c/Program\ Files/Notepad++/notepad++.exe $expArg
Just copy this script into your ~/bin or /usr/bin and make it executable to run as
np <file you want to edit>
So, this runs just like any other unix script. I don’t know if you can pass multiple arguments for notepad, if so feel free to extend this piece of code and give me a howler so that I can improve too.
Of course, you can do the same for any other windows application.













You probably want to use something like rxvt or mintty. Both are available in the Cygwin
distribution and will provide a more full-featured terminal environment.
And, as a more general observation: You could also always read the documentation or
ask questions in the forums available at the cygwin web site.