Put vim to background
Everybody that uses vim knows that you sometimes will want to execute a couple of commands while you are editing a file. Maybe it’s to check certain things that you are writing about or someone else is bothering you in the process of writing some mastercode…
Whatever the case is you don’t just want to quit vim. Otherwise you might need to reload all those files into vim and reposition your windows again, etc.
luckily linux can be very handy in this case. When you are in command mode just press Ctrl+z and the job (vim) put the current job on halt. You can now start doing some magic in linux, and once you are finished use the folowing command.
The “1″ indicates the number of the job-process that was assigned to vim. If vim is the only job in the background it will be 1 but else you might want to check using:
And that’s all for today. It’s not much but it saves a hell lot of time. You can use this for all of the jobs you run on your commandline. While I don’t use it that frequently as I can use multiple sessions with putty it might come in handy when you are working on a server terminal directly. For instance when you have network problems you run some netstat commands to analyse the network connections at the same time and let them all run in the background. In this case I do recommend you to redirect the output to different files as it would otherwise get scrambled through each other on your terminal. You will also have to indicate that these jobs need to run in the background using:
Where 1 is the id of the job that you needs to run in the background.
A message will always be send to the terminal indicating when a job was finished and it also mentions the id of the job and the command that invoked the job.
I’m still working on part 4 of perl and I don’t have lots of time in the weekend but once it will arrive. In the mean time I’ve become more accustomed to vim in general. I’ve found a great site explaining a lot about vim and it really pays of watching his movies.