Fswatch autoread discussion

I propose that we change the fswatch-autoread PR to give an API for setting different file watchers for autoread. And using those watchers to watch over a file/directory. The existing approach has issues. Two of them being:

  • @justinmk said that adding a new option to neovim is not a good idea on my PR (https://github.com/neovim/neovim/pull/12593#discussion_r611581087). By changing it to an api, we can have a default watcher and have anyone else change it through the API call, which could be called in init.vim.
  • @oberblastmeister is already working on a better file watching mechanism based on libuv. There might be even better file watchers in the future, some people might want to have plugins that support third party watchers like chowkidar. Having an api to change the backend for autoread addresses these issues and makes it extremely extensible for such purposes.

@teto, @tjdevries, @bfredl what are your thoughts on this? (In fact anybody interested who has some opinions/suggestions about this approach can share their thoughts here. I’d lke to know what does the community think about this.)

EDIT: @mjlbach just elevated my trust level so that I could tag more people. Thanks!

I elevated your trust level so tag away :slight_smile: