Re:Damn Useful: When You Forget to type Sudo
by Dobbs on Tuesday December 09, 2008 @04:31PM
(#391802)
The way mentioned in the article, might be slightly easier but as I am a vim user and have the vi mode enabled in bash,my command chain for this action is:
^[ k I sudo
Esc (^[ = Esc) exits to command mode, k goes to the previous command, shift-i moves the cursor to the beginning of the line and sudo is well sudo.
Slightly more complex but it is reflex from all of the other programs I use.
^[ k I sudo
Esc (^[ = Esc) exits to command mode, k goes to the previous command, shift-i moves the cursor to the beginning of the line and sudo is well sudo.
Slightly more complex but it is reflex from all of the other programs I use.