I am trying to determine a way to edit remote files in Vim that require sudo, but still use my local vim config and plugins.
Currently I can open
:e scp://me@server//some/root/file and make changes, but when I try to write it, I of course get "permission denied".
If I try the "I forgot sudo" command (
:w !sudo tee %) it tries to scp the file back as root, which is disabled. I've also tried
ssh -t user@host sudo vim /some/file, but this does not source any local config.
Does anyone have a suggestion of a method I may have overlooked? Thank you in advance.