tags:

views:

289

answers:

5

I use VIM editor for PHP, i know many people will point to PDT but somehow I like to stay with VIM and so

What are your suggestions for ideal VIM configuration for PHP Development ?

+1  A: 

You would probably want to use a PHP syntax file such as: http://www.vim.org/scripts/script.php?script_id=1571

FWIW: Personally I am enjoying learning vim at the moment but still prefer netbeans for PHP development because it has many features that I need, such as automatic scp to a remote server and remote debugging with XDebug.

Justin Ethier
@Justin: Just curious, can we do remote debugging using eclipse editor. Currently I debug using `var_dumps` and `echo`.
Rachel
Yes; from what I understand it is possible, but I have personally only used Netbeans for PHP debugging. But I have been *very* happy using Eclipse for Python debugging so I would definitely look into it. In either case, you would need XDebug installed on the PHP server.
Justin Ethier
I had no clude about Xdebug, thanks for the tip! (and a good question) :)
RymdPung
Eclipse also has a plugin for talking to ZendDebugger http://www.eclipse.org/pdt/, in case you're using ZendServer.
mozillalives
A: 

It really varies depending on your style, but a good place to start is to create a file called ~/.vim/after/ftplugin/php.vim. If you find any useful mappings for PHP, put them into this file (use the <buffer> option for mappings to stop them leaking into other types of files). Once you know what sort of values you like for tabstop, autoindent, smartindent etc, put them into the ftplugin file using :setlocal.

too much php
A: 

I like this, to automatically fold your code for you..

http://www.vim.org/scripts/script.php?script_id=1623

Folding in Vim in general...

:h folding

and to get into the php spirit, use the phpx colorscheme.. : )

http://vimcolorschemetest.googlecode.com/svn/colors/phpx.vim

Check out that project in general, for some nice colorschemes.

RymdPung
A: 

If you've used PDT and like it, you might want to look into Eclim. It allows you to use vim, but hooks into eclipse for projects, code completion, etc. This makes it a little easier to jump into PDT for debugging, then back to vim for coding.

mozillalives
+2  A: 

you really should be using Tobias Schlitt's VIP, which is "VIM integration for PHP, including the phpDocumentor for VIM (PDV) script. The main component is a VIM file type plugin, which configures a lot of VIM enhancements for more comfortable PHP editing in VIM.".

I've been using it since before its name changed from PDV to VIP and it really is superb.

You can get it off github at http://github.com/tobyS/vip

kguest