User guide / Files and buffers

Saving and closing

Development reference · View source

CommandEffect
Ctrl-s, :write, :w, :saveSave the active buffer
:write <path>Save as <path>
:write! (:w!, :save!)Save, replacing an existing file or one that changed on disk
:close[!] or :c[!], Space b cClose the active buffer in place; ! explicitly discards unsaved text; terminals are refused
:write-buffer-close (:wbc)Save and close the buffer in place
:window-close or :wcClose the active pane, but refuse the last pane
:quit[!] or :q[!]Close the active pane and its uniquely displayed buffer; from the last pane, exit ide mode or stop the persistent session and return to a previous running session, with unsaved-change protection
:quit-all[!] or :qa[!]Exit ide mode or stop the persistent session and return to a previous running session regardless of pane count, with unsaved-change protection; never terminate terminals
:quit-here[!] or :qh[!]Quit and let the shell wrapper change to the active explorer/file directory
:write-quit (:wq)Save, then close the pane or quit from the last one
  • Closing a buffer keeps every pane. Each pane that showed it returns to its own most recently used live buffer, or a scratch buffer when none remains.
  • Quitting in mux mode is described under Quitting and detaching .
  • Neither :close[!] nor any :quit… command ends a terminal session; see Managing terminal sessions .