fixed mini sessions and added telescope
This commit is contained in:
@@ -42,3 +42,34 @@ vim.api.nvim_create_autocmd({ "WinLeave" }, {
|
||||
vim.opt_local.cursorline = false
|
||||
end,
|
||||
})
|
||||
|
||||
local group = vim.api.nvim_create_augroup("autosave", {})
|
||||
|
||||
-- Notification to say when a file is saved by autosave
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveWritePre",
|
||||
group = group,
|
||||
callback = function(opts)
|
||||
if opts.data.saved_buffer ~= nil then
|
||||
local filename = vim.fn.expand("%:t")
|
||||
print("Saved '" .. filename .. "' at " .. vim.fn.strftime("%H:%M:%S"))
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Notification when enabling/disabling autosave for a buffer
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveEnable",
|
||||
group = group,
|
||||
callback = function()
|
||||
print("AutoSave enabled")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveDisable",
|
||||
group = group,
|
||||
callback = function()
|
||||
print("AutoSave disabled")
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user