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