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?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityThis 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 %