Install nano editor in your cygwin terminal – Windows Operating System


It just happened that I worked a small personal project using windows 7 operating and having issue with cygwin default editor vim, when casting my terminal.

git commit -a

It will open vim editor by default.

I don’t like or use vim.. not today… maybe I will learn someday?.

so I need nano badly in terminal.

by default the vim is what installed in cygwin.

Usually I used nano in my linux environment.

but aside from that I do have window 7 computer and sometimes i do work using that computer, so I used cygwin as my terminal.. but there is NO nano editor installed.

To install nano see below

First is download cygwin setup here: https://cygwin.com/install.html

then open your cmd terminal in your windows OS.

then locate the cygwin setup you just downloaded

in my case:

C:\Users\<username>\Downloads\Programs>setup-x86_64.exe

then run command

C:\Users\<username>\Downloads\Programs>setup-x86_64.exe -q -P wget,tar,qawk,bzip2,subversion,vim, nano

other packages are optional you can exclude those, for me I just need nano

Ok now, wait until it finish downloading.

Once all good.

then lets set nano as default editor in your cygwin terminal

first is you need to open bashrc:

nano ~/.bashrc

Now to change your bash default editor find.

export EDITOR

However, if you can’t find that, just add this to the top.

export EDITOR=nano

# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.

save it!.

close cygwin and now your are good to go.

see images below

It’s now default to nano: