Skip to content

Provide example setup to get async netrw-write for remotes even when using :w #13

Closed
@kiryph

Description

@kiryph

When editing a remote file, saving the file with :w is blocking the editor until the file is saved to the remote. This can vary dependent on file size and remote connection.

Would it be possible to offer a setup in the wiki similar to the fugitive setting of :Gpush to make this non-blocking?

netrw-write acts on the builtin write command :write via the autocommand events BufWriteCmd and FileWriteCmd as can be seen in $VIMRUNTIME/plugin/netrwPlugin.vim:

 au BufWriteCmd  ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://*          exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>"))
 au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://*          exe "sil doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau FileWritePost ".fnameescape(expand("<amatch>"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions