Open jwatt opened 3 years ago
This would be great, especially with config/dotfile management systems. With the current behaviour, it's impossible to just track ~/.config/micro/
, one has to individually track each config files (settings.json
, bindings.json
, colorschemes/
, etc).
There is already an option to use a custom directory for backups, so this could be implemented similarly for the other things.
Also ~/.config/micro/backups
should probably be on ~/.cache/micro/backups
instead
Either of data home (.local/share
) or state home (.local/state
) would seem more appropriate for the backups, especially state since it is defined in the spec at the place for command history, undo history, etc
The current version of the spec is here
Also
~/.config/micro/backups
should probably be on~/.cache/micro/backups
instead
The ./backup/*
directory is configurable (backupdir
). However, it does belong in the $XDG_CACHE_HOME
directory rather than $XDG_CONFIG_HOME
as-is the current default.
The ./buffers/history
file belongs in the $XDG_STATE_HOME/micro/
directory.
The ./buffers/*
directory belongs in the $XDG_CACHE_HOME/micro/
directory. (It, arguably, belongs in $XDG_STATE_HOME/micro/
when the savecursor
option is enabled (off by default). However, overall it’s closer to cache data than state data.)
Option A:
lastmigration
option in the in settings.json
file.
${XDG_CONFIG_HOME:-$HOME/.config}/micro/buffers/history
file to ${XDG_STATE_HOME:-$HOME/.local/state}/micro/history
. (Skip if the source file doesn’t already exist.)${XDG_CONFIG_HOME:-$HOME/.config}/micro/buffers/
directory to ${XDG_CACHE_HOME:-$HOME/.cache}/micro/buffers/
. (Skip if the source directory doesn’t already exist.)${XDG_CONFIG_HOME:-$HOME/.config}/micro/backups/
directory to ${XDG_CACHE_HOME:-$HOME/.cache}/micro/buffers/
. (Skip if the source directory doesn’t already exist.)"lastmigration": $current_version_number
to the settings file.Option B:
Just leave the old files in their current location and begin using the new locations. You’ll still likely get 99.8 % user-satisfaction.
./buffers
and ./backup
directories inside $XDG_CONFIG_HOME
. When these folders are created (no migration strategy), mark them as cachy/trashy directories. Automatically add a CACHEDIR.TAG
file into each directory. Also, set the extended attributes com.apple.metadata:com_apple_backup_excludeItem
with a value of [empty]
(MacOS) and xdg.robots.backup
with a value of false
(Linux) on each directory. Lots of backup and search utilities will know to ignore them by default. There’s nothing equivalent on Windows.buffersdir
and historyfile
configuration options but leave the current defaults (or take the opportunity to adjust their defaults with the implementation of these options).I've submitted a patch (and a link to a Linux test binary) in #3185.
micro
appears to create the file~/.config/micro/buffers/history
, which is not a configuration file. Data generated from the use of an app should be put under${XDG_DATA_HOME:-~/.local/share}
, so it seems like thebuffers
directory should live at${XDG_DATA_HOME:-~/.local/share/micro/buffers}
. Would you mind updatingmicro
to use that path?Many thanks for
micro
, it's awesome. 😄Commit hash: cfcb2e4 OS: Fedora 33 Terminal: Konsole/bash