camdencheek / fre Goto Github PK
View Code? Open in Web Editor NEWCommand line frecency tracking
License: MIT License
Command line frecency tracking
License: MIT License
Hi,
The intro in the docs says "for tracking your most-used directories and files" - everything else in the docs refers to directories. How to use it for files?
What I'd like to achieve is to replace fasd
, so when I type less ,2022
, I get a completion list of all files and directories I've recently accessed that have 2022
somewhere in the name or path, frecency sorted.
Cargo.lock in out of date in the 0.4.0 release. This is preventing me from updating the package I maintain for NixOS.
How can I easily remove deleted files / directories from the output?
Ideally I could run a command to remove all of these, or only entries that match a glob or regex.
When the project started, Rust 2018 was nightly only. Now, there shouldn't be any nightly-only features and the project should probably be switched over to stable.
Hey, I've been using this fo years installed from crates.io. I recently wanted to package it and releaized that version 0.2 isn't tagged. Could you please do so. Thx.
Problem: fre
saves input as absolute path, which conflicts with using it for non-path things like commands.
#!/bin/dash
set -o errexit
set -o nounset
repls() {
echo "rlwrap sbcl"
echo "rlwrap dash"
echo "bash"
echo "clisp"
echo "guile"
echo "iex"
echo "python"
}
# Default store location is ~/.local/share/fre/
store_name=$(echo "cmd:$0" | md5sum | awk '{print $1}')
fzf_result=$({
fre --sorted --store_name "$store_name"
repls
} | awk '!x[$0]++' | fzf -m --reverse --height 15 --tiebreak=index)
if test -n "$fzf_result"; then
fre --add "$fzf_result" --store_name "$store_name" && echo "$fzf_result"
fi
Here, $fzf_result
would be something like rlwrap sbcl
, but fre's suggestion on subsequent reruns would include $PWD
, like so: /home/username/rlwrap sbcl
.
(awk '!x[$0]++'
trick is to avoid sort | uniq
)
Currently, fre
stores its default store (fre.json
) in ${XDG_DATA_HOME}/fre
(usually resolving to ~/.local/share/fre/fre.json
).
However, the XDG Base Directory Specification suggests:
The
$XDG_STATE_HOME
contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in$XDG_DATA_HOME
. It may contain:
- actions history (logs, history, recently used files, โฆ)
- current state of the application that can be reused on a restart (view, layout, open files, undo history, โฆ)
Would it make sense to use ${XDG_STATE_HOME}/fre
instead?
The reason I'm considering this question is that currently the --store
option to fre
specifies a path to an alternate store.
My initial assumption when trying this was that just a name was required, and the storage location would be along-side the default store (e.g. --store=foo
would resolve to ~/.local/share/fre/foo.json
, rather than a file called foo
in the current directory), so another possible improvement might be that if the value provided to --store
is not an absolute path, it is assumed that the storage location should be in the same directory as the default store (wherever that is most appropriate) with --store=fre
being synonymous with the default store.
I'm happy to make a PR if either of these (standard location or "named" stores) would be useful.
Hey :)
I really like the idea of fre
and this frecency algorithm.
I would like to use the same algorithm for other stuff as well, not just directory and file tracking. In particular, at the moment I'm using raw fzf
for my command run script and would like to include your frecency algorithm there as well.
Are there any plans to generalize fre
to arbitrary input? Or do you know of a tool that already does this?
Thank you very much :)
๐ Hey, did you mean "frequency" instead of frecency?
cargo install
still rocking that 0.1.0
. Just opening this in case you forgot to publish it manually; If there's an actual reason to withhold master
from crates.io I then apologize for inconvenience and this should be closed.
I use fre to sort my file bookmarks. It is a really useful tool for me.
When I have not visited some files for a longer time period the shown score is 0.000
It would be nice to allow showing more than 3 digits. That way 0.000 would be e.g. shown as 0.00004
This could be done by e.g adding the option --stat-digits 5 (defaulting to the current value 3)
Apologies for posting here, as I'm quite certain this is more of an fzf
question, but your default fre+fzf setup seems to be exactly what I'm looking for, so thought you might have some insight.
One bit I'm not clear on, is why in this scenario:
/Users/timkelty/Dev/cloud-extension-yii2
doesn't bubble to the top once I start searching yii2
.
Before any query, the results are listed just as fre
has them, but once I type a query, this folder gets unexpectedly pushed pretty far down, even though it should have preferential weight from fre
.
This crate cannot be cargo install
ed because it conflicts with an existing crate.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.