Fun with Cygwin
I have been using cygwin, well because I have a windows machine basically I have to. In the same time, a co-worker pointed me at the Cygwin Putty patch. This turned out to be a must for me because I was really not liking the cygwin command interface.
One of the nice things about the setup with the Cygwin Putty patch is that you are logged into the system on console, and you’re not doing a trick to ssh back to local host. This opens up some nice possibilities because you can now interact with the system as though you are on console.
The first thing that I did was to create a gvim function:
function gvim {
$GVIM $* &
}
Where I have my gvim installation defined elsewhere. Yeah, this could be done through an alias, and I will probably switch it to that, but now at least gvim functions in cygwin like it does in a linux console situation.
Secondly, if I’m going to use windows, I’m at least going to want to have access to the windows explorer. If you’re on the system, you may as well use the parts of it that you want to your advantage. So I added this function next:
function e {
if [ -z $* ]; then
path=`cygpath -wa $PWD`;
else
path=`cygpath -wa $*`;
fi
explorer /e,/root,$path
}
This allows me to open an explorer with the root dir of the explorer window set to either:
- my current directory (if I do not give a directory as an argument)
- or a directory of my choice that I pass in with the command.
The e function has probably been one of the more useful functions for me in my daily life on a windows box.
No Responses to “Fun with Cygwin”
Comments are closed.