17

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

Thufir
  • 1,808

9 Answers9

31
  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.

Alternately, if you already have git installed, just run C:\Program Files\Git\usr\bin\nano.exe

16

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
  • 261
3

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
  • 541
  • 1
  • 3
  • 13
3

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
  • 31
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.
1

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
  • 2,651
  • 4
  • 34
  • 45
0

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

-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
  • 58,482