pimterry/notes

Notes mv

Escyll opened this issue · 4 comments

A nice feature would be the ability to move notes (to other folder or renaming the file).

Syntax could be:
notes mv MyWorkTodos.md Todo/Work.md
or
notes mv MyWorkTodos Todo/Work

The latter (without the extensions) would be inline with the other commands.

I am willing to fork the repo and start implementing myself, however, I would first like to know if this feature has a change of being 'accepted' (the proposal itself, not the implementation of course (since there is none yet)).

Hi @Escyll, that sounds great to me! I'm definitely open to a PR like that.

For syntax, for most (all?) other commands, we try to support both filename formats, basically making the configured file extension optional. I think that means the first argument would be used as-is, if an exactly matching filename exists (as in your first example), or we'd append the extension automatically if not (your second example). The second argument I imagine would match an exactly matching folder if that exists, and then place the source file into the folder like mv does in general, or append the extension to the argument if not, if the name doesn't already have an extension.

So, as examples:

  • mv a b would place a.md inside folder b if that folder already exists, or moves it to b.md if not.
  • mv a b.md would try to move a.md to b.md, not to b.md.md

Does that make sense?

Yup, I totally agree. Probably I can find some time this week to implement this feature.

Implemented as discussed.