✂️ Add or remove final newlines.
Find a file
Eduard Urbach e32f883fb2
All checks were successful
/ test (push) Successful in 7s
Released 0.1.2
2026-06-11 15:26:55 +02:00
docs Implemented support for streams 2026-06-11 15:25:41 +02:00
src Implemented support for streams 2026-06-11 15:25:41 +02:00
.gitignore Initial commit 2025-06-02 16:54:33 +02:00
Cargo.lock Released 0.1.2 2026-06-11 15:26:55 +02:00
Cargo.toml Released 0.1.2 2026-06-11 15:26:55 +02:00

fnl

Add or remove final newlines.

Installation

cargo install fnl

Usage

Single file

Show status:

fnl file.txt

Add final newline:

fnl --add file.txt

Remove final newline:

fnl --remove file.txt

Multiple files

Show status:

find . -type f -name "*.txt" | xargs fnl

Add final newlines:

find . -type f -name "*.txt" | xargs fnl --add

Remove final newlines:

find . -type f -name "*.txt" | xargs fnl --remove

Streams

Add final newline:

fnl --add < file.txt

Remove final newline:

fnl --remove < file.txt

Editors

VS Code:

"filewatcher.commands": [{"match": "\\.go*","isAsync": true,"cmd": "fnl --remove ${file}","event": "onFileChange"}],

Zed:

"languages": {
	"Go": {
		"formatter": [
			{
				"language_server": {
					"name": "gopls",
				},
			},
			{
				"external": {
					"command": "fnl",
					"arguments": ["--remove"],
				},
			},
		],
	},
},

License

Please see the license documentation.

© 2025 Eduard Urbach