neovim-component icon indicating copy to clipboard operation
neovim-component copied to clipboard

Better swap file handling with 'SwapExists' autocmd event

Open rhysd opened this issue 9 years ago • 0 comments

Currently NyaoVim simply ignores swap files because message on detecting swap file is shown before Neovim opens screen and NyaoVim can't catch it yet.

But SwapExists auto command event may be available for this.

  1. Add below command as an argument of nvim
  2. Notify to NyaoVim that swap file is detected
  3. NyaoVim show dialog and user select a choice ('o', 'e', 'r', 'd', 'q', or 'a')
  4. Set v:swapchoice properly
augroup nyaovim-swap
    autocmd SwapExists * call SendSwapNotification(v:swapname) | autocmd! nyaovim-swap
augroup END

rhysd avatar Feb 23 '16 01:02 rhysd