Vim
Write file opened as 'readonly'
:w !sudo tee "%"
Visual editing can be used to delete any number of lines
Shift+V from point of cursor and press D key to delete
Search and replace
:%s/search/replace/g
Disable search highlight
:noh
:w !sudo tee "%"
Shift+V from point of cursor and press D key to delete
:%s/search/replace/g
:noh