Visudo/sudoedit and gvim –remote-silent

gvimsudoedit

Is it possible to use gvim --remote-silent and similar as an editor for visudo and sudoedit? Actually, I don't think this is related to the --remote option. Even if I set Defaults editor = "/usr/bin/gvim", the tmpfile gvim loads is blank and editing it has no effect.

Best Answer

gvim returns almost immediately. When sudoedit notices that the editor has returned it will finish reporting no changes. To get sudoedit to work correctly you need to get it to wait until you are finished editing. I normally use -f switch to do this. I have not tried it but the manual seems to support the use of --remote-wait or --remote-wait-silent.

Related Question