This tutorial shows you how to install and open Nano Editor on Windows

Windows Nano Installation

Multiple ways we can install

  • Use Chocolatey

  • Windows + Start, Select Windows Powershell, Right Click on it, Select Run as Administrator

    Type choco, in the prompt, it gives Chocolatey version.

  PS C:\WINDOWS\system32> choco
Chocolatey v2.1.0
Please run 'choco -?' or 'choco <command> -?' for the help menu.

If the above commands give an error, please install choco with the below command in the prompt

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

Once, Choco is installed, Run choco install nano -y to install the nano editor

PS C:\WINDOWS\system32> choco install nano -y
Chocolatey v2.1.0
Installing the following packages:
nano
By installing, you accept licenses for the packages.
Progress: Downloading nano-win 7.2.36... 100%

nano-win v7.2.36 [Approved]
nano-win package files install completed. Performing other installation steps.
An attempt to get headers for https://files.lhmouse.com/nano-win/nano-win_10191_v7.2-36-g639dc4989.7z failed.
  The remote file either doesn't exist, is unauthorized, or is forbidden for url 'https://files.lhmouse.com/nano-win/nano-win_10191_v7.2-36-g639dc4989.7z'. Exception calling "GetResponse" with "0" argument(s): "The remote name could not be resolved: 'files.lhmouse.com'"
Downloading nano-win
  from 'https://files.lhmouse.com/nano-win/nano-win_10191_v7.2-36-g639dc4989.7z'
Progress: 100% - Completed download of C:\Users\Kiran\AppData\Local\Temp\chocolatey\nano-win\7.2.36\nano-winInstall.zip (664.31 KB).
Download of nano-winInstall.zip (664.31 KB) completed.
Hashes match.
Extracting C:\Users\Kiran\AppData\Local\Temp\chocolatey\nano-win\7.2.36\nano-winInstall.zip to C:\ProgramData\chocolatey\lib\nano-win\tools...
C:\ProgramData\chocolatey\lib\nano-win\tools
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 ShimGen has successfully created a shim for nano.exe
 ShimGen has successfully created a shim for nano.exe
 The installation of nano-win was successful.
  Software installed to 'C:\ProgramData\chocolatey\lib\nano-win\tools'
Progress: Downloading nano 7.2.36... 100%

nano v7.2.36 [Approved]
Nano package files install completed. Performing other installation steps.
 The installation of nano was successful.
  Software installed to 'C:\ProgramData\chocolatey\lib\nano'

Chocolatey installed 2/2 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

nano is installed, you can create or open existing files, nano command works in the command line.

Nano Close and Open

Editor can be opened with or without opening a file

nano command used to create a file

nano

To Open an existing file, pass the path of the file to the nano command

nano   pathfile

You can specify the absolute or relative path of a file

nano c:\test.txt

To exit the nano editor

  • Ctrl + X to exit the editor
  • Asks for whether to save changes Yes or No.
  • On selecting one i.e yes, It closes the Nano editor