|
NAMEfasd - quick access to files and directoriesSYNOPSISfasd [options] [query ...][f|a|s|d|z] [options] [query ...] fasd [-A|-D] [paths ...] OPTIONS
DESCRIPTIONFasd keeps track of files and directories you access in your shell and gives you quick access to them. You can use fasd to reference files or directories by just a few key identifying characters. You can use fasd to boost your command line productivity by defining your own aliases to launch programs on files or directories. Fasd, by default, provides some basic aliases, including a shell function "z" that resembles the functionality of "z" and "autojump."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. EXAMPLES
SHELL INITIALIZATIONTo get fasd working in a shell, some initialization code must be run. Put lines below in your POSIX compatible shell rc.
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 shell environment, you can pass customized set of arguments to fasd --init.
Example for a minimal zsh setup (no tab completion):
Note that this method will slightly increase your shell start-up time, since calling binaries has overhead. You can cache fasd init code if you want minimal overhead. Example code for bash (to be put into .bashrc):
Optionally, if you can also source fasd if you want fasd to be a shell function instead of an executable. You can tweak initialization code. For instance, if you want to use "c" instead of "z" to do directory jumping, you can use the alias below:
MATCHINGFasd has three matching modes: default, case-insensitive, and fuzzy.For a given set of queries (the set of command-line arguments passed to fasd), a path is a match if and only if:
If no match is found, fasd will try the same process ignoring case. If still no match is found, fasd will allow extra characters to be placed between query characters for fuzzy matching. Tips:
COMPATIBILITYFasd's basic functionalities are POSIX compliant, meaning that you should be able to use fasd in all POSIX compliant shells. Your shell need to support command substitution in $PS1 in order for fasd to automatically track your commands and files. This feature is not specified by the POSIX standard, but it's nonetheless present in many POSIX compliant shells. In shells without prompt command or prompt command substitution (tcsh for instance), you can add entries manually with "fasd -A". You are very welcomed to contribute shell initialization code for not yet supported shells.TAB COMPLETIONFasd offers two completion modes, command mode completion and word mode completion. Command mode completion works in bash and zsh. Word mode completion only works in zsh.Command mode completion is just like completion for any other commands. It is triggered when you hit tab on a fasd command or its aliases. Under this mode your queries can be separated by a space. Tip: if you find that the completion result overwrites your queries, type an extra space before you hit tab. Word mode completion can be triggered on any command. Word completion is triggered by any command line argument that starts with "," (all), "f," (files), or "d," (directories), or that ends with ",," (all), ",,f" (files), or ",,d" (directories). Examples:
There are also three zle widgets: "fasd-complete", "fasd-complete-f", "fasd-complete-d". You can bind them to keybindings you like:
BACKENDSFasd can take advantage of different sources of recent / frequent files. Most desktop environments (like Gtk) and some editors (like Vim) keep a list of accessed files. Fasd can use them as additional backends if the data can be converted into fasd's native format. As of now, fasd supports Gtk's recently-used.xbel and Vim's viminfo backends. You can define your own backend by declaring a function by that name in your .fasdrc. You set default backend with _FASD_BACKENDS variable in our .fasdrc.TWEAKSUpon every execution, fasd will source "/etc/fasdrc" and "$HOME/.fasdrc" if they are present. Below are some variables you can set:
DEBUGGINGFasd is hosted on GitHub: https://github.com/clvv/fasdIf fasd does not work as expected, please file a bug report on GitHub describing the unexpected behavior along with your OS version, shell version, awk version, sed version, and a log file. You can set _FASD_SINK in your .fasdrc to obtain a log.
COPYINGFasd is originally written based on code from z (https://github.com/rupa/z) by rupa deadwyler under the WTFPL license. Most if not all of the code has been rewritten. Fasd is licensed under the "MIT/X11" license.AUTHORSWei Dai <x@wei23.net>.
Visit the GSP FreeBSD Man Page Interface. |