esc + : + q!
To save and quit vi editor
To continue with search
To copy the line where cursor is located
To quit without saving