GNU Nano for Windows is a port of the popular GNU nano text editor, designed for use in a terminal environment on Windows systems. It offers a lightweight and user-friendly experience, ideal for developers and users familiar with command-line interfaces.
Key Features:
Unicode/UTF-8 Support: Ensures compatibility with various character encodings.
Syntax Highlighting: Enhances readability by highlighting code syntax.
Nanorc Support: Allows customization through configuration files.
Spell Checker and Formatter Integration: Improves text quality with external tools.
Full Keyboard Binding Support: Includes advanced key combinations like M-X rebindings.
Mouse Support: Facilitates navigation and selection within the terminal.
Audience & Benefits:
Ideal for developers and users who prefer command-line environments on Windows, GNU Nano for Windows provides a consistent experience with its Unix counterpart. Users benefit from advanced features such as syntax highlighting and ease of use through consistent key bindings, making it a powerful yet lightweight text editor.
Installation is straightforward via winget: winget install chawyehsu.nano. This tool offers a reliable and efficient solution for editing text files directly from the command line.
Spell checker and Formatter support (only external spell checkers)
Full keyboard binding support
For M-X rebindings, full support for all characters in
the ASCII range is now available. This means you can configure
and use key combinations such as M-<, M-=, M-@, etc.,
with more consistent key bindings with the nano on Unix.
For M-X rebindings, only the left Alt key is now captured.
This means you can still type less frequently used characters
using the right Alt as AltGr key even if you have configured
many key combos of Alt. This is especially crucial for users
with keyboard layouts such as US International and German.
Most key combinations related to Backspace, Del, and the
arrow keys now behave consistently with the nano on Unix.
positionlog support (Saved anchors restored when file is reopened, v8.5+)
Copy/paste support
Mouse support
Install
Winget
winget install chawyehsu.nano
Conda
Pre-built artifacts of nano-for-windows are available on chawyehsu's conda
channel. You can install it with pixi or conda/mamba.
pixi global install nano -c chawyehsu -c conda-forge
Or you may download the pre-built artifact from GitHub Releases, extract the
files to a directory and add the bin directory to your PATH environment variable.
Then run nano --version to verify the installation.
jj git clone https://github.com/chawyehsu/nano-for-windows
cd nano-for-windows
pixi install
pixi run setup
# First build
pixi run build
# Make new patches to the source code, then rebuild
pixi run rebuild
# Collect and update patches
# jj describe "win32: ..."
# git format-patch [--start-number M] -N HEAD
# mv *.patch patches/latest/
Knowledge
GNU nano has been ported to Windows by different developers at different times.
However, existing ports are either no longer maintained or rarely updated, or
they contain problems that the porters were unwilling to address. Therefore, I
decided to port and maintain my own edition.
Build Pipeline
The pre-built artifacts provided in this repository are built with the conda-forge
ecosystem, and then reuploaded to GitHub Releases. The recipe is available on the
repo chawyehsu/conda-recipes, build logs are also available there.