Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions shell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ adding the following snippet:

### Zsh

Load up the completion by placing the `exercism_completion.zsh` somewhere on
your `$fpath` as `_exercism`. For example:

mkdir -p ~/.config/exercism
mv ../shell/exercism_completion.zsh ~/.config/exercism/exercism_completion.zsh
mv ../shell/exercism_completion.zsh ~/.config/exercism/_exercism
Comment thread
QuLogic marked this conversation as resolved.
Outdated

Load up the completion in your `.zshrc`, `.zsh_profile` or `.profile` by adding
the following snippet
and then add the directory to your `$fpath` in your `.zshrc`, `.zsh_profile` or
`.profile` before running `compinit`:

if [ -f ~/.config/exercism/exercism_completion.zsh ]; then
source ~/.config/exercism/exercism_completion.zsh
fi
export fpath=(~/.config/exercism $fpath)
autoload -U compinit && compinit


#### Oh my Zsh
Expand Down
4 changes: 3 additions & 1 deletion shell/exercism_completion.zsh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#compdef exercism

_exercism() {
local curcontext="$curcontext" state line
typeset -A opt_args
Expand Down Expand Up @@ -33,4 +35,4 @@ _exercism() {
esac
}

compdef '_exercism' exercism
_exercism "$@"
Comment thread
QuLogic marked this conversation as resolved.
Outdated