Skip to content

A Neovim plugin that automatically saves changes to the file system as you type

License

Notifications You must be signed in to change notification settings

NitroSniper/autowrite.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autowrite.nvim

preview

What is autowrite.nvim

autowrite.nvim automatically save buffers on text changes, allowing you to focus on writing while tools receive the latest changes you make to a file

Table of Contents

Installation

Using lazy.nvim

{
  'NitroSniper/autowrite.nvim',
  tag = '0.1.0', --locked to current release
  opts = {
    -- Default Options

    -- creates :ToggleAutowrite, :EnableAutowrite, :DisableAutowrite command
    create_commands = true,
    -- log any info notifications to the user
    verbose_info = true,
    -- HACK Option: Fix Undo bug that happens on lazy, this is false by default
    undo_hack = true,
  },
}

I haven't tested it with other package managers but if any bug occurs please send in an issue

Usage

If you prefer using mappings instead of commands

vim.keymap.set('n', '<space>aw', require("autowrite").ToggleAutowrite)

Exposed Commands for use

  • ToggleAutowrite - toggles autowrite on and off on current buffer
  • EnableAutowrite - turns on autowrite on current buffer
  • DisableAutowrite - turns off autowrite on current buffer

Difference with Autowrite

  • autowrite.nvim works on individual buffers whereas 'Autowrite.vim' only works globally
  • Autowrite.vim doesn't work well with lazy.nvim as undo doesn't work correctly, autowrite.nvim has a hack option which resolves this if you are installing via lazy
  • autowrite.nvim has lua functions you can call instead if you don't want to have commands enabled

Roadmap

Features I want to implement in the future if I can

  • Implement a global switch alongside working in buffers
  • file extensions filtering

Acknowledgements

About

A Neovim plugin that automatically saves changes to the file system as you type

Resources

License

Stars

Watchers

Forks

Packages

No packages published