This commit is contained in:
2025-06-11 08:35:03 +09:00
commit ed3949bb6a
4 changed files with 217 additions and 0 deletions

28
plugin/airsave.lua Normal file
View File

@ -0,0 +1,28 @@
-- airsave.nvim plugin initialization
-- Commands
vim.api.nvim_create_user_command('AirSaveStart', function()
require('airsave').start()
print('Auto save started')
end, { desc = 'Start auto save' })
vim.api.nvim_create_user_command('AirSaveStop', function()
require('airsave').stop()
print('Auto save stopped')
end, { desc = 'Stop auto save' })
vim.api.nvim_create_user_command('AirSaveToggle', function()
local airsave = require('airsave')
if airsave.is_running() then
airsave.stop()
print('Auto save stopped')
else
airsave.start()
print('Auto save started')
end
end, { desc = 'Toggle auto save' })
-- Key mappings (using <Plug> mappings for customization)
vim.keymap.set('n', '<Plug>(AirSaveStart)', '<cmd>AirSaveStart<cr>', { desc = 'Start auto save' })
vim.keymap.set('n', '<Plug>(AirSaveStop)', '<cmd>AirSaveStop<cr>', { desc = 'Stop auto save' })
vim.keymap.set('n', '<Plug>(AirSaveToggle)', '<cmd>AirSaveToggle<cr>', { desc = 'Toggle auto save' })