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
- ...
:W
will save the current file with sudo.
Important: The map leader is ,
.
,t
will activate Command-T to fast search files.,2
will set a two-spaces indentation.,4
will 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).zz
is a shortcut forzjzo
.,te
is a shortcut fortabedit
.,tc
will close the active tab.,to
is a shortcut fortabonly
.,tn
will move to the next tab.,tp
will move to the previous tab.,tf
will move to the first tab.,tl
will move to the last tab.,tm
will move the active tab to the right.,tr
will move the active tab to the left.
,doc
on a PHP function will open the php.net doc.F7
will generate a tags file using ctags.,cns
will insert the curent namespace based on the filename.<ctrl>L
will run the PHP linter to detect syntax errors.
See also the Xdebug section above.
F1
Resize the debugger window.F2
Step into.F3
Step over.F4
Step out.,e
Eval a variable.F5
Run the debugger.F6
Quit the debugger.F11
F12
This mapping only works with the php filetype.
### Markdown
F5
will render the active Markdown file in your browser.
F5
will render the active reStructuredText file in your browser.
C-F3
will switch from the action to the view and from the view to the action.
<ctrl>l
will rungjslint
(if available) to detect JS errors.
snipMate adds a lot of snippets but I also wrote mine.
- sf2xml.snippets
services
will add a complete XML structure to declare services in XML.serv
will add a single service declaration.param
will add a parameter declaration.tag
will add a tag declaration.arg
will add a scalar argument declaration.args
will add a service type argument.
- sf2class.snippets
action
will add an action method.
### symfony 1.x
Too many snippets, please read these files:
- symfony.snippets
- sfform.snippets
- sftemplate.snippets
table
will add a new table block definition.column
will add a new column declaration.fk
,foreign-key
will generate a new foreign-key declaration.index
will add a new index block definition.i-col
will add a new column index declaration.unique
will add a new unique block definition.u-col
will add a new unique column declaration.
xdate
will insert the current date.xsigp
will insert the configured personal signature.xsigw
will 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.