Comments (2)
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.
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)
- Commands drawn from history cannot be executed. HOT 3
- Problems with unicode characters HOT 3
- Select multiple history entries HOT 3
- How to do a big-time auto format in place?
- TODO: Add installation instructions
- Regex `\b` replaced with `^H` in multi-line command HOT 2
- Don't add current command to history (`ignore` flag) HOT 2
- Plugin no longer working as expected after recent changes HOT 5
- ^Q unavailable in vi command mode
- The term "undo" is used twice HOT 4
- Widgets are not found anymore HOT 4
- Aliases are automatically expanded before the command is executed HOT 16
- Code formatting ignores HIST_IGNORE_SPACE HOT 3
- Command line prepended with tab character. HOT 13
- History line autocompletion not working. HOT 1
- History line tab-completion not working. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zsh-hist.