Skip to content


Subversion checkout URL

You can clone with
Download ZIP
veriy simple xdebug protocol implementation so that you can debug PHP easily with Vim
Branch: master


No, this is no complete xdebug implementation and it will never be one.

This tries to be a quick and dirty hack to get some of my jobs done without
always firing up Eclipse

  - see vim-addon-xdebug-addon-info.txt
  - socat


1) make sure vim-addon-async works (compile the c helper application)

2) :XDbgStart

3) open web page such as

4) call g:xdebug.ctx.send('step_into')

  (Vim crashes soon :-( )
  It seems to crash less often when switching syn off! ??

  See plugin/xdebug.vim to see that Eclipse standard mappings have are used by

  XDbgStack works (current stack is feed to quickfix)

  Eg this prints the contents of $_GET
  call xdebug#Eval('$_GET')

5) watching vars:
  manually: call xdebug#Eval('$_GET')

  more convenient:
  XDbgVarView opens a buffer. Add lines like this:

    watch $_GET
    watch $_POST['foo']

  use :UpdateWatchView to update the buffer.
  This will be done automatically on stepping.

  You can visually select lines and press <cr> to execute arbitrary PHP code

6) breakpoints
  XDbgBreakPoints opens a window. You add breakpoints by adding lines (the way shown below the marker)
  then pressing enter. Some more porcelaine is missing!

  As alterntavie press F9 or use the XDbgToggleLineBreakpoint command

  :-) Most of the breakpoint types are not supported by xdebug?

  " Add to your .vimrc to enable breakpoint on first line.
  let g:xdebug = {'stop_on_first_line': 1}

7) xdebug port (defaults to 9000):
  Either call fun! xdebug#Start({'port':9001})
  or set it in your .vimrc:
  let g:xdebug.opts = { 'port' : 9001 }

- Help me make this all more mature / complete
  * inspect vars (stack level!)
  * exec code
  * break points
  base64 encoding has been implemented in webapi-vim
- implement things like "goto cursor" (there is a temporary breakpoint command)
- ...

This is the protocol documentation I found:
- The messages sent by PDT (Eclipse) can be debugged easily.

This plugin has enough features for everyday work now.
If you want more let me know.

Thanks TO
mattn (github) who wrote the nice XML parsing library which also contains the
bas64 enc/decoding

see branch screenshots or visit this url:

related work

Don't by shy and read this very accurate list about why PHP sucks:
Something went wrong with that request. Please try again.