Skip to content
This repository was archived by the owner on May 19, 2022. It is now read-only.

Commit 8087ee8

Browse files
committed
Cleanup
1 parent 392ed5c commit 8087ee8

File tree

3 files changed

+37
-19
lines changed

3 files changed

+37
-19
lines changed

fasd.plugin.zsh

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
11
#!/bin/zsh
2-
: ${_FASD_INIT_CACHE:=${ZSH_CACHE_DIR:-${ZDOTDIR:-$HOME}}/.fasd-init}
2+
#
3+
# ZSH-style plugin for `fasd`.
4+
# Allows this repo to be used by any ZSH plugin manager.
5+
#
6+
# You may want to add some of the following to your .zshrc (all optional):
7+
#
8+
# # If you want more control over initialization hooks:
9+
# _FASD_INIT_OPTS=(
10+
# zsh-hook
11+
# zsh-ccomp
12+
# zsh-ccomp-install
13+
# zsh-wcomp
14+
# zsh-wcomp-install
15+
# )
16+
#
17+
# # Handy aliases:
18+
# alias v="f -e $EDITOR"
19+
# alias v='f -t -e vim -b viminfo'
20+
# alias o='a -e open_command'
21+
#
22+
# # Key bindings:
23+
# bindkey '^X^A' fasd-complete # C-x C-a to do fasd-complete (files and directories)
24+
# bindkey '^X^F' fasd-complete-f # C-x C-f to do fasd-complete-f (only files)
25+
# bindkey '^X^D' fasd-complete-d # C-x C-d to do fasd-complete-d (only directories)
26+
#
27+
: ${_FASD_INIT_CACHE:=${ZSH_CACHE_DIR:-${ZDOTDIR:-$HOME}}/.fasd-init.zsh}
328

4-
path+=($0:h)
5-
manpath+=($0:h)
29+
fpath+=($0:h/fasd.plugin/bin)
30+
manpath+=($0:h/fasd.plugin/man)
631

7-
if [ "${commands[fasd]}" -nt "$_FASD_INIT_CACHE" -o ! -s "$_FASD_INIT_CACHE" ]; then
8-
fasd --init \
9-
posix-alias \
10-
zsh-hook \
11-
zsh-ccomp zsh-ccomp-install \
12-
zsh-wcomp zsh-wcomp-install \
13-
>| "$_FASD_INIT_CACHE"
14-
fi
15-
source "$_FASD_INIT_CACHE"
16-
17-
#alias v="f -e $EDITOR"
18-
#alias v='f -t -e vim -b viminfo'
19-
#alias o='a -e open_command'
32+
emulate sh -c 'autoload -U fasd'
2033

21-
#bindkey '^X^A' fasd-complete # C-x C-a to do fasd-complete (files and directories)
22-
#bindkey '^X^F' fasd-complete-f # C-x C-f to do fasd-complete-f (only files)
23-
#bindkey '^X^D' fasd-complete-d # C-x C-d to do fasd-complete-d (only directories)
34+
if [ $0:h/fasd -nt $_FASD_INIT_CACHE -o ! -s $_FASD_INIT_CACHE ]; then
35+
fasd --init \
36+
${=_FASD_INIT_OPTS:-'auto'} \
37+
>| $_FASD_INIT_CACHE
38+
fi
39+
source $_FASD_INIT_CACHE

fasd.plugin/bin/fasd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../fasd

fasd.plugin/man/man1/fasd.1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../fasd.1

0 commit comments

Comments
 (0)