Giter Club home page Giter Club logo

Comments (2)

cohml avatar cohml commented on June 26, 2024

The simplest implementation may be to implement an option whereby one can specify the path to an arbitrary history file (provided of course that it is a zsh-formatted/compatible history file), with HISTFILE being the default value.

from zsh-hist.

cohml avatar cohml commented on June 26, 2024

Following up: I managed to get it working with both global history ($HISTFILE) and also per-directory history by manually overriding HISTFILE when executing hist, e.g.

# delete from global history
HISTFILE="${HISTFILE}" hist delete 123  # default behavior, equivalent to just `hist delete 123`

# delete from local history
HISTFILE="${_per_directory_history_directory}" hist delete 123

_per_directory_history_directory points to my PWD-specific history file, and gets set by the per-directory-history plugin. So the code above obviously won't work in all cases.

But it illustrates a general (if hacky) approach that will work for others wanting this feature without requiring any modifications to the source code.

Note

There's one drawback though: If I want to delete a command from all histories (i.e., global and local), I still need to use hist delete twice, one for each history mode/file. But fixing that, such that a single call to hist delete removes a command from everywhere, would require modifying the source code.

Ideally this feature will be implemented directly into zsh-hist, so I'll leave this issue open. But pending that, this works for me as a temporary stopgap.

from zsh-hist.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.