Skip to content

Instantly share code, notes, and snippets.

@magnusbae
Last active August 24, 2018 17:20
Show Gist options
  • Save magnusbae/2e6eeccdbb152099879c to your computer and use it in GitHub Desktop.
Save magnusbae/2e6eeccdbb152099879c to your computer and use it in GitHub Desktop.
Install script and manual instructions for nano + msysgit

#How to install the 'nano' text editor in msysgit

Adapted from https://vijayparsi.wordpress.com/2012/03/07/nano-with-mingw32-for-msysgit/


#Fast and simple install Run msysgit as administrator and copy and paste (insert-key) the following line, press enter. It will execute the install_nano.sh script found at the bottom of this file. If you prefer to install nano manually, the process is described below.

cd /c/Program\ Files\ \(x86\)/Git/ && curl -O https://gist.githubusercontent.com/magnusbae/2e6eeccdbb152099879c/raw/4bb0c07cea1e1e6e1e56527467f547804b218a66/install_nano.sh && chmod +x install_nano.sh && sh install_nano.sh

#Manual install procedures ##Download nano

Download the latest nano binary from here or use the following command:

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

##Unpack nano to %git%/share/nano

My Git install dir is c:\Program Files (x86)\Git, in msysgit (run as administrator):

cd /c/Program\ Files\ \(x86\)/Git/share
mkdir nano
unzip ../nano-2.2.6.zip -d nano

##Create an executable for nano in %git%\bin

Assuming you are still in the share-folder

cd ../bin
vi nano

#paste the following:
#!/bin/sh
exec /share/nano/nano.exe "$@"

#Hit escape followed by: 
:wq

chmod +x nano

Voilà, you are done! :)

NANO_VERSION="2.2.6"
curl -O http://www.nano-editor.org/dist/v2.2/NT/nano-$NANO_VERSION.zip
mkdir -p share/nano
unzip nano-$NANO_VERSION.zip -d share/nano
printf '#!/bin/bash \nexec /share/nano/nano.exe "$@"' > bin/nano
chmod +x bin/nano
echo -e "Nano installed, enjoy!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment