diff options
author | max397574 <[email protected]> | 2021-12-08 14:25:39 +0100 |
---|---|---|
committer | max397574 <[email protected]> | 2021-12-08 14:25:39 +0100 |
commit | 87d1ca970849274fb1352eafab20b20d36ca5ac8 (patch) | |
tree | 22846195383e5e79aae90425ada280126c0830c7 /lua/startup/functions.lua | |
parent | ad8430ac8d2b7d6931f52830892d5ce5293eb283 (diff) |
feat(functions): added time/date and annotations
Diffstat (limited to 'lua/startup/functions.lua')
-rw-r--r-- | lua/startup/functions.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lua/startup/functions.lua b/lua/startup/functions.lua index cac0089..cdc56ea 100644 --- a/lua/startup/functions.lua +++ b/lua/startup/functions.lua @@ -1,13 +1,21 @@ +---@brief [[ +---@tag startup.nvim_functions +--- This are functions which you can use to build your own startup.nvim theme. +---@brief ]] local functions = {} local quotes = require("startup.quotes") +--- Returns a random programming quote +---@return table quote Lines of text for the quote function functions.quote() math.randomseed(os.clock()) local index = math.random() * #quotes return quotes[math.floor(index) + 1] end +--- Returns a string with the number of loaded Packer Plugins +---@return string PluginInfo String with info about the number of loaded plugins function functions.packer_plugins() return { string.format( @@ -17,4 +25,12 @@ function functions.packer_plugins() } end +--- Returns the current date and time +---@return table date_time Table with a string for the date and one for the time +function functions.date_time() + local clock = " " .. os.date("%H:%M") + local date = " " .. os.date("%d-%m-%y") + return { clock, date } +end + return functions |