save vim file as sudo code example Example 1: vim save sudo :w !sudo tee % Example 2: take sudo access inside vim w !sudo tee %