When editing a remote file using :e scp://user@host/file
, netrw sets buftype=nofile
which causes error E382 to be raised when trying to write changes. According to :h buftype
, instead of using bt=nofile
, netrw should use bt=acwrite
.
I can replicate the issue with a fresh built version of vim isolated from the system runtime launched with /opt/vim/bin/vim -u NORC --cmd 'set nocompatible'
and an empty ~/.vim
. The exact steps to reproduce are as follows:
vim scp://<user>@<host>/<filepath>
or :edit scp://<user>@<host>/<filepath>
:write
A temporary workaround I have found is to manually :set bt=acwrite
before any write or to write using :Nwrite
. Note, that netrw will reset to bt=nofile
as part of every write.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
I encountered this myself as well - it seems the culprit commit is b0d45e7, which bumped up the netrw runtime files.
As a permanent workaround
autocmd BufRead scp://* :set bt=acwrite
can be added to vimrc
autocmd BufRead scp://* :set bt=acwrite
can be added to vimrc
To me this only solves it for the first write, after that the same problem appears again.
FWIW this workaround works indefinitely for me.
I've been using set bt=
with the BufWritePost
event and that's worked for me.
For me it took the combination of using set bt=
with both the BufRead
and BufWritePost
events. The BufRead
takes care of when the file is opened and first read. The BufWritePost
takes care of all writes.
For me it took the combination of using set bt= with both the BufRead and BufWritePost events.
This did it for me, however the buffer closes after :w
(which it also did before), which is sort of annoying.
I encountered this too, and lost my edit. (I did :xa
but the remote file wasn't saved like before.)
Encountered this too while editing files under a samba directory.
+1
This has been driving me nuts.
try to get the most recent netrw version from Charles page http://www.drchip.org/astronaut/vim/index.html#NETRW
If this still happens, have a look at :h netrw-debug
I think this was a bug of Netrw v162 and it had many troubles. So Bram reverted it and now v156 is included in the vim repository. (I'm not sure this is fixed in v163b.)
v165b seems to be working fine for me. I had some issues with the version packaged with vim 8.0.1283
Okay, since this problem seems to be fixed upstream, I'll go ahead and close it. I suppose Charles will send an update soon, since netrw hasn't been updated in a while.
Closed #2329.
I face this problem when trying to save particular local files. If you are like me, you might only need to run :set bt=
or :set buftype=
command in vim to solve the problem once and for all for that particular file.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
@imambungo
have you updated your netrw version and tested with that? http://www.drchip.org/astronaut/vim/index.html#NETRW
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
@chrisbra I never updated netrw manually, but I do update vim regularly. My vim version:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 01 2020 17:17:52)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
so please try with the latest development version, to provide feedback to the author @cecamp.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
I've tried the latest development version, nothing happens. I think in my case the problem wasn't caused by netrw. For your information, I encountered the error (E382) when trying to save .vimrc
and .bachrc
, just these 2 files. I guess it was caused when I try to install some plugin, I don't know.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
I face this problem when trying to save particular local files. If you are like me, you might only need to run
:set bt=
or:set buftype=
command in vim to solve the problem once and for all for that particular file.
I think I just found the cause, it's related to #4738.
How to reproduce:
gx
, encounter this behavior.:set bt=
.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.