Skip to content

Instantly share code, notes, and snippets.

@ddrscott
Created May 16, 2017 18:40
Show Gist options
  • Save ddrscott/0d9b55e2699f72696ce532516972f41e to your computer and use it in GitHub Desktop.
Save ddrscott/0d9b55e2699f72696ce532516972f41e to your computer and use it in GitHub Desktop.
FZF `spell` command with dictionary preview
# WARNING: depends on `brew install wn`
# Default `fold` to screen width and break at spaces
function fold {
if [ $# -eq 0 ]; then
/usr/bin/fold -w $COLUMNS -s
else
/usr/bin/fold $*
fi
}
# Use `fzf` against system dictionary
function spell {
cat /usr/share/dict/words | fzf --preview 'wn {} -over | fold' --preview-window=up:60%
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment