You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now vdebug starts only listening process and process to debug should be started manually outside Vim.
For now I use following code in my vimrc to automate the process:
function!Debug(url)
let url =a:url" add 'http://' if it is not in urllet http_pos =stridx(url, 'http')
if http_pos !=0let url ='http://'.url
endif" add 'vim_debug' IDE key to url, this IDE key is also set in vdebug optionslet q_pos =stridx(url, '?')
if q_pos ==-1let url = url.'?XDEBUG_SESSION_START=vim_debug'elselet url = url.'&XDEBUG_SESSION_START=vim_debug'endif" launch browsercallOpenBrowser(url)
" start debuggingpython debugger.run()
endfunctioncommand! -nargs=1DebugcallDebug('<args>')
This command allow to launch browser via OpenBrowser plugin and then start vdebug.
I use it like this:
: Debug http://myhost.com/xxx.php
Another one to debug currently edited python script:
function!DebugPy(...)
let str_args =join(a:000, '')
" command to launch - uses local path to pydbgp, probably this can be done in a better waylet last_cmd ='!python -S ~/pydbgp/bin/pydbgp -d localhost:9000 -k vim_debug ' . str_args
" save last used args, command and its results to files (for debugging of this function)execute'silent !echo "' . str_args . '" > ~/vim.last.arg.txt &'execute'silent !echo "' . last_cmd . '" > ~/vim.last.cmd.txt &'" launch command in backgoundexecute'silent ' . last_cmd . ' > ~/vim.last.out.txt 2> ~/vim.last.err.txt &'" start debuggingpython debugger.run()
endfunctioncommand! -nargs=* DebugPy callDebugPy('% <args>')
Now I can do this:
: DebugPy
And debug current python file.
Probably the same can be done in a better way inside the python code and maybe not only for php/python, but for other supported languages as well.
Also another python-based plugin for debugging, vim-debug, can do this
The text was updated successfully, but these errors were encountered:
I think this is somewhat out of the reach of what we can do with vim. It might work but will be very error prone for different browsers, if users use multiple profiles, multiple windows, there will be too many issues
Now vdebug starts only listening process and process to debug should be started manually outside Vim.
For now I use following code in my vimrc to automate the process:
This command allow to launch browser via OpenBrowser plugin and then start vdebug.
I use it like this:
Another one to debug currently edited python script:
Now I can do this:
And debug current python file.
Probably the same can be done in a better way inside the python code and maybe not only for php/python, but for other supported languages as well.
Also another python-based plugin for debugging, vim-debug, can do this
The text was updated successfully, but these errors were encountered: