I'm new to
vi. I started
vi on my Ubuntu machine and I can't quit. I see the editor and I can write text, at the bottom line there is a label "recording".
How do I quit the
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
I use ctrl+[ to generate the esc sequence, this keeps me from having to move my fingers from the home row (remember the esc key was in a different place when
vi was invented.
:wq will write all files regardeless of necessity. I suggest using
ZZ (which is shift+z twice) which will only write if a change has been made in the file. Also
:xa is the same as
ZZ except if you have more than 1 file open in the editor instance (such as vim tabs). note: I'm not sure all this is 100% compat with all vi clones, but I know it works with vim