This is my VIM config for PHP/Ruby development based on @vjousse's config.
- Autocompletion
- Syntax hightlighting
- Snippets (comes from vim-symfony-snipmate)
- Xdebug debugger integration
- Git integration
- reStructuredText syntax + preview in browser
- Markdown syntax + preview in browser
- Ready for symfony/Symfony2
- JavaScript ready
- etc
There is a shell script to symlink all files.
This config comes with the following plugins:
- Fugitive (Git)
- Solarized
- snipMate
- Command-T
- Gitv
- Ack
- surround
- taglist-plus
- ...
:Wwill save the current file with sudo.
Important: The map leader is ,.
,twill activate Command-T to fast search files.,2will set a two-spaces indentation.,4will set a four-spaces indentation.,<Right>is a shortcut forC-](go to the declaration of a class, variable, ...).,<Left>is a shortcut forC-T(go back).zzis a shortcut forzjzo.,teis a shortcut fortabedit.,tcwill close the active tab.,tois a shortcut fortabonly.,tnwill move to the next tab.,tpwill move to the previous tab.,tfwill move to the first tab.,tlwill move to the last tab.,tmwill move the active tab to the right.,trwill move the active tab to the left.
,docon a PHP function will open the php.net doc.F7will generate a tags file using ctags.,cnswill insert the curent namespace based on the filename.<ctrl>Lwill run the PHP linter to detect syntax errors.
See also the Xdebug section above.
F1Resize the debugger window.F2Step into.F3Step over.F4Step out.,eEval a variable.F5Run the debugger.F6Quit the debugger.F11F12
This mapping only works with the php filetype.
### Markdown
F5will render the active Markdown file in your browser.
F5will render the active reStructuredText file in your browser.
C-F3will switch from the action to the view and from the view to the action.
<ctrl>lwill rungjslint(if available) to detect JS errors.
snipMate adds a lot of snippets but I also wrote mine.
- sf2xml.snippets
serviceswill add a complete XML structure to declare services in XML.servwill add a single service declaration.paramwill add a parameter declaration.tagwill add a tag declaration.argwill add a scalar argument declaration.argswill add a service type argument.
- sf2class.snippets
actionwill add an action method.
### symfony 1.x
Too many snippets, please read these files:
- symfony.snippets
- sfform.snippets
- sftemplate.snippets
tablewill add a new table block definition.columnwill add a new column declaration.fk,foreign-keywill generate a new foreign-key declaration.indexwill add a new index block definition.i-colwill add a new column index declaration.uniquewill add a new unique block definition.u-colwill add a new unique column declaration.
xdatewill insert the current date.xsigpwill insert the configured personal signature.xsigwwill insert the configured work signature.
You may have to install python-markdown :
wget http://pypi.python.org/packages/source/M/Markdown/Markdown-2.0.tar.gz
tar xvzf Markdown-2.0.tar.gz
cd Markdown-2.0/
sudo python setup.py install
Will.