If you are using VIMĀ  press ESC and :wq or ESC and SHIFT + zz