: e![File name] → Close the currently open file without quitting vi and open another file : e! If there is no file name, restore the currently open file to the state when it was last saved.
Close the currently open file and open another file without exiting: e vi : q → Exit vi. I get a warning when the content is changed and I can not finish : q! → forced termination of vi : w Save the edited contents : wq ,: x, ZZ Save the edited contents and exit vi Save: wq! vi and kill it