read focus

This commit is contained in:
u80864958
2024-10-06 16:36:58 +02:00
parent 19dfa6b663
commit b2a118b2b3
3 changed files with 30 additions and 31 deletions

30
lua/timer.lua Normal file
View File

@ -0,0 +1,30 @@
local augroup = vim.api.nvim_create_augroup("ScratchBuffer", { clear = true })
local function focus_gained()
print("Huiii Fokus")
end
local function focus_lost()
print("Hokus pokus fort ist der fokus")
end
local function main()
print("Hello from our plugin")
print(os.time())
end
local function setup()
vim.api.nvim_create_autocmd("VimEnter",
{ group = augroup, desc = "Set a fennel scratch buffer on load", once = true, callback = main })
vim.api.nvim_create_user_command(
'Timer', -- The name of the command (accessible via :TimerStart)
function()
print("Timer started!") -- The function executed when the command is called
end,
{ nargs = 0 } -- No arguments for this command (you can configure this later)
)
vim.api.nvim_create_autocmd("FocusGained", { callback = focus_gained })
vim.api.nvim_create_autocmd("FocusLost", { callback = focus_lost })
end
return { setup = setup }

View File

@ -1,12 +0,0 @@
-- Creates an object for the module. All of the module's
-- functions are associated with this object, which is
-- returned when the module is called with `require`.
local M = {}
function M.greet()
print("Hello World")
end
-- Routes calls made to this module to functions in the
-- plugin's other modules.
return M