ee-law
Last Updated: March 02, 2016
·
27.9K
· jwebcat
70e1167dbde5397557b0ec6fabb3d90a

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!
Say Thanks
Respond

10 Responses
Add your response

11033
F7e8570d608069e78a53e213696e9f96

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 ·
11034
70e1167dbde5397557b0ec6fabb3d90a

@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 ·
11037
F7e8570d608069e78a53e213696e9f96

@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 ·
17833
None

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 ·
17834
None

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 ·
18798
None

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 ·
18800
70e1167dbde5397557b0ec6fabb3d90a

@manio143 correct you are my good man

over 1 year ago ·
21122
None

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 ·
21523
None

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 ·
26510
None

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 ·
Filed Under