+0
日增长
5,892
stars
236
forks
1
watchers
38
prs
0
issues
0
releases
README
Fasd
Fasd (pronounced similar to "fast") is a command-line productivity booster.
Fasd offers quick access to files and directories for POSIX shells. It is
inspired by tools like autojump,
z and v. Fasd keeps
track of files and directories you have accessed, so that you can quickly
reference them in the command line.
The name fasd comes from the default suggested aliases f(files),
a(files/directories), s(show/search/select), d(directories).
Fasd ranks files and directories by "frecency," that is, by both "frequency" and
"recency." The term "frecency" was first coined by Mozilla and used in Firefox
(link).
Introduction
If you use your shell to navigate and launch applications, fasd can help you do
it more efficiently. With fasd, you can open files regardless of which
directory you are in. Just with a few key strings, fasd can find a "frecent"
file or directory and open it with command you specify. Below are some
hypothetical situations, where you can type in the command on the left and fasd
will "expand" your command into the right side. Pretty magic, huh?
v def conf = vim /some/awkward/path/to/type/default.conf
j abc = cd /hell/of/a/awkward/path/to/get/to/abcdef
m movie = mplayer /whatever/whatever/whatever/awesome_movie.mp4
o eng paper = xdg-open /you/dont/remember/where/english_paper.pdf
vim f rc lo = vim /etc/rc.local
vim f rc conf = vim /etc/rc.conf
Fasd comes with some useful aliases by default:
sh
alias a='fasd -a' any
alias s='fasd -si' show / search / select
alias d='fasd -d' directory
alias f='fasd -f' file
alias sd='fasd -sid' interactive directory selection
alias sf='fasd -sif' interactive file selection
alias z='fasd_cd -d' cd, same functionality as j in autojump
alias zz='fasd_cd -d -i' cd with interactive selection
Fasd will smartly detect when to display a list of files or just the best
match. For instance, when you call fasd in a subshell with some search
parameters, fasd will only return the best match. This enables you to do:
sh
mv update.html d www
cp f mov .
Install
Fasd is available in various package managers. Please check
the wiki page
for an up-to-date list.
You can also manually obtain a copy of fasd.
Download fasd 1.0.1 from GitHub:
zip,
tar.gz.
Fasd is a self-contained POSIX shell script that can be either sourced or
executed. A Makefile is provided to install fasd and fasd.1 to desired
places.
System-wide install:
make install
Install to $HOME:
PREFIX=$HOME make install
Or alternatively you can just copy fasd to anywhere you like (preferably
under some directory in $PATH).
To get fasd working in a shell, some initialization code must be run. Put the
line below in your shell rc.
sh
eval "$(fasd --init auto)"
This will setup a command hook that executes on every command and advanced tab
completion for zsh and bash.
If you want more control over what gets into your she