Flashback 2003: vim + screen trick
Posted Tue, 02 Mar 2010
A common feature request of vim is to be able to split window and have a shell be there. Well, as it turns out, that's easy to do if you run vim inside screen (gvim not applicable here).
The original post details a simple vim keybinding that will split the screen and attach a shell and close the split when the shell exits.
However, I've got a better version now. You'll want this script, "screener.sh":
#!/bin/sh screen -X split screen -X focus down screen -X screen sh -c "cd $PWD; $SHELL; screen -X remove"Then in your .vimrc:
:map \s :silent !screener.sh<CR>The new version mostly puts the screen invocations into a shell script. Another improvement is to change to $PWD so the new shell will be in the same working directory as vim started in.