NeoNano logo

NeoNano

Nano, reimagined

A terminal text editor written in C with ncurses.

neo·nano (noun)

  1. Type right away, the way you would in nano. Ctrl shortcuts, no modes.
  2. Press F1 for a vi-style : palette when you need more.
  3. Extend it with .so plugins loaded by name.

Written in C with ncurses. No interpreter to install.

Install GitHub ↗ Keys

VERSION: loading…

Why it's different

nano-style writing vi-style palette one TOML config .so plugins

Familiar on day one

No modes to learn before you can type. Undo, redo, mark and select, cut, copy, paste, find and go to line are all on Ctrl and Alt keys.

The palette

F1 opens a : prompt. Save, open, find, go to a line, switch themes, count words, or open the config with cfg.

Configure everything

Line numbers, relative numbers, themes, color overrides and every keybind, in one TOML file.

Install

The script needs no source code. It reads the latest NeoNano release, checks every download against GitHub's sha256 digest, and installs it. Then it asks whether you want the NeoNanoQOL plugins.

Install (asks about NeoNanoQOL)

curl -fsSL https://raw.githubusercontent.com/RenCupDotDev/NeoNano/main/install.sh | bash

Install with the NeoNanoQOL plugins

curl -fsSL https://raw.githubusercontent.com/RenCupDotDev/NeoNano/main/install.sh | bash -s -- --qol

Install system-wide (needs sudo)

curl -fsSL https://raw.githubusercontent.com/RenCupDotDev/NeoNano/main/install.sh | sudo bash -s -- --system

Update, applying without asking

curl -fsSL https://raw.githubusercontent.com/RenCupDotDev/NeoNano/main/install.sh | bash -s -- --update

Preview, change nothing

curl -fsSL https://raw.githubusercontent.com/RenCupDotDev/NeoNano/main/install.sh | bash -s -- --dry-run --qol

Uninstall (keeps your config)

curl -fsSL https://raw.githubusercontent.com/RenCupDotDev/NeoNano/main/install.sh | bash -s -- --uninstall

Uninstall and delete your config

curl -fsSL https://raw.githubusercontent.com/RenCupDotDev/NeoNano/main/install.sh | bash -s -- --purge

Start it

nnano notes.txt

Needs Linux on x86_64, with curl, jq, sha256sum and libncursesw.

Keys

The defaults. Every one can be remapped in the [keys] table of your config.

Writing
Ctrl+SSave
Ctrl+XQuit. With unsaved changes it warns first, and a second press discards them
Ctrl+Z Ctrl+YUndo, redo
Ctrl+DDelete line
Alt+DDuplicate line
Tab Shift+TabIndent, unindent
Alt+B Alt+FWord left, word right
Alt+< Alt+>Start, end of file
Selection and search
Ctrl+TSet or clear the mark
Alt+ASelect all
Ctrl+K Alt+C Ctrl+UCut, copy, paste
Ctrl+F F3Find, find next
Ctrl+GGo to line
View
Alt+N Alt+L Alt+HLine numbers, relative numbers, current-line highlight
Alt+TCycle themes
Alt+WWord count
Alt+I Alt+KOpen config, reload config
F1Open the : palette

Config

One TOML file, created on first run in ~/.config/neonano/. Open it with Alt+I or cfg, then apply with Alt+K or reload.

# config.toml
theme = "neonano"

[editor]
tab_width = 4
use_spaces = true
undo_levels = 500

[view]
line_numbers = "right"
relative_numbers = true

[colors]
text = "#ffffff"

[keys]
save = ["ctrl+s", "f2"]

[plugins]
enabled = ["hello"]

From the palette, live:

goto 42
theme mytheme
reload

# ~/.config/neonano/themes/mytheme.toml
[colors]
background = "#1e1e2e"
text = "#cdd6f4"

Plugins

Build a .so from the NeoNano-Plugin-Template repository, copy it to ~/.nnanoplugins/, add its name to [plugins] enabled, and restart. The NeoNanoQOL repository has ready-made plugins for a directory tree, a terminal pane, a welcome page, a word counter and language servers.

#include "plugin.h"

static const PluginAPI *api;

static void cmd_hello(Editor *e, const char *arg) {
    char msg[200];
    snprintf(msg, sizeof msg, "Hello %s! This file has %zu lines.",
             (arg && *arg) ? arg : "there", api->line_count(e));
    api->message(e, msg);
}

void neonano_plugin_init(const PluginAPI *a) {
    if (a->version < 5) return;
    api = a;
    a->add_command("hello", "hello [name]  greet and show the line count", cmd_hello);
    a->bind_key("f10", "hello");
}

FAQ

About
Is it bad?

Check here

What is NeoNano?

A terminal text editor written in C with ncurses. You type the way you would in nano, and F1 opens a vi-style : palette for commands such as save, find, go to line and theme switching.

Why the name?

It is nano, rebuilt. The "neo" is the reimagining: the same easy typing, with a command palette and plugins on top.

What license is it under?

GPL-3.0. The NeoNano-Plugin-Template repository is MIT, so you can start a plugin from it under any license you like.

Do I need to know C to use it?

No. Using NeoNano needs nothing but the binary. C only matters if you want to write a plugin.

Installing and updating
How do I install it?

Run the one-line command in the Install section. The script downloads the latest release from GitHub, checks it, installs nnano to ~/.local/bin, and asks whether you want the NeoNanoQOL plugins.

Do I need root or sudo?

No. The default install is for your user only. Add --system and run it with sudo to install for every user, under /usr/local.

What does the installer check?

Every download is compared against the sha256 digest GitHub publishes for that release asset. If the digest is missing or does not match, the file is deleted and nothing is installed.

What do I need installed first?

Linux on x86_64, plus curl, jq, sha256sum, install, awk and libncursesw. The script checks for these and stops with a message if one is missing.

How do I update?

Run the install command again. If a newer release exists, the script asks before updating. Add --update to apply it without asking. Your config is kept.

How do I see which version I have?

Run nnano --version. The version is compiled in from the VERSION file. The label at the top of this page shows the latest one on GitHub.

How do I uninstall it?

Run the script with --uninstall. It removes the program and any plugins it installed, and restores files it had backed up. Your config stays. Use --purge to delete the config too.

Can I see what it would do first?

Yes. Add --dry-run and the script prints every step without changing anything.

Does it work on Windows or macOS?

The installer supports Linux on x86_64 only. The source is C with ncurses, so building it elsewhere may be possible, but it is not supported yet.

Using it
How do I quit without saving?

Press Ctrl+X. With unsaved changes it warns and asks you to press it again. The second press discards them. Or use discard in the palette.

Does it autosave?

No. Save with Ctrl+S or write.

How many undo steps are there?

500 by default. Set undo_levels in the [editor] section to any value from 1 to 2000.

What is the : palette?

Press F1 and type a command. The main ones are write, saveas, open, exit, discard, find, goto, theme, reload, wc, cfg, plugins and help.

Can I change the keys?

Yes. Add the action to the [keys] table of your config with a list of keys, for example save = ["ctrl+s", "f2"], then run reload.

Can I show line numbers?

Yes. Press Alt+N to toggle them, Alt+L for relative numbers. In the config, line_numbers in the [view] section takes "none", "left" or "right".

Where is my config?

~/.config/neonano/config.toml. Open it with Alt+I or cfg. Changes apply after Alt+K or reload.

How do I make my own theme?

Create ~/.config/neonano/themes/<name>.toml with a [colors] section, then switch to it with theme <name>. Press Alt+T to cycle through the themes you have.

Does the editor count words?

Yes. Press Alt+W or run wc.

Plugins
Where do plugins go?

NeoNano looks in ~/.nnanoplugins/<name>.so first, then in the system plugin directory, /usr/local/lib/neonano/plugins by default. A plugin runs only when its name is in [plugins] enabled.

Are plugins safe?

A plugin is native code loaded into the editor, so it can do anything the editor can. Install only plugins you trust, and read the source of anything you did not write.

Which plugins exist?

The NeoNanoQOL repository has a directory tree, a terminal pane, a welcome page, a word counter and language server support. The installer can add them for you with --qol.

How do I write one?

Start from the NeoNano-Plugin-Template repository. It has a working example and a build that needs only the plugin header. The example above shows the shape: a command, a key binding, and the API version check.

Project
Where do I report a bug?

Open an issue on the GitHub issues page. Include your version from nnano --version and the steps to reproduce.

Can I contribute?

Yes. Pull requests and issues are welcome on the GitHub repository. The user guide and architecture notes are in the docs folder.

Why is the VERSION label "unknown"?

The page reads the VERSION file from GitHub when it loads. If GitHub cannot be reached, or the file cannot be read, it shows "unknown".

Made By

RenCupDotDev avatar

RenCupDotDev

Hi, I'm RenCup. I'm a developer from Italy. I build lightweight C tools and mobile mods, and I use Arch btw.