xwmx / nb

CLI and local web plain text note‑taking, bookmarking, and archiving with linking, tagging, filtering, search, Git versioning & syncing, Pandoc conversion, + more, in a single portable script.
https://xwmx.github.io/nb
GNU Affero General Public License v3.0
6.54k stars 186 forks source link

bulk operations #186

Open kiil opened 2 years ago

kiil commented 2 years ago

Hi —

I hope I haven't missed anything, but as far as I can tell, there is no way to do bulk operations.

Fx, if I would like to open 2 notes in vim (in 2 buffers) there is currenty not a way to do this:

nb edit 2 5

to open both the note with id 2 and the note with id 5 in the editor.

Is there any chance for such a feature to become part of nb?

xwmx commented 2 years ago

Multiple selectors can be passed to delete, and globbing is supported in import. I hadn't considered supporting multiple selectors with edit. For simple edit calls, the resolved paths could theoretically be passed through to the command that invokes the editor. Other cases would require more logic, such as editing encrypted items.

kiil commented 2 years ago

Other cases would require more logic, such as editing encrypted items.

True. I had not thought about that complication.

dixonge commented 1 year ago

I'm trying to move all files of one extension to a different notebook, but every time nb just gives me the option to move the first file it finds. How do I move all of one file type to a different journal all at once?

dixonge commented 1 year ago

FYI - moving files between folders (notebooks) using normal shell commands somehow gets caught by nb automatically. nb knows to remove these files from the original notebook and add them to the other. nb list shows the files now gone from the first notebook and fully indexed in the second. So that will work...

xwmx commented 1 year ago

@dixonge Indeed, nb performs an index reconciliation whenever there are uncommitted changes or when ls / list encounters a file that's not in the directory's .index.