Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I looked through the vim manual, and I could only find the commands for "write and quit" and "write (if edited) and quit". Is there a command for "write out without quitting", similar to ^o in nano?

share|improve this question
6  
One may wonder exactly how you read the manual given that :help write and :help writing get you straight to the solution. –  Stéphane Chazelas Jan 15 '13 at 15:21
add comment

1 Answer 1

up vote 17 down vote accepted

Use the write command:

:write

Which can be abbreviated:

:w

If you want to write to another file without changing the current file, supply a different filename to the write command:

:write newfile

If you want to write to another file and change to that file, use the saveas command:

:saveas newfile

Which can be abbreviated:

:s newfile
share|improve this answer
13  
Or, abbreviated, just use :w, or :s newfile –  Christopher Jan 15 '13 at 14:07
5  
And :wa to :write all opened files/buffers. –  Herman Torjussen Jan 15 '13 at 14:09
3  
And :w! to force an over-write. –  goldilocks Jan 15 '13 at 14:28
    
You may want to incorporate what the comments says to make your answer more complete. –  N.N. Feb 16 '13 at 2:15
    
@N.N.: The abbreviated versions should be part of the answer, but I'm not so sure about the other use-cases. –  Thor Feb 16 '13 at 12:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.