Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: note metadata for files

On 2 July 2014 19:59, shawn wilson <ag4ve.us@xxxxxxxxx> wrote:
> Maybe not a zsh specific question, but...
> Does anyone have a system for attaching notes to a file?
> The issue is I track down why a change was made to a file
> (annotate/blame/whatever) and then I remember that I've tracked down
> that change before. It would be useful if I could attach a note to
> files outside of any repo (or the repo they belong to anyway) that
> pops something up (maybe desktop-notify) when I look at the file (not
> stat, but manually grep/cat/less/diff/whatever from a cli).
> This could almost be a shell script, but I'm not sure how to make an
> event that would trigger the script with a filename parameter - is
> there a way to do this?

Closest I have is

zstyle ':completion:dirprop:*' file-list dirprop=user.notes
zstyle ':completion:dirprop:*' dirinfo-format '%f '${(%):-%F{11}}%i${(%):-%f}
zle -C dirprop complete-word _generic
bindkey "^_^V"    dirprop

(or just set the style for your default context to always disable the
notes on tab completion, but it overrides filetype coloring which is
why i don't).

Also note that most programs will silently delete all xattrs when you
edit/copy/etc a file.

Mikael Magnusson

Messages sorted by: Reverse Date, Date, Thread, Author