# Text Files > Complex Tools: A Minimalist Snippet Manager
Extracto
I built a lightweight command-line tool that lets you quickly browse a directory of plain text snippets, select one using fuzzy search, and instantly copy its contents to your clipboard.
Contenido
I built a lightweight command-line tool that lets you quickly browse a directory of plain text snippets, select one using fuzzy search, and instantly copy its contents to your clipboard.
Before
I used to rely on a Firefox snippet manager for email replies and various IDE-specific tools for code snippets. The downside? Exporting and sharing those snippets across different applications was cumbersome, all I really needed was something simple and flexible.
The snippets repository
So, I created a dedicated snippets directory with a straightforward folder structure to keep everything organized:
snippets/ ├── mail/ │ ├── work/ │ └── private/ ├── c/ ├── swift/ ├── bash/ └── ...
Each snippet is stored as a plain text file within its relevant category. For example, I have a recurring monthly email for timesheets:
File: snippets/mail/work/monthly_timesheet.txt
Contents:
Hi, In attachment you can find the timesheet and corresponding invoice for the past month. Regards,
Why text files?
The real beauty of this approach is its simplicity: I can use any text editor to create, edit, or store a snippet—no special software required. There’s no proprietary format, just plain text in its most basic form. This means my snippets will work on any device, old or new, without worrying about compatibility issues or being locked into a subscription for some "Snippets Plus Manager" upgrade.
Best of all, I don’t have to fear that the app I rely on will disappear in a few years, leaving my aging devices stranded. It’s future-proof, lightweight, and entirely under my control.
Here's another similar blog post I came across a while ago:
How I fell in love with calendar.txt (by Ploum)The script to select and copy the snippet
I wrote a short bash script that uses fzf for fuzzy matching. (= typing something that approximately matches what you are looking for)
With just a few keystrokes, I can search for a snippet by name, and the script copies its contents directly to my clipboard—ready to paste wherever I need it.
#!/bin/bash copy_to_clipboard() { local file="$1" if [[ -f "$file" ]]; then cat "$file" | xclip -selection clipboard echo "Contents of '$file' copied to clipboard." cat "$file" else echo "Error: File '$file' not found." fi } cd "$(dirname "${BASH_SOURCE[0]}")/snippets" || exit 1 selected_file=$(fzf --prompt="Select a snippet: ") if [[ -z "$selected_file" ]]; then echo "No snippet selected. Exiting." exit 0 fi copy_to_clipboard "$selected_file"
(This script uses xclip to write to the clipboard on linux, if you are running macos, you can use pbcopy instead)
Tags
Development, HomeLab
You can get in touch through Mastodon:
@rxpz@social.linux.pizzaText Files > Complex Tools: A Minimalist Snippet Manager was published on 2025-09-13
Back to the overview 📰 Subscribe to RSS feed 📰