Quick vim tip18 Dec 2017
Who never opened a file with vim and then realized that you need to write but you forgot root?
sudo vim ~/.vimrc
add the following line
command W :execute ':silent w !sudo tee % > /dev/null' | :edit!
With this we only need to save the file like “:W”