I love Vim. There is something about it. Most people that “try” Vim, hate and wonder what all the fuss is about. If you force yourself to learn it, customize your environment and start using it, you’ll want to use it for all your text editing needs. Here are few more improvements I’ve installed today.
Tagbar allows you to see inspect the current file listing the properties and methods in that file. This works for both PHP and JavasScript (yes more too I’m sure).
Here’s how to install on OS X, I’m assuming you are using the wonderful Pathogen to install Vim plugins
cd ~/.vim/bundles git clone https://github.com/majutsushi/tagbar.git echo “nmap :TagbarToggle” >> ~/.vimrcRestart Vim, open a file in Vim and then press F8. That will open a window on the right of your screen showing Classes, Functions, and Variables. Clicking (or moving cursor over top of them and hitting enter) will move the cursor in the other window to the location.
Ctags allow you to jump to the file of the classes you are calling, this was the one feature I really missed that PHPStorm did very well.
First you need to install ctags, I would recommend installing Mac Ports, then installing ctags with
port install ctagsAfter this you can generate your ctags for a project with
cd /your/project/directory/ ctags -R –languages=php .Now you when the cursor is over a class name you can click Ctrl+] to jump to that file and Ctrl+T will jump back to the original file.
Did this help you out? It took me a few days to piece together all this information together, I hope this saves you some time (who knows, maybe the future me will be thankful I wrote this down). Let me know your thoughts. email@example.com