I want to save my opened file without exit in vim using shortcut keystrokes, the way we use

shift + ZZ to save and exit.

Does anyone know how to do it?

  • 8
    you mean shorter than :w?
    – pseyfert
    Feb 22, 2017 at 10:53
  • 1
    You could put nnoremap ZS :w<cr> into your .vimrc.
    – Toothrot
    Feb 22, 2017 at 12:50
  • @Toothort thanks for help :) I did the same ..it worked !! Feb 22, 2017 at 14:09

1 Answer 1


Toothrot answered this in the comments:

You could put nnoremap ZS :w<cr> into your .vimrc

  • Alternatively, you can map it to nnoremap ZS :up<cr>. (:update saves the file only if it was changed) It behaves better it you have some scripts that trigger when the file is saved.
    – NO_NAME
    Apr 26, 2020 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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