13

Didn't DOS used to have an "edit" or something? I'm used to nano, like nano, and want to use nano. Does it install on Windows 10?

https://showtop.info/install-nano-text-editor-windows-10-command-prompt/

The download brought me to some spam, and this generally seems like a good way to get a virus. Going to the website for nano:

https://www.nano-editor.org/

I, at least, am not seeing a download link for Windows. I'm using a Surface 3 (regular, not pro) which runs Windows 10, for what it's worth.

Seems that the "download" link to (something) doesn't work:

https://superuser.com/q/200109/55747

Ola Ström
  • 479
  • 1
  • 4
  • 16
Thufir
  • 1,490
  • 7
  • 36
  • 57
  • 1
    Yes, I used to use `edit` in the _MicroSoft_ _Disk Operating System_ Version 3.0 when I first started fiddling around Personal Computers, Twenty-Seven Years Ago. I have not found it myself in the contemporary era. I am using the _CygWin_ Thingy. It is quite cool. In less than a Hundred Giga-Bytes of Data, it has you-name-it. You can play with `nano` also using [its version](https://www.nano-editor.org/dist/win32-support/). I am myself using `joe` from time to time. But it is quite safe to create an `alias` for the _NotePad++_ Editor and start it from the Command-Line with the `&` Operator. –  Oct 18 '19 at 21:21
  • 1
    [Cygwin Package Summary for nano](https://cygwin.com/packages/summary/nano.html) – DavidPostill Oct 19 '19 at 20:23
  • going off topic, but cygwin has advantages over the linux sub-system? – Thufir Oct 20 '19 at 18:30
  • cygwin is emulated so the performance will be very slow compared to WSL which runs native. – madacoda Apr 29 '20 at 17:11
  • simpler than cgwin is probably to just use `emacs` – Thufir May 31 '20 at 07:39

9 Answers9

23
  1. Install Chocolatey using Powershell:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

(See also chocolatey.org for more info)

  1. Run choco install -y nano.
  2. Run nano: nano.
cowlinator
  • 734
  • 1
  • 8
  • 16
  • 4
    Perfect!!! Voted up and **this must be answer**. Thanks... – Jack Oct 31 '20 at 14:53
  • 2
    download from https://www.nano-editor.org/dist/v2.5/NT/nano-2.5.3.zip and put the file inside C:\Program Files\Git\bin would also work – Kardi Teknomo Jan 06 '21 at 04:23
  • @KardiTeknomo, that is a good answer. You should submit it as an answer. – cowlinator Feb 26 '21 at 21:58
  • 1
    It's the answer, installed nano succefully on windows 10, thanks – Mahefa Aug 30 '21 at 11:11
  • Thanks, the first command has slighly changed: ``Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))`` – pabloasc Apr 11 '22 at 19:40
  • @pabloasc , I updated my answer – cowlinator Apr 11 '22 at 21:07
9

In 2022 you can just easily install Nano via WinGet, which is Windows' package manager.

Open command prompt as admin and type this in:

winget install GNU.Nano
Pop Car
  • 191
  • 1
  • 2
  • This answer should be on the top. – Imran Jan 25 '23 at 10:49
  • Thank you. It worked. Just after install nano was not recognized, had to add c:/program files/WindowsApps to the PATH – Laurent Feb 02 '23 at 04:33
  • Also worked great for me, but instead of changing the PATH variable myself, I had to change the name of the executable because it was something like `nano-git-adlj223h.exe` (it had some letters and numbers) and it wouldn't get picked up by my PS. The executable was at `~\AppData\Local\Microsoft\WinGet\Packages\GNU.Nano_Microsoft.Winget.Source_8wekyb3d8bbwe` – vinkomlacic Feb 20 '23 at 08:54
  • @vinkomlacic There should have been symlink created at ~\AppData\Local\Microsoft\WinGet\Links name nano, pointing to the file. It would be better for you to make that rather than rename the package. – Varad Mahashabde Mar 27 '23 at 20:56
4

I highly recommend installing Windows Subsystem for Linux, rather than install individual linux tools in the Windows Command line

Seeing as you are already on Windows 10, this shouldn't be a problem.

See the above link for instructions. But at a high level 1. Enable WSL through a Powershell command 2. Install Debian or Ubuntu from the Microsoft Store 3. Launch Debian/Ubuntu from the Start Menu 4. Run 'sudo apt install nano' if it is not installed by default

If you combine WSL with the new Microsoft Terminal, I think you'll find it works much better than most of the older emulated terminals like Cygwin, Xterm, etc.

But if for some reason you can't install WSL, then Cygwin is the next best thing. It does not have a package repository so you have to select 'nano' during installation as one of the optional components.

madacoda
  • 435
  • 1
  • 3
  • 10
  • yeah...in this case it's a tablet/tochscreen thing, resource constrained. a microsoft surface 3 with 4gb ram. it pokes along. – Thufir May 27 '20 at 02:01
  • Now 9 months later, I would go for WSL2. I works like a charm. I installed using this article: https://www.omgubuntu.co.uk/how-to-install-wsl2-on-windows-10. WSL2 needs at least Windows 10 1903. If you are on an earlier version it can easily be upgraded using Windows Update Assistant before installing WSL2. – HVL71 Feb 26 '21 at 15:51
2

So, this is what I did to use nano via cmd.

You'll find nano.exe in Git\usr\bin (you'll need to have git installed, and you most likely will have). For me, the absolute path is C:\Git\usr\bin. Just add it to Path variable. Then, you'll be able to call nano from anywhere via cmd.

This way you won't have to scour the internet looking for nano.exe.

void
  • 21
  • 2
1

Follow below steps:

  1. download the nano*.exe file from internet
  2. keep it in a nano folder
  3. give the path of this nano.exe file in the env variables (user variables).
  4. Open cmd prompt and type: nano script.sh
  5. command in step 4 will open a nano editor.
Michel de Ruiter
  • 1,118
  • 13
  • 23
  • 1
    but where is the nano binary for windows? – Thufir May 27 '20 at 01:59
  • You can find nano binaries for Windows (a.k.a. "NT") at https://nano-editor.org/dist/ . You might have to dig around. For instance, you can find windows binaries for version 2.5 at https://nano-editor.org/dist/v2.5/NT/ , but there doesn't seem to be one for version 5.0 . – cowlinator Nov 04 '20 at 20:54
0

There are actually some links and older builds on https://www.nano-editor.org/ but it's not immediately obvious where to look:

  • Get Nano
  • Hit "All Versions: The Packages"
  • v2.5
  • NT
  • nano-2.5.3.zip

Or: https://nano-editor.org/dist/v2.5/NT/

0

To install the latest Nano in Windows-10, follow these steps.

The installation steps are:

  1. Download the latest Nano build (e.g. nano-win_9931_v6.0-14-g010f69c0e.7z) from here:
    https://files.lhmouse.com/nano-win/ OR
    https://github.com/lhmouse/nano-win

  2. Download the latest syntax highlighter files (*.nanorc) from here:
    https://github.com/scopatz/nanorc

  3. Chose an installation location. For example in C:\nano\.

  4. Extract the contents into that directory and move it around so that you have:

#7z x nano-win_9931_v6.0-14-g010f69c0e.7z

# Do some manual moving around here, to get:

C:\nano\bin\       # For the nano.exe
C:\nano\nanorc\    # For all the *.nanorc files
C:\nano\doc\       # For the documentation files
  1. Put the .nanorc into your home directory in C:\Users\<username>\.nanorc.

  2. Add the nano file paths to your System Path, like this:
    Open an elevated Powershell, and run:

# To set and update the Windows (System) "Path" in Powershell, use:
[System.Environment]::SetEnvironmentVariable("PATH", $Env:Path + ";C:\nano\bin", "Machine")
  1. Either reboot, restart explorer, or install refreshenv from choco.

  2. Optional: Run nano once, to ensure that a filepos_history file is created.

  3. You probably want to be able to run Nano with both normal or Administrator privileges, but not having to keep track of more edit locations and 2nd config files. To do this, you need to symlink your own versions of the nano config and history setting files, to the admin versions.

    (For more details see the related github issues here.)

# Link last cursor position files:
New-Item -ItemType SymbolicLink -Path "C:\ProgramData\.local\share\nano\filepos_history" -Target  "C:\Users\<username>\.local\share\nano\filepos_history" -Force
# Link .nanorc files:
New-Item -ItemType SymbolicLink -Path "C:\ProgramData\.nanorc" -Target  "C:\Users\<username>\.nanorc" -Force
  1. IMPORTANT! Edit your .nanorc to include the correct POSIX paths to all your *.nanorc files.
# Why not use nano to edit your .nanorc
cd ~
nano .nanorc

# Add the following line(s):
#include "C:\nano\nanorc\*.nanorc"     # Windows paths does NOT work!
include "/nano/nanorc/*.nanorc"        # This works!

Enjoy!

not2qubit
  • 1,993
  • 4
  • 28
  • 35
0

get micro. It is way better, and windows native. Also better in linux.

Shinubi
  • 1
  • 1
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/1168052) – Toto Jan 19 '23 at 17:14
-5
  1. Download nano-git-0d9a7347243.exe and rename download to nano.exe, moving it to C:\Windows.
  2. Download Nano zipfile, unzip, and move cygwin1.dll to C:\Windows.
  3. Press Win+R and open cmd and use Nano like in Linux: nano text.txt
gronostaj
  • 55,965
  • 20
  • 120
  • 179
  • 3
    Moving custom stuff into `C:\Windows` is a bad idea. It's a system location, leave it alone. Instead add nano's path to `%PATH%` variable. – gronostaj Jan 10 '20 at 10:03
  • Of course you can use %PATH% variable (it is right way). But the option I proposed is taken from the instruction on the nano website. README.TXT from the 2 paragraph **zip**: "INSTALL ------- - Copy cygwin1.dll somewhere where Windows will be able to see it (C:\WINNT or C:\WINNT\SYSTEM32 is good for NT users and C:\WINDOWS or C:\WINDOWS\SYSTEM are good for WIn9x users. You can always leave it in the same directory as the nano executable if you're really lazy. - Put the nano.exe executable somehwere useful (your desktop or C:\WINDOWS perhaps) - Have fun with it." – Николай Владимирович Jan 11 '20 at 13:58
  • 4
    Those instructions are written with 20 years old OS in mind. Nowadays they are outdated and should not be followed or recommended. – gronostaj Jan 11 '20 at 16:05