zyedidia / micro

A modern and intuitive terminal-based text editor

Home Page:https://micro-editor.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Micro puts stuff into $XDG_CONFIG_HOME that doesn't belong there

bartekpacia opened this issue · comments

From what I understand, XDG_CONFIG_HOME is for configuration files, like settings.json and bindings.json.

However in my case micro misuses that directory to place some other autogenerated files in there:

$ tree -a ~/.config/micro
micro
├── backups
│   └── %Users%bartek%projects%cg-t01-g12%blah
├── bindings.json
├── buffers
└── settings.json

3 directories, 3 files

I think stuff like backups and buffers doesn't belong to XDG_DATA_HOME. Instead they should be in $XDG_STATE_HOME (or maybe $XDG_DATA_HOME?).

Specifications

Micro version

$ micro --version
Version: 2.0.13
Commit hash: 68d88b57
Compiled on October 21, 2023

OS

$ sw_vers
ProductName:		macOS
ProductVersion:		14.4
BuildVersion:		23E214

Terminal

iTerm2 (build 3.5.0beta19)

Currently there is no logic to take a different default as XDG_CONFIG_HOME, but this is at least manually configurable via backupdir (see: options.md)

I'll be happy to contribute this if only I get a buy in from a maintainer:)

Please give it a shot. We're happy about every helping hand.

Somewhere here it's good to start:
https://github.com/zyedidia/micro/blob/master/internal/buffer/backup.go#L72-L75