I want to map w! in vim to save a file using sudo silently (without need to press [Enter] and [L] keys).
Here is a line that works just perfectly:
command! W :execute ':silent w !sudo tee % > /dev/null' | :edit!
But it is W, not w! (with exclamation point)
How do I get that?
The builtin commands cannot be user-overridden.
You could however do
to ‘magically’ translate a lone
wtoW, which has the desired effect, AFAICT