.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "elvish-store" "7" "Dec 07, 2021" "Elvish 0.17.0~rc4" "Miscellaneous Information Manual" .hy .PP .SH Introduction .PP The \f[C]store:\f[R] module provides access to Elvish\[cq]s persistent data store. It is only available in interactive mode now. .SH Functions .PP .SS store:add-cmd {#store:add-cmd} .IP .nf \f[C] store:add-cmd $text \f[R] .fi .PP Adds an entry to the command history with the given content. Outputs its sequence number. .PP .SS store:add-dir {#store:add-dir} .IP .nf \f[C] store:add-dir $path \f[R] .fi .PP Adds a path to the directory history. This will also cause the scores of all other directories to decrease. .PP .SS store:cmd {#store:cmd} .IP .nf \f[C] store:cmd $seq \f[R] .fi .PP Outputs the content of the command history entry with the given sequence number. .PP .SS store:cmds {#store:cmds} .IP .nf \f[C] store:cmds $from $upto \f[R] .fi .PP Outputs all command history entries with sequence numbers between \f[C]$from\f[R] (inclusive) and \f[C]$upto\f[R] (exclusive). Use -1 for \f[C]$upto\f[R] to not set an upper bound. .PP Each entry is represented by a pseudo-map with fields \f[C]text\f[R] and \f[C]seq\f[R]. .PP .SS store:del-cmd {#store:del-cmd} .IP .nf \f[C] store:del-cmd $seq \f[R] .fi .PP Deletes the command history entry with the given sequence number. .PP \f[B]NOTE\f[R]: This command only deletes the entry from the persistent store. When deleting an entry that was added in the current session, the deletion will not take effect for the current session, since the entry still exists in the in-memory per-session history. .PP .SS store:del-dir {#store:del-dir} .IP .nf \f[C] store:del-dir $path \f[R] .fi .PP Deletes a path from the directory history. This has no impact on the scores of other directories. .PP .SS store:del-shared-var {#store:del-shared-var} .IP .nf \f[C] store:del-shared-var $name \f[R] .fi .PP Deletes the shared variable with the given name. .PP .SS store:dirs {#store:dirs} .IP .nf \f[C] store:dirs \f[R] .fi .PP Outputs all directory history entries, in decreasing order of score. .PP Each entry is represented by a pseudo-map with fields \f[C]path\f[R] and \f[C]score\f[R]. .PP .SS store:next-cmd-seq {#store:next-cmd-seq} .IP .nf \f[C] store:next-cmd-seq \f[R] .fi .PP Outputs the sequence number that will be used for the next entry of the command history. .PP .SS store:set-shared-var {#store:set-shared-var} .IP .nf \f[C] store:set-shared-var $name $value \f[R] .fi .PP Sets the value of the shared variable with the given name, creating it if it doesn\[cq]t exist. The value must be a string. .PP .SS store:shared-var {#store:shared-var} .IP .nf \f[C] store:shared-var $name \f[R] .fi .PP Outputs the value of the shared variable with the given name. Throws an error if the shared variable doesn\[cq]t exist.