I remember observing a few days ago that all the commands in my terminal were about opening various files of the project in vim. So I spent some time on finding a command which would, in vim itself, save the current file and open a new file.
I found out that you can give commands to shell using :! command, for example :! python manage.py syncdb. That seemed to be pretty cool.
But then I discovered a godsend, :tabe {file}. (Short for :tabedit, I also learnt that vim takes up the least possible characters which can be used to uniquely identify a command. Neat.) It opens up the file in new tab for editing. I didn't even know tabs existed in vim! And as I was working on django, being able to have multiple files open in the same window surely boosted efficiency by a few notches. There are always a few tabs open for me now and I dread remembering the closing and opening of files that I needed to do.
But today I again felt a need of a command to save the current file and open a new one. I remember not getting anything the last time I searched for it. I hope I get some time in the next few days to find it. Or better still, hopefully, I'll stumble upon it.
No comments:
Post a Comment