commit 05336f341608eaffea66a3e5c5877077f18dc91c Author: syui Date: Wed Jun 11 06:16:37 2025 +0900 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..f8f7427 --- /dev/null +++ b/README.md @@ -0,0 +1,105 @@ +# airsave.nvim + +Auto save plugin for Neovim, converted from the original airsave.vim to modern Lua. + +## Features + +- Auto save on `TextChanged`, `CursorHold`, and `InsertLeave` events +- Configurable events and options +- Silent or verbose saving modes +- Easy toggle commands +- Modern Lua implementation for Neovim + +## Installation + +### Using vim-plug + +```vim +Plug 'your-username/airsave.nvim' +``` + +### Using packer.nvim + +```lua +use 'your-username/airsave.nvim' +``` + +### Using lazy.nvim + +```lua +{ + 'your-username/airsave.nvim', + config = function() + require('airsave').setup({ + auto_write = true, -- Enable auto save on startup + }) + end +} +``` + +## Configuration + +```lua +require('airsave').setup({ + auto_write = false, -- Enable auto save on startup (default: false) + no_silent = false, -- Show save messages (default: false) + events = { 'TextChanged', 'CursorHold', 'InsertLeave' }, -- Auto save events +}) +``` + +## Commands + +- `:AirSaveStart` - Start auto save +- `:AirSaveStop` - Stop auto save +- `:AirSaveToggle` - Toggle auto save + +## Key Mappings + +The plugin provides `` mappings for customization: + +- `(AirSaveStart)` - Start auto save +- `(AirSaveStop)` - Stop auto save +- `(AirSaveToggle)` - Toggle auto save + +Example custom mappings: + +```lua +vim.keymap.set('n', 'as', '(AirSaveStart)') +vim.keymap.set('n', 'aS', '(AirSaveStop)') +vim.keymap.set('n', 'at', '(AirSaveToggle)') +``` + +## Usage + +### Basic Usage + +```lua +-- Start auto save +require('airsave').start() + +-- Stop auto save +require('airsave').stop() + +-- Check if running +if require('airsave').is_running() then + print('Auto save is active') +end +``` + +### With Configuration + +```lua +require('airsave').setup({ + auto_write = true, -- Start automatically + no_silent = false, -- Silent saves + events = { 'TextChanged', 'InsertLeave' }, -- Custom events +}) +``` + +## Credits + +Based on the original [airsave.vim](https://github.com/syui/airsave.vim) by @soramugi, converted to modern Lua for Neovim. + +## License + +MIT License \ No newline at end of file