You are missing the point of sudoedit, but the manual doesn't explain it so fret not.
Most editors have shell escapes, for example :shell in vim which would allow you to gain a root shell even though you might not have such permission under sudo. This is called "privilege escalation" and is a Bad Thing.
The sudoedit command does the equivalent of:
# cp source-file /tmp/some-temporary-name
$ ${EDITOR} /tmp/some-temporary-name
# cp /tmp/some-temporary-name source-file
# rm /tmp/some-temporary-name
Note that the editor is run as you, not root, so you cannot use the editor for privilege escalation.
If you have very permissive sudo rights (as is often the case on single user machines depending on the distribution) you can
$ sudo vim source-file
to get the behavior you want.
sudoanyway. – Ben Sep 17 '13 at 10:42Ctrl+Zin command mode (i.e. default mode) in vim - you'll put vim in background. After you do your work, you can usefg %n(or just%n) with whatevernvim gets (bash will print the number after youCtrl+Z) to get vim back in foreground. – Ruslan Sep 17 '13 at 12:00vimshould become the current job of the shell, sofgwithout arguments should work. – jofel Sep 17 '13 at 12:18%withoutfg. – Ruslan Sep 17 '13 at 12:36