Can I use something like

:w !sudo tee %

in GVIM for Windows? Is there any analogue?

Or can I disable UAC for one program only and always run it as administrator?

2 Answers 2


This is difficult; you can try the SudoEdit.vim - Edit Files using sudo or su or any other tool plugin.

But it's probably easiest to just launch (G)Vim with elevated priviledges itself.


install msys2/cygwin or something include tee.exe and https://github.com/mattn/sudo Then, do :w !sudo cmd /c tee %

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .