A lightweight, fast, terminal-based text editor written in Go — inspired by GNU Nano — built specifically for Windows, with native MSI installer support and full PATH integration.
- Overview
- Features
- Project Goals
- Project Structure
- Keyboard Shortcuts
- Installation
- Usage
- Configuration — .nanorc
- Supported Platforms
- Future Improvements
- Contributing
- License
- Author
Nano is a terminal-based text editor written entirely in Go, designed to bring the familiar, keyboard-driven experience of GNU Nano to the Windows ecosystem. It runs entirely in the terminal — no GUI, no dependencies, no bloat.
Whether you're editing config files, writing scripts, or just need a quick way to open and modify text files from the command line, Nano gives you a Unix-like editing experience right inside cmd.exe or PowerShell.
It ships with a WiX v7 MSI installer that registers the nano command system-wide and adds it to your PATH automatically — making it immediately available from any terminal, anywhere on your system.
Nano runs entirely inside the Windows terminal. There are no windows, no graphical elements, and no mouse dependency. Everything is keyboard-driven, keeping you in flow without context-switching.
Open any file directly from cmd.exe or PowerShell using a simple, familiar command:
nano file.txt
nano C:\Users\you\Documents\notes.txtIf the file does not exist, Nano will offer to create it automatically.
- Edit any plain-text file in-place
- Save changes at any time with
Ctrl+O - Exit with
Ctrl+X(with unsaved-changes prompt) - Create new files on the fly by providing a non-existent path
Full cursor navigation using arrow keys, Home, End, Page Up, and Page Down. Move character-by-character, line-by-line, or jump to the beginning/end of a line instantly.
Nano supports a .nanorc configuration file located in your home directory (%USERPROFILE%\.nanorc). You can configure:
- Color themes
- Tab width
- Line number display
- Soft-wrap behavior
- Editor preferences
The MSI installer registers nano as a system-wide command by adding its installation directory to the Windows PATH environment variable — no manual configuration required.
Nano ships with a professional WiX v7-based .msi installer that:
- Installs the
nano.exebinary toProgram Files - Automatically adds the install directory to the system
PATH - Supports clean uninstallation via Windows "Add or Remove Programs"
- Follows Windows installer best practices with GUID-based upgrades
Nano was built with a focused set of principles:
| Goal | Description |
|---|---|
| Linux-like CLI experience on Windows | Bring the speed and simplicity of GNU Nano to Windows terminals without requiring WSL or Cygwin |
| Lightweight and fast | Zero external runtime dependencies. A single statically-linked binary under 10MB |
| Keyboard-driven workflow | All core operations available through intuitive keyboard shortcuts, just like GNU Nano |
| Professional Windows integration | First-class installer via WiX v7 MSI — installs cleanly, uninstalls cleanly |
| Extensible by design | Modular internal architecture makes it easy to add features without rewiring the core |
| Developer-friendly | Written in idiomatic Go; easy to build, easy to fork, easy to contribute to |
nano/
├── main.go # Entry point — parses CLI args, bootstraps the editor
│
├── internal/
│ ├── buffer/
│ │ └── buffer.go # Text buffer management — stores and mutates file content
│ │
│ ├── config/
│ │ └── config.go # .nanorc parser — reads user preferences and theme settings
│ │
│ ├── editor/
│ │ └── editor.go # Core editor loop — coordinates input, render, and buffer
│ │
│ ├── input/
│ │ └── input.go # Keyboard input handler — maps raw key events to editor actions
│ │
│ └── render/
│ └── render.go # Terminal renderer — draws the editor UI to the screen
│
├── wix7/
│ └── nano.wxs # WiX v7 installer source — defines the MSI build configuration
│
├── bin/ # Output directory for compiled artifacts
│ ├── nano.exe # Compiled Windows binary (generated)
│ └── nano.msi # Compiled MSI installer (generated)
│
├── go.mod # Go module definition
├── go.sum # Dependency lock file
├── .nanorc.example # Example configuration file for users
└── README.md # This file
The entry point of the application. Handles command-line argument parsing (file path), loads the configuration, initializes the terminal, and hands control to the editor loop.
Manages the in-memory representation of the file being edited. Handles line splitting, character insertion/deletion, undo history, and serialization back to disk.
Reads and parses the .nanorc file from the user's home directory. Exposes a typed Config struct that the rest of the application uses for behavioral and visual settings.
The central coordinator. Contains the main event loop that reads keyboard input, dispatches actions, updates the buffer, and triggers re-renders. This is the heart of the application.
Low-level keyboard input handling for Windows terminals. Translates raw terminal escape sequences and Windows console key events into high-level Action types consumed by the editor.
Responsible for drawing the editor to the terminal. Manages the status bar, line numbers, cursor position display, and color/theme rendering. Optimizes redraws to minimize flicker.
| Shortcut | Action |
|---|---|
Ctrl+O |
Save file — Write the current buffer to disk |
Ctrl+X |
Exit — Quit the editor (prompts if unsaved changes exist) |
Ctrl+R |
Read file — Insert contents of another file at cursor position |
| Shortcut | Action |
|---|---|
Arrow Keys |
Move cursor up, down, left, right |
Home |
Move cursor to the beginning of the current line |
End |
Move cursor to the end of the current line |
Ctrl+Home |
Jump to the very beginning of the file |
Ctrl+End |
Jump to the very end of the file |
Page Up |
Scroll up one page |
Page Down |
Scroll down one page |
Ctrl+← |
Jump one word to the left |
Ctrl+→ |
Jump one word to the right |
| Shortcut | Action |
|---|---|
Ctrl+W |
Search — Open the search bar and find text in the buffer |
Ctrl+G |
Next match — Jump to the next occurrence of the search term |
| Shortcut | Action |
|---|---|
Backspace |
Delete character to the left of the cursor |
Delete |
Delete character to the right of the cursor |
Enter |
Insert a new line at the cursor position |
Tab |
Insert a tab (or spaces, depending on config) |
Ctrl+K |
Cut line — Cut the current line to the clipboard buffer |
Ctrl+U |
Paste — Paste the last cut line at the cursor position |
| Shortcut | Action |
|---|---|
Ctrl+C |
Display current cursor position (line and column) |
Ctrl+L |
Refresh / redraw the screen |
Ctrl+Z |
Undo last action (planned) |
Before building or installing Nano, ensure the following are available on your system.
Download and install Go from the official website:
https://golang.org/dl/
Verify the installation:
go version
# Expected output: go version go1.21.x windows/amd64Download and install WiX Toolset v7 from:
https://wixtoolset.org/
Or install via the .NET tool:
dotnet tool install --global wixVerify WiX is available:
wix --version
# Expected output: 4.x.x or 7.x.xgit clone https://github.com/yourusername/nano.git
cd nanogo mod tidyThis will download and resolve all Go module dependencies defined in go.mod.
go build -o bin\nano.exe .This produces a standalone nano.exe binary in the bin\ directory. The binary has no external runtime dependencies and can be run directly.
If you are not using the MSI installer, you can manually add the bin\ directory to your system PATH:
# PowerShell — add to user PATH permanently
$env:PATH += ";$PWD\bin"
[System.Environment]::SetEnvironmentVariable("PATH", $env:PATH, "User")Or use the Windows GUI: System Properties → Environment Variables → PATH → Edit → New.
The MSI installer provides a clean, professional installation experience that integrates Nano into Windows properly — no manual PATH editing required.
go build -o bin\nano.exe .wix build -acceptEula wix7\nano.wxs -o bin\nano.msiThis will produce bin\nano.msi — a fully self-contained Windows installer package.
Double-click bin\nano.msi or run silently from an elevated PowerShell prompt:
msiexec /i bin\nano.msi /quietOpen a new terminal session (so the updated PATH is loaded) and run:
nano --versionYou should see the Nano version banner. The nano command is now available from any directory, in both cmd.exe and PowerShell.
Uninstall via Settings → Apps → Nano or silently:
msiexec /x bin\nano.msi /quietnano notes.txt
nano C:\Users\you\Documents\config.yaml
nano .\scripts\deploy.ps1If the file does not exist, Nano will create it when you save:
nano newfile.txtType your content, then press Ctrl+O to save and Ctrl+X to exit.
nano --view readonly.lognano hosts.txt
# Make your edits
# Ctrl+O → Enter (save)
# Ctrl+X (exit)echo "Hello, World" | nanoNano reads its configuration from %USERPROFILE%\.nanorc on startup.
Create or edit the file:
nano %USERPROFILE%\.nanorc# Nano configuration file
# Display line numbers in the left margin
set linenumbers
# Use 4 spaces for tab indentation
set tabsize 4
# Convert tabs to spaces automatically
set tabstospaces
# Wrap long lines at window edge
set softwrap
# Enable smooth scrolling
set smooth
# Show cursor position in the status bar
set constantshow
# Color theme: dark | light | classic
set theme dark| Key | Type | Default | Description |
|---|---|---|---|
linenumbers |
flag | off | Show line numbers in the left margin |
tabsize |
integer | 4 |
Number of spaces per tab stop |
tabstospaces |
flag | off | Convert tab characters to spaces on insert |
softwrap |
flag | off | Wrap long lines visually (no hard wrap) |
smooth |
flag | off | Smooth line-by-line scrolling |
constantshow |
flag | off | Always show cursor line/column in status bar |
theme |
string | dark |
Color theme: dark, light, or classic |
| Platform | Status | Notes |
|---|---|---|
| Windows 10 / 11 | ✅ Fully Supported | Primary target platform. MSI installer available. |
| Windows Server 2019+ | ✅ Supported | Works in Server Core terminal sessions. |
| Linux | 🔄 Possible (future) | Core editor logic is platform-agnostic. Terminal backend may need adaptation. |
| macOS | 🔄 Possible (future) | Same as Linux — Go binary compiles cross-platform. |
| WSL (Windows Subsystem for Linux) | May work; not an official target. Use GNU Nano inside WSL instead. |
Primary focus: Windows. The MSI installer, PATH integration, and terminal input handling are specifically designed and tested for Windows terminals (
cmd.exe, PowerShell, Windows Terminal).
The following features are planned or under consideration for future releases:
Language-aware colorization for common file types:
- Go, Python, JavaScript, TypeScript, Rust
- JSON, YAML, TOML, XML
- Bash/PowerShell scripts
- Markdown, HTML, CSS
Syntax definitions will be configurable via .nanorc or dedicated syntax files in ~/.nano/syntax/.
Ctrl+W— incremental forward searchCtrl+\— search and replace with confirmation prompt- Regex support for power users
- Case-sensitive and case-insensitive modes
Open multiple files simultaneously in tabbed buffers. Switch between tabs with Ctrl+Tab / Ctrl+Shift+Tab. Each buffer maintains its own undo history.
Full multi-level undo (Ctrl+Z) and redo (Ctrl+Y) history with configurable depth.
A lightweight Lua or Go-based plugin API that allows users to extend Nano with custom key bindings, commands, and syntax definitions without modifying the core source.
Optional mouse support for cursor placement and scrolling inside Windows Terminal.
Full integration with the Windows clipboard so that Ctrl+C / Ctrl+V work naturally with other applications.
Robust Unicode handling including full UTF-8 file reading/writing, multi-byte character cursor movement, and display of CJK and emoji characters.
Ctrl+_ — jump directly to a specific line number.
Optionally remember the last opened file and cursor position between sessions.
GitHub Actions workflow to:
- Cross-compile for Windows (amd64, arm64)
- Build and sign the MSI installer
- Publish GitHub releases with attached assets
Contributions are welcome! If you'd like to fix a bug, add a feature, or improve the documentation:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m "feat: add my feature" - Push to your fork:
git push origin feature/my-feature - Open a Pull Request against
main
Please follow Conventional Commits for commit messages and keep PRs focused on a single concern.
# Run directly without building
go run . myfile.txt
# Run tests
go test ./...
# Run tests with verbose output
go test -v ./...
# Check for race conditions
go test -race ./...
# Build with debug symbols
go build -gcflags="all=-N -l" -o bin\nano-debug.exe .MIT License
Copyright (c) 2026 [Nay]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[Nay]
- GitHub: @NaySurGithub
- Email: naymc.paypal@gmail.com
- Inspired by GNU Nano — the original terminal editor this project pays homage to
- Built with Go — for its simplicity, static binaries, and cross-platform potential
- Packaged with WiX Toolset v7 — the gold standard for Windows MSI packaging
Made with ❤️ for developers who live in the terminal — even on Windows.