Created
May 16, 2017 18:40
-
-
Save ddrscott/0d9b55e2699f72696ce532516972f41e to your computer and use it in GitHub Desktop.
FZF `spell` command with dictionary preview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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