margin

command module
v0.0.0-...-af6e024 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

margin

A terminal markdown notes editor. Your notes stay plain .md files in a folder, so they work with git, grep, Obsidian, or any other editor.

margin demo

Features

  • Folder tree of your notes, with folders you can collapse
  • Rendered markdown by default (Glamour); press e to edit the raw text
  • Autosave while you type; every write is atomic (temp file + rename)
  • Safe with other editors: if a note changes on disk while you edit it, margin asks before overwriting
  • Fuzzy finder (ctrl+p) by note name and full-text search (ctrl+f) across all notes
  • Trash instead of delete: removed notes go to <notes>/.trash/
  • Undo/redo, rename, folders, light/dark themes

Screenshots

Rendered note Tables
Rendered markdown Table rendering
Editing (autosaved) Fuzzy finder (ctrl+p)
Edit mode Fuzzy finder
Full-text search (ctrl+f) Help (?)
Search Help

Install

go install github.com/beladevo/margin@latest

Or download a binary from Releases.

Usage

margin              # opens ~/notes (created if missing)
margin ~/vault      # opens another folder
Try it on the examples

The repo ships a small notes folder in examples/notes: meeting notes with task lists, a roadmap with a table, code snippets and a cheatsheet.

git clone https://github.com/beladevo/margin && cd margin
cp -r examples/notes /tmp/margin-examples   # edits autosave, so work on a copy
go run . /tmp/margin-examples
Keys
Browse
↑/↓ j/k move
←/→ h/l collapse / expand, focus the note
enter open folder / edit note
tab switch pane
e edit note
n / N new note / new folder
r rename
d move to trash
ctrl+p find note by name
ctrl+f or / search inside notes
? help
q quit
Edit
esc save and go back to the rendered view
ctrl+s save now
ctrl+z / ctrl+y undo / redo

When a note changes on disk while you have unsaved edits, a banner appears: ctrl+r reloads the disk version, ctrl+k keeps yours.

New notes are named after their title: Meeting notes becomes Meeting notes.md, starting with # Meeting notes.

Config

~/.config/margin/config.toml (or $XDG_CONFIG_HOME/margin/config.toml), all optional:

notes_dir = "~/notes"
theme = "auto"          # auto | dark | light
autosave_delay = "1s"

Development

go test -race ./...
golangci-lint run

The GIF and screenshots are recorded with vhs:

vhs docs/demo.tape

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL