3 ms·
The most useful shortcut I have in my .vimrc is the ability to "sudo save": command W :execute ':silent w !sudo tee % > /dev/null' | :edit! No more exitin
by 1_player 11y ago
The most useful shortcut I have in my .vimrc is the ability to "sudo save":
command W :execute ':silent w !sudo tee % > /dev/null' | :edit!
No more exiting vim to start it again with sudo.
- realyze 11y agoHuh. Well I kinda consider that `sudo` annoyance a feature. It tells me to think twice before potentially messing up badly. :-)
- Twirrim 11y agoLikewise, but I have the alias added so that when I discover I should have edited under sudo, I don't have to lose my work.
- 1_player 11y agoWhen I use :W is because I've been editing some system configuration files.. I know what I'm doing. And messing up is half the fun of systems administration :)
- MetaCosm 11y agoThat is one of the features I get from the https://github.com/tpope/vim-eunuch https://github.com/tpope/vim-eunuch plugin (SudoWrite).