Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hi, I have a question about Vim and Bash.

If I type ":w[Enter]" and then quickly thereafter CTRL-Z, will my file be completely saved before Vim is suspended? Or can the suspend operation happen in the middle of the saving operation?



The latter, if you're unlucky. You may be interested to know that :suspend is a command.


Thanks. I guess it would be nice if CTRL+Z mapped to :suspend under the hood.


:map W :w!<Return>:suspend<Return>

This has no error handling and I don’t know how to make a new :command but it might hint you along to an answer.


Take your ctrl sequences and go back to Emacs ;-)




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: