To install the latest Nano in Windows-10, follow these steps.
The installation steps are:
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
Download the latest syntax highlighter files (*.nanorc) from here:
https://github.com/scopatz/nanorc
Chose an installation location. For example in C:\nano\.
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
Put the .nanorc into your home directory in C:\Users\<username>\.nanorc.
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")
Either reboot, restart explorer, or install refreshenv from choco.
Optional: Run nano once, to ensure that a filepos_history file is created.
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
- 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!