From Free Knowledge Base- The DUCK Project: information for everyone
512 bytes added,
11:45, 9 August 2020 The following lines were added (+) and removed (-):
Write to file using vim when sudo privileges needed[https://stackoverflow.com/questions/33366352/write-to-file-using-vim-when-sudo-privileges-needed Write to file using vim when sudo privileges needed] :w !sudo tee %The !sudo tee part calls tee with administrator privileges. You can add this to your .vimrc to make this trick easy-to-use: just type :w!!. " Allow saving of files as sudo when I forgot to start vim using sudo. cmap w!! w !sudo tee > /dev/null %ref: [https://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work How does the vim “write with sudo” trick work?]