I'm watching Gary Bernhardt's Destroy All Software screencasts, specifically A Compiler from Scratch. There, he runs shell commands without leaving Vim. I'm almost sure he's just using normal Vim syntax, for example on the 1-minute mark: :!chmod u+x compiler.rb
. If I do that on my computer, the window will switch to execute the shell command and then I have to press Enter to go back to the editor. This is, I think, the normal behavior for Vim, and other people have asked this before, but I don't think any answers do things the way Gary does.
I looked at his .vimrc
file, specifically the last version before the screencast was uploaded, but couldn't figure out what he might have changed to get the behavior I'm looking for. I downloaded it but I'm still not getting the right behavior, so I'm obviously missing something. None of his plug-ins seems to be related to this, so I've mostly ignored them.
I'm almost sure that I'm not looking for a solution that uses tmux, or things such as :split
, :term
, :below terminal
, or :silent
. Nor am I looking for an answer that uses something other than Vim, I believe Gary is just using Vim and a few plugins.
I watched Gary's screencasts where he specifically talks about Vim but he didn't address this question (or I didn't catch it), so if someone has figured out how to use :! <shell command>
without leaving the text editor, I'd really appreciate it if you can help me work this out. I've tested the options I mentioned before both on Mac and Linux but nothing quite worked how I'd like it to, and I'd be happy with a solution that works on either platform.
:!{cmd}
and:w !{cmd}
regarding alternate screen" might cover at least part of it... Take a look at the answer and comments on that question, you might find that useful... Not sure if that will cover everything though, the video is quick, but I have the impression not to see the "Press ENTER prompt", not sure how to get that part of it...t_ti
/t_te
stuff to not clobber the screen having an unintended side-effect.):set t_ti= t_te=
and does seem to do the trick