Skip to content

thomaslin649/fortune.nvim

Repository files navigation

Description

This plugin designed to inject a dose of inspiration, wisdom, or humor into your editing workflow. It delivers random quotes, proverbs, or jokes directly to your Neovim dashboard. Additionally, it offers helpful tips and tricks to improve your productivity and efficiency within the editor.

Useful for dashboard plugins like mini.starter and dashboard.nvim

Installation

Using packer in lua

use {"rubiin/fortune.nvim"}

Using lazy.nvim in lua

{
"rubiin/fortune.nvim"
}

Using vim-plug in vimscript

Plug "rubiin/fortune.nvim"

Configuration (optional)

Following options can be given when calling setup({config}). Below is the default configuration

{
-- max width the fortune section should take place
max_width = 60,

-- Controls the amount of text displayed
-- short - One liners (default)
-- long - Multiple lines
-- mixed - Combination of above
display_format = "short",

-- The type of fortune to display
-- quotes - Random techy quotes
-- tips - Neovim productivity tips
-- mixed - Combination of above
content_type = "quotes",

-- An optional object of custom quotes to replace the default ones like this:
-- {
--     short = {
--         { "This is a short quote", "- Author" },
--         { "This is another short quote", "- Author" },
--     },
--     long = {
--         { "This is a long quote", "- Author" },
--         { "This is another long quote", "- Author" },
--     }
-- }
custom_quotes = {},

-- An optional object of custom tips to replace the default ones like this:
-- {
--     short = {
--         { "In normal mode, x will delete a single character" },
--         { "In visual mode, x will delete a range of characters" },
--     },
--     long = {
--         { "To delete from the current line to the end of the line, use d$" },
--         { "To delete from the current line to the beginning of the line, use d^" },
--     }
-- }
custom_tips = {},
}

Usage

The plugin returns a lua table

-- dashboard.nvim reference
footer = function()
  local info = {}
  local fortune = require("fortune").get_fortune()
  info[1] = "  Neovim loaded " .. vim.fn.strftime("%H:%M") .. " on " .. vim.fn.strftime("%d/%m/%Y") .. " '"
  local footer = vim.list_extend(info, fortune)
  return footer
  end

Screenshots

Tips

When content_type="tips", it shows some useful tips and tricks like neovim shortcuts which can be very useful.

1

Quote

When content_type="quotes", it shows programming quotes that are both funny and educational.

2

Self promotion

Checkout my other plugins highlighturl vimwordlist

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages