sudo vim
use :w !sudo tee % to write the file that no permission to edit
:w !sudo tee %
(it could use user's custom vim profile
(refer: ArchLinuxCN IRC