Last Updated: September 09, 2019
·
57.71K
· jwebcat

use nano from Git Bash on Windows :D

$ cinst nano

For git bash

  • you can go the gnu nano homepage and download the WinNT/9x binary, .zip format.
    its near the bottom on the left currently.

  • or just type in a cmd or git bash shell

$ curl -L -O http://www.nano-editor.org/dist/v2.2/NT/nano-2.2.6.zip

then unzip the file using

$ unzip  nano-2.2.6.zip -d nano

then

$ mv nano ~/path/to/git/share

and then type echo ' with an open single quote then you can hit enter and get a carriage return then write each line of the file. at the end close with the ' then > fileName ... almost there!

echo '
>#!/bin/sh
>exec /share/nano/nano.exe "$@"
>' > nano

Make sure to save this file with no extension. JUST nano

  • Then move the nano shell script you made to somewhere on your path. You can make a /bin folder in your root and place add it to your path.
$ mv nano ~/bin

Then you can call this script from git bash using just nano.

  • Restart your shell session and type
$ nano fileName
  • and Rejoice with the new ability of nano-power from git bash. Hooray!

10 Responses
Add your response

I tried following the steps. Downloaded and unzipped successfully but get an error when moving nano. it says "mv: cannot move nano to c/users/username/path/to/git/shared"

Any help?
Thanks

over 1 year ago ·

@sadiqsaleem09 It was a typo. I fixed it above please see, it should be path/to/git/share NOT path/to/git/shared . I apologize for the confusion.

over 1 year ago ·

@jwebcat
Thanks for clarifying it. Two things happened. First I got the same error. But I still continued following the later instructions. I was able to create and move the nano shell script. I was able to call the script from gitbash; however there was a delay of 30s. Otherwise nano works perfectly.

over 1 year ago ·

Managed to download and unzip Nano. Wasn't able to move nano. an error said
mv: cannot move nano' to/c/Users/Admin/path/to/git/share'

over 1 year ago ·

I ended up skipping the " mv nano ~/path/to/git/share " step.
Instead I did the following
1) Find the unzipped nano folder from my user root directory "C:\Users\Admin"
2) Find the the GIT directory located C:\Program Files (x86)\Git\share
3) Drag the unzipped nano folder to the Git/share directory
4) continue with tutorial above..

Hope it helps anyone else experiencing the same issue I had.

-Peace

over 1 year ago ·

I think I know what might be the problem with the mv problem. All folders in Program Files need administrative privileges to modify/copy/move files. In theory if you ran Git bash with admin rights it should work.

over 1 year ago ·

@manio143 correct you are my good man

over 1 year ago ·

Selected archive for Windows doesn't work properly.
http://www.nano-editor.org/download.php
This archive works fine.
http://www.nano-editor.org/dist/v2.4/NT/nano-2.4.1.zip

over 1 year ago ·

It worked and I am a total novice! Thanks a lot for the detailed instructions.
The tips in comments helped too.

over 1 year ago ·

All worked fine for me apart when actually using the nano script:

$ nano toto

Tells:

Redirection is not supported

Seems to be a known issue

over 1 year ago ·