elvish-store(7)

๐Ÿ“ฆ
version 0.17.0 ยท 2 versions
, in ubuntu jammy

โœจ elvish-store โœจ

okay bestie, welcome to elvish-store โ€” the Miscellaneous Information Manual page that's literally all about the store: module ๐Ÿ’–


๐ŸŒธ Introduction ๐ŸŒธ

So, the store: module gives you access to Elvish's persistent data store. Like, the stuff that survives after you close the terminal. Iconic behavior fr fr.

โš ๏ธ Heads up bestie: it's only available in interactive mode now. So no scripting shenanigans with this one, okay? ๐Ÿ‘‘

๐ŸŽ€ Functions ๐ŸŽ€


๐Ÿฆ‹ store:add-cmd {#store:add-cmd}

store:add-cmd $text

Drops an entry into the command history with whatever content you hand it. Then it outputs its sequence number, so you know exactly where it landed. Slay. โœจ


๐Ÿฆ‹ store:add-dir {#store:add-dir}

store:add-dir $path

Adds a path to the directory history. And heads up โ€” this also makes the scores of all the other directories go down. It's giving main character energy, and every other dir is the supporting cast. ๐Ÿ’…


๐Ÿฆ‹ store:cmd {#store:cmd}

store:cmd $seq

Give it a sequence number, and it outputs the content of that command history entry. That's it, that's the whole vibe. ๐ŸŽ€


๐Ÿฆ‹ store:cmds {#store:cmds}

store:cmds $from $upto

Outputs all the command history entries with sequence numbers between $from (inclusive, bestie) and $upto (exclusive, so don't be surprised). Wanna skip the upper bound entirely? Pass -1 for $upto and it just won't set one. Periodt.

Each entry comes as a pseudo-map with fields text and seq.


๐Ÿฆ‹ store:del-cmd {#store:del-cmd}

store:del-cmd $seq

Deletes the command history entry with the given sequence number. Bye bye ๐Ÿ‘‹

๐Ÿ˜ญ NOTE: This command only deletes the entry from the persistent store. So if you're deleting an entry that got added in the current session, the deletion won't take effect for the current session, because that entry is still chilling in the in-memory per-session history. Sorry bestie, that's just how it is.

๐Ÿฆ‹ store:del-dir {#store:del-dir}

store:del-dir $path

Deletes a path from the directory history. And nope, this one has no impact on the scores of other directories โ€” unlike store:add-dir. No drama here. ๐Ÿงš


๐Ÿฆ‹ store:del-shared-var {#store:del-shared-var}

store:del-shared-var $name

Deletes the shared variable with the given name. Gone. Poof. โœจ


๐Ÿฆ‹ store:dirs {#store:dirs}

store:dirs

Outputs all the directory history entries, sorted in decreasing order of score โ€” so the favorites show up first, naturally. ๐Ÿ‘‘

Each entry is a pseudo-map with fields path and score.


๐Ÿฆ‹ store:next-cmd-seq {#store:next-cmd-seq}

store:next-cmd-seq

Outputs the sequence number that the next entry of the command history is gonna get. Peek into the future, lowkey. ๐Ÿ”ฎ


๐Ÿฆ‹ store:set-shared-var {#store:set-shared-var}

store:set-shared-var $name $value

Sets the value of the shared variable with the given name, and creates it if it doesn't exist yet. Super chill about it.

๐Ÿซถ Little rule tho: the value must be a string. No exceptions, bestie.

๐Ÿฆ‹ store:shared-var {#store:shared-var}

store:shared-var $name

Outputs the value of the shared variable with the given name. And if that shared variable doesn't exist? It throws an error. ๐Ÿ’€ So maybe check first, iykyk.


That's the whole page, bestie โ€” every single function, every argument, every field, all of it. Nothing skipped, no cap. ๐ŸŒˆ

This lil love letter to store: comes to you from Elvish 0.17.0, dated Nov 18, 2024. Thanks for reading, mwah ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from