generated from 2KAbhishek/template.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.lua
More file actions
30 lines (24 loc) · 763 Bytes
/
module.lua
File metadata and controls
30 lines (24 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---@class TemplateModule
local M = {}
local config = require('template.config').config
---Greet with a personalized message
---@param name string? Name to greet, uses config.name if not provided
---@return string greeting The greeting message
M.greet = function(name)
name = name and #name > 0 and name or config.name
local greeting = 'Hello ' .. name
M.show_notification(greeting)
return greeting
end
---Show a notification with template branding
---@param message string Message to display
M.show_notification = function(message)
if not message or #message == 0 then
message = 'Hello from Template!'
end
vim.notify(message, vim.log.levels.INFO, {
title = 'Template',
timeout = 5000,
})
end
return M