Skip to content

Commit

Permalink
Tweaks from @sorin-ionescu. Improve README.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wei Dai committed Jul 1, 2012
1 parent 1e71230 commit 33b178e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
26 changes: 25 additions & 1 deletion modules/fasd/README.md
Expand Up @@ -9,6 +9,9 @@ you can quickly reference them in the command line.
You should define your own aliases to utilize the full power of fasd. For more
information please see `man fasd` or visit [fasd][1].

For completion to work, this module should be loaded **after** the *completion*
module.

Aliases
-------

Expand All @@ -19,8 +22,29 @@ Aliases
- `sd` interactive directory selection
- `sf` interactive file selection
- `z` changes the directory to most *frecent* match.
- `j` the same as `z` for [autojump][2] converts.
- `zz` interactive z
- `j` the same as `z` for [autojump][2] converts.
- `v` open recently vim-edited files

Note: loading `fasd` module will override alias `d` defined in `directory`
module.

Completion
----------

You can do tab completion on any fasd command (d, f, z, v, etc.).

You can type a comma-separated query on *any command* and use the following key
combination:

- Ctrl-x Ctrl-a to complete files and directories
- Ctrl-x Ctrl-d to complete directories
- Ctrl-x Ctrl-f to complete files

Alternatively, you can type extra `f,`, `d,` `,` in front of your
comma-separated query, or type extra `,,f`, `,,d`, `,,` at the end of your
comma-separated query. Such formated command-line arguments will be tab
completed via fasd.

Authors
-------
Expand Down
3 changes: 1 addition & 2 deletions modules/fasd/init.zsh
Expand Up @@ -11,7 +11,7 @@ if (( ! $+commands[fasd] )); then
fi

cache_file="${0:h}/cache.zsh"
if [[ "$(which fasd)" -nt "$cache_file" || ! -s "$cache_file" ]]; then
if [[ "${commands[fasd]}" -nt "$cache_file" || ! -s "$cache_file" ]]; then

This comment has been minimized.

Copy link
@sorin-ionescu

sorin-ionescu Jul 2, 2012

That's wrong. It should be if [[ ! -s "$cache_file" ]]; then and nothing more.

This comment has been minimized.

Copy link
@clvv

clvv Jul 2, 2012

Owner

The purpose is that when there's a new version of fasd, init code will be re-cached (please give it one more glance). I can't gurantee the init code is bug free.

This comment has been minimized.

Copy link
@sorin-ionescu

sorin-ionescu Jul 2, 2012

Ok.

# Base init arguments
init_args='posix-alias zsh-hook'

Expand All @@ -29,7 +29,6 @@ source "$cache_file"
unset cache_file init_args

alias j='z' # For autojump converts
alias o="a -e $aliases[o]" # Quickly open paths with open.
alias v='f -t -e vim -b viminfo' # Quickly open files with vim.

for keymap in 'emacs' 'viins'; do
Expand Down

0 comments on commit 33b178e

Please sign in to comment.