A simple fact fetcher that fetches facts from the Ninjas Facts API
![](https://private-user-images.githubusercontent.com/36000994/339277256-4d73fa46-60a0-4931-ac50-784858ef1b49.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMDYzMjYsIm5iZiI6MTczOTAwNjAyNiwicGF0aCI6Ii8zNjAwMDk5NC8zMzkyNzcyNTYtNGQ3M2ZhNDYtNjBhMC00OTMxLWFjNTAtNzg0ODU4ZWYxYjQ5LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDA5MTM0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVlZDU4NDlkYzEzZDllYzNmMDgyM2Y2NGRmY2YxYTJhN2JjMWIzNDY4MzIzNjQzNjc2YzA5NTgyYzViODNiYzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.dYvL7KwwYCRUz60QAYy012euH3wTPlCDGgxVelZhlB4)
{
'notelgnis/fetchfact.nvim',
opts = {
cache_file_path = '~/.cache/facts_cache.json',
config_file_path = '~/.config/.facts_api_key',
min_facts = 2,
max_facts = 10,
},
}
- cache_file_path: Path to the cache file where the facts are stored
- config_file_path: Path to the file where the API key is stored
- min_facts: Minimum number of facts to keep in the cache before fetching new ones
- max_facts: Maximum number of facts to keep in the cache
NOTE: Do not forget to get the API key from Ninjas Facts API and add it in the config file
{
'nvimdev/dashboard-nvim',
event = 'VimEnter',
config = function()
require('dashboard').setup {
config = {
footer = function()
local fact = require('fetchfact').get_split_fact(85)
return { '', unpack(fact) }
end,
},
}
end,
},