fzf
+ Ctrl+R
then I type part of the path, basename, or just my CLI editor and browse the recent commands.
fzf
+ Ctrl+R
then I type part of the path, basename, or just my CLI editor and browse the recent commands.
Related idea:
https://reddthat.com/post/7516312
To manage temporary files in Linux, a Bash script can move files untouched for 10 days to a timestamped subfolder, return modified files to the root, and delete files not modified for 90 days. Alternatively, a folder with symlinks to recently accessed files can be created using mkdir
, find
with -atime -7
to locate recently accessed files, and a while
loop with ln -s
to symlink each file into the folder. Both approaches help organize files based on access time to avoid clutter and remove stale temporary files. The Bash script offers more automation while the symlink folder provides a manual way to access recent files.
#!/bin/sh
# Select a file with fzf from a database sorted by frecency and open it using
# xdg-open. frece can be found at https://github.com/YodaEmbedding/frece
DB_FILE=${FRECE_FILES_DB:-$HOME/.cache/frecent-files.csv}
item=$(frece print "$DB_FILE" | fzf --tiebreak=index --scheme=path)
[ -z "$item" ] && exit 1
frece increment "$DB_FILE" "$item"
xdg-open "$item"
#!/bin/sh
# Update frece database
DB_FILE=${FRECE_FILES_DB:-$HOME/.cache/frecent-files.csv}
tmp_file=$(mktemp)
fd -H . ~ > "$tmp_file" # use ~/.fdignore file to exclude certain dirs
frece update "$DB_FILE" "$tmp_file" --purge-old
rm "$tmp_file"
fzf? https://github.com/junegunn/fzf
Out of the box, would only help searching shell commands that have been run, so for files, things like “vim file.txt”, which is obviously not usually how files are edited (you’d use the file browser in a text editor or IDE)
However if you find a way to list all files on your system by modified time, you can pipe it to fzf for a slick fuzzy find search.
Maybe ag would work here too: https://github.com/ggreer/the_silver_searcher
things like “vim file.txt”, which is obviously not usually how files are edited
You what mate? Don't assume my workflow. "vi file.txt" is obviously superior to clicking inside some texteditor or file browser
I can’t tell you the number of times I have in fact edited files using vim even with a WM and DE. I just treat my laptop like it’s a server I connect directly to now
Oh, or even better how many times I used the terminal in VSC to vim edit something 😂
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0