Adding Shell to Vim Using Screen
Last updated: Aug 22, 2008When programming in Perl or any language that requires you to run it from shell it is often helpful to have two screens open at once. One screen for your editor and one screen for running the program. This is how most IDEs (Integrated Development Environment) are structured; however, since I love Vim and the Linux command line I use a program called screen to make my own IDE type setup.
Here is how I do it…
Install screen
First thing you will want to do is install screen. It is one of the most useful programs for system administrators and users of the Linux command line because you can “detach” your terminal if you are working from a remote location and come back to the exact terminal as when you left.
We are going to use it for our vim IDE but you will probably need it sooner or later for other tasks so download it now with your package manager.
For Debian systems:
apt-get install screen
FreeBSD users:
cd /usr/ports/sysutils/screen
make install clean
Setting it up
To start screen do ‘screen’ or ‘screen -r‘
The ‘screen -r’ will reattach the previous screen you had if you had any.
Then split the screen with,
Ctrl + a S
The ‘S’ is capitalized.
Once this is done you should have a two windows both at 50%.
Since I want to use most of my screen for editing and a small portion for by shell I went ahead and made the top screen have 50 lines by doing…
Ctrl + a then :resize 50
To move from one screen window to the next you will use:
Ctrl + tab
Once you have all that setup you can open your script up do some quick edits and jump down to the next screen and do an execute. Happy programming!
Need to print shipping labels on your site?
Checkout my product RocketShipIt for simple easy-to-use developer tools for UPS™ FedEx™ USPS™ and more.