A Neovim plugin that provides random famous quotes from a bundled CSV file. Quotes are shuffled using the Fisher-Yates algorithm and cached for performance.
Install using your preferred Neovim package manager.
use 'mahyarmirrashed/famous-quotes'
Plug 'mahyarmirrashed/famous-quotes'
{
"mahyarmirrashed/famous-quotes.nvim",
config = function()
require("famous-quotes").setup()
end,
}
The plugin provides a single function, get_quote(count)
, to retrieve random quotes.
-- Get one random quote (default)
local quote = require('famous-quotes').get_quote()
print(quote[1].author .. ': ' .. quote[1].quote)
-- Get three random quotes
local quotes = require('famous-quotes').get_quote(3)
for _, q in ipairs(quotes) do
print(q.author .. ': ' .. q.quote)
end
-- Get all quotes
local all_quotes = require('famous-quotes').get_quote(-1)
get_quote(count?)
-1
to get all quotesauthor
and quote
fieldssetup()
Thanks to @JakubPetriska for the CSV of quotes used in this plugin.