mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-05-31 18:02:02 +01:00
Changed . token to _dot
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# Function querying free online English dictionary API for definition of given word(s)
|
||||
def dict [...word #word(s) to query the dictionary API but they have to make sense together like "martial law", not "cats dogs"
|
||||
] {
|
||||
let query = ($word | str join %20)
|
||||
let link = ('https://api.dictionaryapi.dev/api/v2/entries/en/' + ($query|str replace ' ' '%20'))
|
||||
let output = (http get $link | rename word)
|
||||
let w = ($output.word | first)
|
||||
|
||||
if $w == "No Definitions Found" {
|
||||
echo $output.word
|
||||
} else {
|
||||
echo $output
|
||||
| get meanings
|
||||
| flatten
|
||||
| select partOfSpeech definitions
|
||||
| flatten
|
||||
| flatten
|
||||
| reject "synonyms"
|
||||
| reject "antonyms"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user